bool QuickFindBar::DoShow(bool s, const wxString& findWhat) { bool res = wxPanel::Show(s); if(s && !m_eventsConnected) { BindEditEvents(true); } else if(m_eventsConnected) { BindEditEvents(false); } if(s && m_sci) { // Delete the indicators m_sci->SetIndicatorCurrent(1); m_sci->IndicatorClearRange(0, m_sci->GetLength()); if(EditorConfigST::Get()->GetOptions()->GetClearHighlitWordsOnFind()) { m_sci->SetIndicatorCurrent(MARKER_WORD_HIGHLIGHT); m_sci->IndicatorClearRange(0, m_sci->GetLength()); } } if(res) { GetParent()->GetSizer()->Layout(); } if(!m_sci) { // nothing to do } else if(!s) { // hiding m_sci->SetFocus(); } else if(!findWhat.IsEmpty()) { m_findWhat->ChangeValue(findWhat); m_findWhat->SelectAll(); m_findWhat->SetFocus(); PostCommandEvent(this, m_findWhat); } else { if(m_sci->GetSelections() > 1) { } wxString findWhat = DoGetSelectedText().BeforeFirst(wxT('\n')); if(!findWhat.IsEmpty()) { m_findWhat->ChangeValue(findWhat); } m_findWhat->SelectAll(); m_findWhat->SetFocus(); PostCommandEvent(this, m_findWhat); } return res; }
void QuickFindBar::OnReceivingFocus(wxFocusEvent& event) { event.Skip(); if((event.GetEventObject() == m_findWhat) || (event.GetEventObject() == m_replaceWith)) { PostCommandEvent(this, wxStaticCast(event.GetEventObject(), wxWindow)); } }
WXLRESULT MainFrame::MSWWindowProc(WXUINT msg,WXWPARAM wParam,WXLPARAM lParam) { if(msg == g_TaskbarIconMsg){ // handle shell restart PostCommandEvent(this,ID_AdjustTaskbarIconOverlay); return 0; } return wxFrame::MSWWindowProc(msg,wParam,lParam); }
//better off with a struct to pass any variables we need IN. Such as: // drive_letter. query_type. File Path. (combine/variables set above) void *QueryThread::Entry() { int result; while(!g_mainFrame->CheckForTermination(200)){ if(m_startquery){ result = udefrag_start_query(m_letter,m_qType,m_flags,m_mapSize, reinterpret_cast<udefrag_progress_callback>(ProgressCallback), reinterpret_cast<udefrag_terminator>(Terminator),m_qp,NULL ); if(result < 0 && !g_mainFrame->m_stopped){ etrace("Disk Processing Failure."); g_mainFrame->WxTextCtrl1->AppendText(L"Error executing Query."); } PostCommandEvent(g_mainFrame,ID_QueryCompletion); m_startquery = false; } } return NULL; }
void SystemTrayIcon::OnMenuExit(wxCommandEvent& WXUNUSED(event)) { PostCommandEvent(g_mainFrame,ID_Exit); }
void SystemTrayIcon::OnMenuPause(wxCommandEvent& WXUNUSED(event)) { PostCommandEvent(g_mainFrame,ID_Pause); }