本文整理汇总了C++中OnUpdate函数的典型用法代码示例。如果您正苦于以下问题:C++ OnUpdate函数的具体用法?C++ OnUpdate怎么用?C++ OnUpdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OnUpdate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OnActiveButton
static void OnActiveButton(WndButton* pWnd){
if (HoldOff ==0)
{
int res = dlgWayPointSelect(0, 90.0, 1, 3);
if(res > RESWP_END )
if(ValidWayPoint(res))
{
double Frequency = StrToDouble(WayPointList[res].Freq,NULL);
if(!ValidFrequency(Frequency))
{
// DoStatusMessage(_T("No valid Frequency!") );
return;
}
devPutFreqActive(Frequency, WayPointList[res].Name);
_stprintf(RadioPara.ActiveName,_T("%s"), WayPointList[res].Name);
RadioPara.ActiveFrequency = Frequency;
ActiveRadioIndex = res;
}
OnUpdate();
HoldOff = HOLDOFF_TIME;
}
}
开发者ID:LK8000,项目名称:LK8000,代码行数:24,代码来源:dlgRadioSettings.cpp
示例2: QSettings
//------------------------------------------------------------------------------
// OnBrowse
//
void WsdlFileView::OnBrowse()
{
QString seedFile = QSettings().value(WsInfo().WsdlFileNameKey(m_host), QVariant()).toString();
// Load file
QString fileName = QFileDialog::getOpenFileName(this, QString("Select %1 WSDL File").arg(m_host), seedFile, "WSDL (*.wsdl);; All (*.*)");
if (fileName.isEmpty())
return;
ui.WsdlFileNameLabel->setText(QFileInfo(fileName).fileName());
ui.WsdlFileNameLabel->setToolTip(QDir::toNativeSeparators(fileName));
if (HeaderContainerWidget* w = qobject_cast<HeaderContainerWidget*>(parent()->parent()))
{
w->Header()->SetTitle(QFileInfo(fileName).fileName());
w->Header()->setToolTip(QDir::toNativeSeparators(fileName));
}
QSettings().setValue(WsInfo().WsdlFileNameKey(m_host), fileName);
WsInfo().SetWsdlFile(m_host, fileName);
m_wsdlFile = WsInfo().Wsdl(m_host);
OnUpdate();
}
开发者ID:dpinney,项目名称:essence,代码行数:27,代码来源:WsdlFileView.cpp
示例3: memcpy
void CToolManagerHardDisk::InitDlgInfo(SDK_SystemFunction *pSysFunc, H264_DVR_DEVICEINFO *pDeviceInfo)
{
memcpy(&m_systemFunction,pSysFunc,sizeof(SDK_SystemFunction));
if (m_systemFunction.vEncodeFunction[SDK_ENCODE_FUNCTION_TYPE_SNAP_STREAM])
{
GetDlgItem(IDC_BTN_SS)->ShowWindow(SW_SHOW);
}
else
{
GetDlgItem(IDC_BTN_SS)->ShowWindow(SW_HIDE);
}
if (strcmp(pDeviceInfo->sSoftWareVersion, "V2.40.R06") >= 0)
{
EnableItems(TRUE);
}
else
{
EnableItems(FALSE);
}
OnUpdate();
}
开发者ID:chinajeffery,项目名称:cpp-surveillance-cli,代码行数:24,代码来源:ToolManagerHardDisk.cpp
示例4: QWidget
//------------------------------------------------------------------------------
// WsdlFileView
//
WsdlFileView::WsdlFileView(const QString& host, QWidget* parent)
: QWidget(parent),
m_host(host),
m_wsdlFile(WsInfo().Wsdl(host))
{
ui.setupUi(this);
ui.TableView->setModel(&m_model);
ui.TableView->horizontalHeader()->hide();
ui.TableView->verticalHeader()->hide();
ui.TableView->horizontalHeader()->setStretchLastSection(true);
ui.TableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
connect(ui.TableView, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(OnMethodDoubleClicked(const QModelIndex&)));
ui.WsdlFileNameLabel->setText(QFileInfo(m_wsdlFile->FileName()).fileName());
ui.WsdlFileNameLabel->setToolTip(QDir::toNativeSeparators(m_wsdlFile->FileName()));
connect(ui.BrowseBtn, SIGNAL(clicked()), this, SLOT(OnBrowse()));
connect(&m_model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(OnModelChanged(QStandardItem*)));
connect(m_wsdlFile, SIGNAL(WsdlMethodUpdated()), this, SLOT(OnWsdlMethodUpdated()));
// force update after the m_wsdlFile has been parsed and instantiated in its constructor
QTimer::singleShot(0, this, SLOT(OnUpdate()));
}
开发者ID:dpinney,项目名称:essence,代码行数:27,代码来源:WsdlFileView.cpp
示例5: ASSERT
void CModuleWnd::OnLibOpen()
{
ASSERT(m_pCurrentDocument == NULL); //当前应处于库目录显示状态中
AfxGetApp()->DoWaitCursor(1);
//打开库文档
POSITION pos = GetListCtrl()->GetFirstSelectedItemPosition();
int index = GetListCtrl()->GetNextSelectedItem(pos);
if (index < 0)
return;
TCHAR buffer[40];
GetListCtrl()->GetItemText(index, 0, buffer, 40);
CString strName = buffer;
CModuleDoc* pDoc = new CModuleDoc();
if (pDoc == NULL)
AfxThrowMemoryException();
pDoc->OpenLib(strName);
//设置新图标大小
// GetListCtrl()->SetImageList(&m_ImageContentSmall, LVSIL_SMALL);
// GetListCtrl()->SetImageList(&m_ImageContentLarge, LVSIL_NORMAL);
//更新显示
m_pCurrentDocument = pDoc;
//改变图标
GetListCtrl()->SetImageList(&m_pCurrentDocument->m_listImage, LVSIL_SMALL);
GetListCtrl()->SetImageList(&m_pCurrentDocument->m_listImageLarge, LVSIL_NORMAL);
OnUpdate();
DoCommand(-1);
AfxGetApp()->DoWaitCursor(-1);
}
开发者ID:JackWangCUMT,项目名称:SuperCxHMI,代码行数:36,代码来源:ModuleWnd.cpp
示例6: OnUpdate
void Window::Update(float elapsed)
{
if (IsDone())
{
return;
}
OnUpdate(elapsed);
WindowList doneChildren;
for (WindowList::iterator iter = m_children.begin(); iter != m_children.end(); ++iter)
{
const boost::shared_ptr<Window> child(*iter);
if (child->IsDone())
{
doneChildren.push_back(child);
}
}
for (WindowList::iterator iter = doneChildren.begin(); iter != doneChildren.end(); ++iter)
{
m_children.erase(find(m_children.begin(), m_children.end(), *iter));
}
}
开发者ID:FooSoft,项目名称:moonfall,代码行数:24,代码来源:Window.cpp
示例7: OnInput
void SDLWrapper::OnExecute( )
{
// Frame starts
//
double startTime = m_timer->GetElapsedTime( );
// Input
//
OnInput( );
// Update
//
OnUpdate( );
// Draw
//
OnRender( );
// Time Management
//
double endTime = m_timer->GetElapsedTime( );
double nextTimeFrame = startTime + DESIRED_FRAME_TIME;
while( endTime < nextTimeFrame )
{
// Spin lock
//
endTime = m_timer->GetElapsedTime( );
}
// Frame ends
//
++m_nUpdates;
m_deltaTime = m_nUpdates / static_cast< double >( DESIRED_FRAME_RATE );
}
开发者ID:raydelto,项目名称:GeometryWars,代码行数:36,代码来源:SDLWrapper.cpp
示例8: OnUpdate
void CPlayerView::OnTimer(UINT nIDEvent)
{
OnUpdate( this,0 , NULL );
if ( IDLE == m_nStatus )
{
m_nCurrentTime = 0;
m_Position.SetPos( m_nCurrentTime );
}
if ( PLAYING == m_nStatus )
{
if ( m_pPlayStream )
{
m_nCurrentTime = ( m_pPlayStream->GetCurrentTime() +
m_dwSeekOffset );
}
m_Position.SetRange( 0, m_nTotalTime );
m_Position.SetPos( m_nCurrentTime );
}
SetControls();
}
开发者ID:joshlong,项目名称:libcd,代码行数:24,代码来源:PlayerView.cpp
示例9: OnUpdate
void
FieldView::SetReferencePoint(unsigned which)
{
mCurrentReferencePoint = which;
OnUpdate(this);
}
开发者ID:superoven,项目名称:calchart,代码行数:6,代码来源:field_view.cpp
示例10: RegisterWindowClass
int Luxko::Application::BaseApp::Run(HINSTANCE hInstance, int nCmdShow)
{
//**********************************************************************
// @Luxko: 1stly, register the window class.
// This job is delegates to the virtual function RegisterWindowClass.
auto windowClass = RegisterWindowClass(hInstance);
if (windowClass == NULL) {
throw "Window class Registration failed!";
}
//**********************************************************************
//**********************************************************************
// @Luxko: 2ndly, create a window instance with the help of a WindowDescriptor,
// which encapsulates essential details for D3D window creation.
WindowDescriptor wd(WindowStyle::OverlappedWindow, ExtendedWindowStyle::OverlappedWindow,
0, 0,_width,_height);
_hWindow = wd.GenerateWindowByATOM(hInstance, windowClass, _title);
if (_hWindow == NULL) {
throw "Window Creation Fucking failed!";
}
//**********************************************************************
// @Luxko: Do the initialization necessary for the application.
OnInit();
//**********************************************************************
// @Luxko: Now we're ready to show the window.
ShowWindow(_hWindow, nCmdShow);
//UpdateWindow(_hWindow);
//**********************************************************************
//**********************************************************************
// @Luxko: Do the initialization necessary for the application.
//OnInit();
//**********************************************************************
//**********************************************************************
// @Luxko: go to the main loop.
MSG msg = { 0 };
while (true) {
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
if (msg.message == WM_QUIT) {
break;
}
OnEvent(msg);
}
else {
OnUpdate();
OnRender();
}
}
OnDestroy();
//**********************************************************************
//**********************************************************************
// @Luxko: the returned value is the wParam of the last received
// WM_QUIT message.
return static_cast<char>(msg.wParam);
//**********************************************************************
}
开发者ID:DaseinPhaos,项目名称:AnuthurEngine,代码行数:67,代码来源:ApplicationBase.cpp
示例11: OnUpdate
void CUIBase::Update(float fDeltaTime, ULONG ElapsedTime)
{
OnUpdate(fDeltaTime, ElapsedTime);
UpdateChild(fDeltaTime, ElapsedTime);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:5,代码来源:UIBase.cpp
示例12: OnUpdate
int KRepresentMissileProcessor::Update(double fTime, double fTimeLast)
{
return OnUpdate(fTime, fTimeLast);
}
开发者ID:1suming,项目名称:pap2,代码行数:4,代码来源:krepresentmissileprocessor.cpp
示例13: RETURN_IF_EQUAL
void IScrollMathModel::SetDirection(ScrollDirection val)
{
RETURN_IF_EQUAL(mDirection, val);
mDirection = val;
OnUpdate();
}
开发者ID:johndpope,项目名称:Medusa,代码行数:6,代码来源:IScrollMathModel.cpp
示例14: KillTimer
void CPhotoPubView::OnTimer(UINT_PTR nIDEvent)
{
KillTimer(1);
CPhotoPubDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: Add your message handler code here and/or call default
int nFiles=m_CurFiles.size();
set<CString> CurFiles1;
const int nFiles1=GetAllFolderFile(m_WatchingPath, "*.jpg", CurFiles1);
if (nFiles==nFiles1) {
SetTimer(1,500,NULL);
return;
}else if (nFiles>nFiles1){
AfxMessageBox("同步发生错误,无法恢复,请重新运行!\n");
exit(1);
}
//Here Comes a new Photo
//wait transfering
Sleep(1000);
//process
set<CString>::iterator it1;
for (it1=CurFiles1.begin();it1!=CurFiles1.end();++it1)
{
if ( m_CurFiles.find(*it1)==m_CurFiles.end() ) //not exist before
{
((CMainFrame*)GetParent())->ShowWindow(SW_SHOWMAXIMIZED);
CClientDC cdc(this);
CRect clrct;
GetClientRect(&clrct);
int width=clrct.Width();
int height=clrct.Height();
if (pDoc->m_pOpenedImage) ReleaseFImage(&pDoc->m_pOpenedImage);
IplImage *pImg=pDoc->m_pOpenedImage=LoadFImage(m_WatchingPath+"\\"+*it1+".jpg");
m_ratio=min(double(width)/pImg->width,double(height)/pImg->height);
((CMainFrame*)GetParent())->SetRatio(int(m_ratio*100));
OnUpdate(NULL,NULL,NULL);
DrawImage(&cdc,pImg);
CString newname;
int res;
do {
GetNewName(m_InitStr,newname);
res=rename(m_WatchingPath+"\\"+*it1+".jpg",m_WatchingPath+"\\"+newname+".jpg");
}while(
(res==0) ? false : (true,
(errno==EEXIST) ? AfxMessageBox("文件名重复!请重试"): (
(errno==EINVAL) ? AfxMessageBox("文件名含非法字符!请重试"):AfxMessageBox("未知错误!请重试")
) ) );
m_CurFiles.insert(newname);
m_InitStr=newname;
CStringNumber snum(m_InitStr);
snum.Increase();
snum.ToString(m_InitStr);
//break;
}
}
CScrollView::OnTimer(nIDEvent);
SetTimer(1,500,NULL);
}
开发者ID:ysomebody,项目名称:photopub,代码行数:65,代码来源:PhotoPubView.cpp
示例15: OnUpdate
void CActivityView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
OnUpdate(NULL,0,NULL);
}
开发者ID:Anonymousvn,项目名称:bigbrother,代码行数:6,代码来源:ActivityView.cpp
示例16: OnNext
EMenuAction CMenuBase::Update (void)
{
// Increase time elapsed in this menu mode
m_MenuModeTime += m_pTimer->GetDeltaTime ();
// If we don't have to exit this menu mode yet
if (!m_HaveToExit)
{
// If NEXT control is pressed
if (m_pInput->GetMainInput().TestNext())
{
// Don't play menu next sound because the choices of the user
// could not be correct and we may have to play an error sound instead.
OnNext ();
}
// If PREVIOUS control is pressed
else if (m_pInput->GetMainInput().TestPrevious())
{
// Play the menu previous sound
m_pSound->PlaySample (SAMPLE_MENU_PREVIOUS);
OnPrevious ();
}
// If UP control is pressed
else if (m_pInput->GetMainInput().TestUp())
{
// Play the menu beep sound
m_pSound->PlaySample (SAMPLE_MENU_BEEP);
OnUp ();
}
// If DOWN control is pressed
else if (m_pInput->GetMainInput().TestDown())
{
// Play the menu beep sound
m_pSound->PlaySample (SAMPLE_MENU_BEEP);
OnDown ();
}
// If LEFT control is pressed
else if (m_pInput->GetMainInput().TestLeft())
{
// Play the menu beep sound
m_pSound->PlaySample (SAMPLE_MENU_BEEP);
OnLeft ();
}
// If RIGHT control is pressed
else if (m_pInput->GetMainInput().TestRight())
{
// Play the menu beep sound
m_pSound->PlaySample (SAMPLE_MENU_BEEP);
OnRight ();
}
// Update the menu screen
OnUpdate ();
}
// If the transition has been entirely done (enough time has elapsed)
else if (m_MenuModeTime >= m_ExitMenuModeTime + TRANSITION_DURATION)
{
// It's OK to exit now!
// Ask for the menu action we saved
return m_ExitMenuAction;
}
// Don't have to change menu mode nor game mode
return MENUACTION_NONE;
}
开发者ID:Enucatl,项目名称:bombermaaan-x,代码行数:71,代码来源:CMenuBase.cpp
示例17: OnUpdate
float UAISense_Blueprint::Update()
{
const float TimeUntilUpdate = OnUpdate(UnprocessedEvents);
UnprocessedEvents.Reset();
return TimeUntilUpdate;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:6,代码来源:AISense_Blueprint.cpp
示例18: OnUpdate
void OUGUIObject::UpdateSelf(float fDeltaTime, float fMX, float fMY)
{
/** 如果鼠标不在HGE窗口内 */
//if(!m_pHGE->Input_IsMouseOver()) return;
bool bLButton = m_pHGE->Input_GetKeyState(HGEK_LBUTTON);
bool bRButton = m_pHGE->Input_GetKeyState(HGEK_RBUTTON);
bool bMButton = m_pHGE->Input_GetKeyState(HGEK_MBUTTON);
int nWheel = m_pHGE->Input_GetMouseWheel();
OnUpdate(fDeltaTime, fMX, fMY);
/** 若控件不可用 */
if(!GetEnableMode()) return;
if(!GetShowMode()) return;
/** 若有鼠标捕获的控件 */
if(OUGUIObject::m_pMouseCaptureControl &&
OUGUIObject::m_pMouseCaptureControl != this &&
!IsParent(OUGUIObject::m_pMouseCaptureControl))
{
return;
}
/** 若有模式窗口 */
if(OUGUIObject::m_pModalControl &&
OUGUIObject::m_pModalControl != this &&
!IsParent(OUGUIObject::m_pModalControl))
{
return;
}
/** 若有控件在激活状态下 */
if(OUGUIObject::m_pActiveControl &&
OUGUIObject::m_pActiveControl != this)
{
return;
}
/** 如果鼠标没有被按下,则检测是不是OnEnter */
if(!bLButton && OnCheckCollision(fMX, fMY))
{
//SetMouseEnter(OnCheckCollision(fMX, fMY));
SetMouseEnter(true);
}
/** 如果鼠标抬起,则检测是不是OnLeave */
else
if(!bLButton && !OnCheckCollision(fMX, fMY) && GetMouseEnter())
{
SetMouseEnter(false);
this->m_bMouseLButton = false;
this->m_bMouseMButton = false;
this->m_bMouseRButton = false;
this->m_nMouseWheel = 0;
if(OUGUIObject::GetActiveControl() == this)
{
OUGUIObject::SetActiveControl(NULL);
}
return;
}
if(GetMouseEnter() || OUGUIObject::GetMouseCaptureControl() == this)
{
SetMousePos(fMX, fMY);
SetMouseLButton(bLButton);
SetMouseRButton(bRButton);
SetMouseMButton(bMButton);
SetMouseWheel(nWheel);
/** 键盘响应 */
for(int i = 0; i < 256; i++)
{
if(i == HGEK_LBUTTON) continue;
if(i == HGEK_RBUTTON) continue;
if(i == HGEK_MBUTTON) continue;
if(m_pHGE->Input_KeyDown(i)) OnKeyDown(i);
else
if(m_pHGE->Input_KeyUp(i)) OnKeyUp(i);
}
OnIdle();
}
else
{
/** 清空状态 */
SetMouseLButton(false);
SetMouseRButton(false);
SetMouseMButton(false);
SetMouseWheel(nWheel);
}
}
开发者ID:XadillaX,项目名称:hge-mfc-demo,代码行数:95,代码来源:OUGUIObject.cpp
示例19: switch
LRESULT ScriptEditorDialog::ScriptEditorDialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch(uMsg) {
case WM_WINDOWPOSCHANGED: {
RECT rcParent;
::GetClientRect(m_hWndWindowItems[WINDOW_HANDLE], &rcParent);
::SetWindowPos(m_hWndWindowItems[BTN_SAVE_SCRIPT], nullptr, (rcParent.right / 3) * 2, rcParent.bottom - GuiSettingManager::m_iEditHeight - 2,
rcParent.right - ((rcParent.right / 3) * 2) - 2, GuiSettingManager::m_iEditHeight, SWP_NOZORDER);
::SetWindowPos(m_hWndWindowItems[BTN_CHECK_SYNTAX], nullptr, (rcParent.right / 3) + 1, rcParent.bottom - GuiSettingManager::m_iEditHeight - 2,
(rcParent.right / 3) - 2, GuiSettingManager::m_iEditHeight, SWP_NOZORDER);
::SetWindowPos(m_hWndWindowItems[BTN_LOAD_SCRIPT], nullptr, 2, rcParent.bottom - GuiSettingManager::m_iEditHeight - 2, (rcParent.right / 3) - 2, GuiSettingManager::m_iEditHeight, SWP_NOZORDER);
::SetWindowPos(m_hWndWindowItems[REDT_SCRIPT], nullptr, 0, 0, rcParent.right - ScaleGui(40), rcParent.bottom - GuiSettingManager::m_iEditHeight - 4, SWP_NOMOVE | SWP_NOZORDER);
return 0;
}
case WM_COMMAND:
switch(LOWORD(wParam)) {
case (REDT_SCRIPT+100):
if(HIWORD(wParam) == EN_UPDATE) {
OnUpdate();
}
break;
case (BTN_LOAD_SCRIPT+100):
OnLoadScript();
return 0;
case BTN_CHECK_SYNTAX:
OnCheckSyntax();
return 0;
case BTN_SAVE_SCRIPT:
OnSaveScript();
return 0;
case IDOK:
case IDCANCEL:
::PostMessage(m_hWndWindowItems[WINDOW_HANDLE], WM_CLOSE, 0, 0);
return 0;
}
if(RichEditCheckMenuCommands(m_hWndWindowItems[REDT_SCRIPT], LOWORD(wParam)) == true) {
return 0;
}
break;
case WM_CONTEXTMENU:
OnContextMenu((HWND)wParam, lParam);
break;
case WM_NOTIFY:
if(((LPNMHDR)lParam)->hwndFrom == m_hWndWindowItems[REDT_SCRIPT] && ((LPNMHDR)lParam)->code == EN_LINK) {
if(((ENLINK *)lParam)->msg == WM_LBUTTONUP) {
RichEditOpenLink(m_hWndWindowItems[REDT_SCRIPT], (ENLINK *)lParam);
}
}
break;
case WM_GETMINMAXINFO: {
MINMAXINFO *mminfo = (MINMAXINFO*)lParam;
mminfo->ptMinTrackSize.x = ScaleGui(443);
mminfo->ptMinTrackSize.y = ScaleGui(454);
return 0;
}
case WM_CLOSE:
::EnableWindow(::GetParent(m_hWndWindowItems[WINDOW_HANDLE]), TRUE);
ServerManager::m_hWndActiveDialog = nullptr;
break;
case WM_NCDESTROY: {
HWND hWnd = m_hWndWindowItems[WINDOW_HANDLE];
delete this;
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}
case WM_SETFOCUS: {
CHARRANGE cr = { 0, 0 };
::SendMessage(m_hWndWindowItems[REDT_SCRIPT], EM_EXSETSEL, 0, (LPARAM)&cr);
::SetFocus(m_hWndWindowItems[REDT_SCRIPT]);
return 0;
}
}
return ::DefWindowProc(m_hWndWindowItems[WINDOW_HANDLE], uMsg, wParam, lParam);
}
开发者ID:HiT-Hi-FiT-Hai,项目名称:PtokaX,代码行数:79,代码来源:ScriptEditorDialog.cpp
示例20: OnUpdate
void SelectionBar::UpdateDisplay()
{
wxCommandEvent e;
e.SetInt(mLeftTime->GetFormatIndex());
OnUpdate(e);
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:6,代码来源:SelectionBar.cpp
注:本文中的OnUpdate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论