本文整理汇总了C++中wxTimerEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxTimerEvent类的具体用法?C++ wxTimerEvent怎么用?C++ wxTimerEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxTimerEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTimer
void CUpdateWizard::OnTimer(wxTimerEvent& event)
{
if (event.GetId() == m_statusTimer.GetId())
{
bool changed;
CTransferStatus status;
if (!m_pEngine)
m_statusTimer.Stop();
else if (!m_pEngine->GetTransferStatus(status, changed))
SetTransferStatus(0);
else if (changed)
SetTransferStatus(&status);
else
m_statusTimer.Stop();
}
else if (event.GetId() == m_autoCheckTimer.GetId())
{
if (m_autoUpdateCheckRunning)
return;
if (CanAutoCheckForUpdateNow())
{
m_autoUpdateCheckRunning = true;
const wxDateTime& now = wxDateTime::Now();
COptions::Get()->SetOption(OPTION_UPDATECHECK_LASTDATE, now.Format(_T("%Y-%m-%d %H:%M:%S")));
StartUpdateCheck();
}
}
else if (event.GetId() == m_busy_timer.GetId())
DisplayUpdateAvailability(true);
}
示例2: OnTimer
void CLed::OnTimer(wxTimerEvent& event)
{
if (event.GetId() != TIMER_ID)
{
event.Skip();
return;
}
if (!m_timer.IsRunning())
return;
if (!m_pState->m_pEngine)
{
m_timer.Stop();
return;
}
if (!m_pState->m_pEngine->IsActive(m_index == 0))
{
Unset();
m_timer.Stop();
}
return;
}
示例3: OnTimer
void CCManager::OnTimer(wxTimerEvent& event)
{
if (event.GetId() == idCallTipTimer) // m_CallTipTimer
{
CodeBlocksEvent evt(cbEVT_SHOW_CALL_TIP);
evt.SetInt(FROM_TIMER);
Manager::Get()->ProcessEvent(evt);
}
else if (event.GetId() == idAutoLaunchTimer) // m_AutoLaunchTimer
{
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (ed && ed->GetControl()->GetCurrentPos() == m_AutocompPosition)
{
CodeBlocksEvent evt(cbEVT_COMPLETE_CODE);
evt.SetInt(FROM_TIMER);
Manager::Get()->ProcessEvent(evt);
}
m_AutocompPosition = wxSCI_INVALID_POSITION;
}
else if (event.GetId() == idAutocompSelectTimer) // m_AutocompSelectTimer
{
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (ed)
{
cbStyledTextCtrl* stc = ed->GetControl();
if (stc->AutoCompActive())
{
m_LastAutocompIndex = stc->AutoCompGetCurrent();
DoShowDocumentation(ed);
}
}
}
else // ?!
event.Skip();
}
示例4: OnTimer
void CQueueViewBase::OnTimer(wxTimerEvent& event)
{
if (event.GetId() != m_filecount_delay_timer.GetId())
{
event.Skip();
return;
}
if (m_fileCountChanged || m_folderScanCountChanged)
DisplayNumberQueuedFiles();
}
示例5: OnTimer
//
// Watch for shift key changes
//
void ToolManager::OnTimer( wxTimerEvent & event )
{
// Go ahead and set the event to propagate
event.Skip();
// Can't do anything if we're not dragging. This also prevents
// us from intercepting events that don't belong to us from the
// parent since we're Connect()ed to a couple.
if( !mDragWindow )
{
return;
}
bool state = wxGetKeyState( WXK_SHIFT );
if( mLastState != state )
{
mLastState = state;
#if defined(__WXMAC__)
// Disable window animation
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, 1 );
#endif
mIndicator->Show( !state );
#if defined(__WXMAC__)
// Disable window animation
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, mTransition );
#endif
}
return;
}
示例6: OnTimer
// Various timers
void dlgMain::OnTimer(wxTimerEvent& event)
{
// Don't wipe the server list if a refresh is already running
if(GetThread() && GetThread()->IsRunning())
return;
// Don't update the list if the client is still running
if(ClientIsRunning())
return;
// What timer generated this event and what actions to perform
switch(event.GetId())
{
case TIMER_ID_NEWLIST:
{
DoGetList(true);
}
break;
case TIMER_ID_REFRESH:
{
DoRefreshList(true);
}
break;
}
}
示例7: OnPollingTimer
void CSafeCombinationChange::OnPollingTimer(wxTimerEvent &evt)
{
if (evt.GetId() == CYubiMixin::POLLING_TIMER_ID) {
m_yubiMixin1.HandlePollingTimer();
m_yubiMixin2.HandlePollingTimer();
}
}
示例8: OnTimer
void OpenResourceDlg::OnTimer(wxTimerEvent& event)
{
event.Skip();
wxString currentFilter = m_textCtrlFilter->GetValue();
if(currentFilter != m_lastFilter) {
m_lastFilter = currentFilter;
m_dvListCtrl->DeleteAllItems();
if(m_lastFilter.IsEmpty()) {
m_timer->Start(500, true);
return;
}
ResourceVector_t filesVec;
ResourceVector_t allVec;
// Refresh the list
filesVec = DoGetFiles(m_lastFilter);
DoGetResources(m_lastFilter);
allVec.insert(allVec.end(), filesVec.begin(), filesVec.end());
allVec.insert(allVec.end(), m_resources.begin(), m_resources.end());
DoPopulateListCtrl(allVec);
}
m_timer->Start(500, true);
}
示例9: OnIdleTimer
void PwsafeApp::OnIdleTimer(wxTimerEvent &evt)
{
if (evt.GetId() == IDLE_TIMER_ID && PWSprefs::GetInstance()->GetPref(PWSprefs::LockDBOnIdleTimeout)) {
if (m_frame != NULL && !m_frame->GetCurrentSafe().IsEmpty()) {
m_frame->HideUI(true); //true => lock
}
}
}
示例10: OnTimer
void CmdRecorder::OnTimer(wxTimerEvent& event) {
if( event.GetId() == ME_CmdTimer ) {
if( ScriptOp.isPlaying(wxGetApp().getScript(), NULL) )
m_Timer->Start( 1000, wxTIMER_ONE_SHOT );
else
m_labStatus->SetLabel( wxT("") );
}
}
示例11: OnTimer
void wxToolBar::OnTimer ( wxTimerEvent& rEvent )
{
if (rEvent.GetId() == m_vToolTimer.GetId())
{
wxPoint vPos( m_vXMouse, m_vYMouse );
m_pToolTip->DisplayToolTipWindow(vPos);
m_vToolTimer.Stop();
m_vToolExpTimer.Start(4000L, TRUE);
}
else if (rEvent.GetId() == m_vToolExpTimer.GetId())
{
m_pToolTip->HideToolTipWindow();
GetParent()->Refresh();
m_vToolExpTimer.Stop();
}
} // end of wxToolBar::OnTimer
示例12: OnTimer
void TimedDialogEnder::OnTimer (wxTimerEvent& event)
{
wxLogTrace (_T("TimedDialogEnder"), _T("OnTimer"));
if (event.GetId () == m_timerId) {
// Hm, apparently the main thread is calling this event handling
// function (this is standard?), even though the message box is
// blocking the application??? Thus, ::wxMutexGuiEnter() and
// ::wxMutexGuiLeave() functions must not be used in favour of:
#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXPM__)
::wxMutexGuiLeaveOrEnter ();
#endif
// Try using portable (standard wxWidgets) code - does not work even
// when using wxMessageDialog and it's SetName() method which seems to
// be the compared window identifier instead of the window caption?
/*
wxWindow* parent = NULL;
wxWindow* dlgWdw = wxWindow::FindWindowByName (m_windowCaption, parent);
if (dlgWdw) {
wxDialog *dlg = wxDynamicCast (dlgWdw, wxDialog);
if (dlg) {
dlg->EndModal (m_returnCode);
::wxLogTrace (_T("TimedDialogEnder"), _T("Window killed"));
this->DestroyTimer ();
}
}*/
// So we currently have to use M$ specific code :-(((
#ifndef WIN32
wxFAIL_MSG (_T("Only supported under M$ Windows"));
#else
HWND wdw = FindWindow (NULL, m_windowCaption);
if (wdw) {
// Killing the message box using brute force is detected
// because of an irregular return code of the message box:
//if (DestroyWindow (wdw)) {
// Interestingly the message box can be killed "softly" or as
// not irregular detected:
if (EndDialog (wdw, m_returnCode)) {
wxLogTrace (_T("TimedDialogEnder"), _T("Window killed"));
this->DestroyTimer ();
m_success = true;
}
}
#endif
#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXPM__)
::wxMutexGuiLeaveOrEnter ();
#endif
}
}
示例13: OnDeviceTimer
void SDRDevicesDialog::OnDeviceTimer( wxTimerEvent& event ) {
if (refresh) {
if (wxGetApp().areDevicesEnumerating() || !wxGetApp().areDevicesReady()) {
std::string msg = wxGetApp().getNotification();
devStatusBar->SetStatusText(msg);
devTree->DeleteAllItems();
devTree->AddRoot(msg);
event.Skip();
return;
}
devTree->DeleteAllItems();
wxTreeItemId devRoot = devTree->AddRoot("Devices");
wxTreeItemId localBranch = devTree->AppendItem(devRoot, "Local");
wxTreeItemId dsBranch = devTree->AppendItem(devRoot, "Local Net");
wxTreeItemId remoteBranch = devTree->AppendItem(devRoot, "Remote");
devs[""] = SDREnumerator::enumerate_devices("",true);
if (devs[""] != NULL) {
for (devs_i = devs[""]->begin(); devs_i != devs[""]->end(); devs_i++) {
if ((*devs_i)->isRemote()) {
devItems[devTree->AppendItem(dsBranch, (*devs_i)->getName())] = (*devs_i);
} else {
devItems[devTree->AppendItem(localBranch, (*devs_i)->getName())] = (*devs_i);
}
}
}
std::vector<std::string> remotes = SDREnumerator::getRemotes();
std::vector<std::string>::iterator remotes_i;
std::vector<SDRDeviceInfo *>::iterator remoteDevs_i;
if (remotes.size()) {
for (remotes_i = remotes.begin(); remotes_i != remotes.end(); remotes_i++) {
devs[*remotes_i] = SDREnumerator::enumerate_devices(*remotes_i, true);
wxTreeItemId remoteNode = devTree->AppendItem(remoteBranch, *remotes_i);
if (devs[*remotes_i] != NULL) {
for (remoteDevs_i = devs[*remotes_i]->begin(); remoteDevs_i != devs[*remotes_i]->end(); remoteDevs_i++) {
devItems[devTree->AppendItem(remoteNode, (*remoteDevs_i)->getName())] = (*remoteDevs_i);
}
}
}
}
m_addRemoteButton->Enable();
m_useSelectedButton->Enable();
devTree->Enable();
devTree->ExpandAll();
devStatusBar->SetStatusText("Ready.");
refresh = false;
}
}
示例14: OnTimer
//-----------------------------------------------------------------------------
void LogOutputHandlerDlg::OnTimer( wxTimerEvent& e )
//-----------------------------------------------------------------------------
{
switch( e.GetId() )
{
case teUpdate:
UpdateMissingConfigsList();
break;
}
}
示例15: OnTimerPulseM
void ScoreBot::OnTimerPulseM(wxTimerEvent &evt)
{
if (m_alert)
{
evt.SetId(m_alert_id);
m_alert->ProcessEvent(evt);
}
OnTimerPulse(evt);
}