void MainFrame::OnThreadAddImage(wxCommandEvent& event) { int frame = event.GetInt(); long framenumber = event.GetExtraLong(); g_LogMessage(wxString::Format(_T("Add some images from %d to %d"), frame-framenumber+1, frame)); for(int i = 0; i < (int)framenumber; i++) { int tmp = frame-framenumber+i+1; if(m_pImageList->GetImageCount() > tmp) { wxMemoryFSHandler::AddFile(wxString::Format(_T("Frame Number %d.bmp"), tmp), m_pImageList->GetBitmap(tmp),wxBITMAP_TYPE_BMP); wxString label = wxString::Format(_T("<span> </span><p align=\"center\"><img src=\"memory:Frame Number %d.bmp\"><br></p><span text-align=center>Frame Number: %d </span><br>"), tmp, tmp); m_pThumbnalList->SetString(tmp, label); wxString filename = wxString::Format(_T("Frame Number %d.bmp"), tmp); m_StrMemFileName.Add(filename); } } m_pThumbnalList->Freeze(); unsigned int cnt = m_pThumbnalList->GetFirstVisibleLine(); m_pThumbnalList->ScrollToLine(cnt); m_pThumbnalList->Thaw(); m_pThumbnalList->RefreshAll(); if(frame == framenumber-1) { event.SetInt(0); OnThumbnailLboxSelect(event); m_pThumbnalList->SetSelection(0); m_pThumbnalList->SetFocus(); } g_LogMessage(wxString::Format(_T("LEAVE Adding some images from %d to %d"), frame-framenumber+1, frame)); }
void PHPWorkspaceView::OnIsProgramRunning(wxCommandEvent& e) { if(PHPWorkspace::Get()->IsOpen()) { e.SetInt(PHPWorkspace::Get()->IsProjectRunning() ? 1 : 0); } else { // Must call skip ! e.Skip(); } }
// -------------------------------------------------------------------------------- // void guTreeViewFilterEditor::OnDownFilterBtnClick( wxCommandEvent& event ) { wxString OldItemStr = m_FiltersListBox->GetString( m_CurrentItem ); int OldItemVal = m_FilterItems[ m_CurrentItem ]; m_FiltersListBox->SetString( m_CurrentItem, m_FiltersListBox->GetString( m_CurrentItem + 1 ) ); m_FilterItems[ m_CurrentItem ] = m_FilterItems[ m_CurrentItem + 1 ]; m_CurrentItem++; m_FiltersListBox->SetString( m_CurrentItem, OldItemStr ); m_FilterItems[ m_CurrentItem ] = OldItemVal; m_FiltersListBox->SetSelection( m_CurrentItem ); event.SetInt( m_CurrentItem ); OnFilterListBoxSelected( event ); }
void QuickFindBar::OnQuickFindCommandEvent(wxCommandEvent& event) { if(event.GetInt() > 0) { // We need to delay further, or focus might be set too soon event.SetInt(event.GetInt() - 1); wxPostEvent(this, event); } if(event.GetEventObject() == m_findWhat) { m_findWhat->SetFocus(); m_findWhat->SelectAll(); } else if(event.GetEventObject() == m_replaceWith) { m_replaceWith->SetFocus(); m_replaceWith->SelectAll(); } }
/** * @brief Manages translation changes. */ void MainFrame::OnLocaleChange(wxCommandEvent& event) { App::SetLocale(event.GetId() - ID_LocaleChange); // update menu labels and tool bar tool-tips // main menu m_menuBar->SetMenuLabel(0, _("&Action")); m_menuBar->SetMenuLabel(1, _("&Settings")); m_menuBar->SetMenuLabel(2, _("&Help")); // action menu UD_UpdateMenuItemLabel(ID_Analyze , "&Analyze" , "F5"); UD_UpdateMenuItemLabel(ID_Defrag , "&Defragment" , "F6"); UD_UpdateMenuItemLabel(ID_QuickOpt , "&Quick optimization" , "F7"); UD_UpdateMenuItemLabel(ID_FullOpt , "&Full optimization" , "Ctrl+F7"); UD_UpdateMenuItemLabel(ID_MftOpt , "&Optimize MFT" , "Shift+F7"); UD_UpdateMenuItemLabel(ID_Pause , "Pa&use" , "Space"); UD_UpdateMenuItemLabel(ID_Stop , "&Stop" , "Ctrl+C"); UD_UpdateMenuItemLabel(ID_ShowReport , "&Show report" , "F8"); UD_UpdateMenuItemLabel(ID_Repeat , "Re&peat action" , "Shift+R"); UD_UpdateMenuItemLabel(ID_SkipRem , "Skip removable &media" , "Ctrl+M"); UD_UpdateMenuItemLabel(ID_Rescan , "&Rescan drives" , "Ctrl+D"); UD_UpdateMenuItemLabel(ID_Repair , "Repair dri&ves" , ""); UD_UpdateMenuItemLabel(ID_Exit , "E&xit" , "Alt+F4"); // when done sub-menu m_subMenuWhenDone->SetItemLabel(_("&When done")); UD_UpdateMenuItemLabel(ID_WhenDoneNone , "&None" , ""); UD_UpdateMenuItemLabel(ID_WhenDoneExit , "E&xit" , ""); UD_UpdateMenuItemLabel(ID_WhenDoneStandby , "Stan&dby" , ""); UD_UpdateMenuItemLabel(ID_WhenDoneHibernate , "&Hibernate" , ""); UD_UpdateMenuItemLabel(ID_WhenDoneLogoff , "&Logoff" , ""); UD_UpdateMenuItemLabel(ID_WhenDoneReboot , "&Reboot" , ""); UD_UpdateMenuItemLabel(ID_WhenDoneShutdown , "&Shutdown" , ""); // settings menu m_subMenuLanguage->SetItemLabel(_("&Language")); UD_UpdateMenuItemLabel(ID_GuiOptions , "&Options" , "F10"); m_subMenuSortingConfig->SetItemLabel(_("&Sorting")); m_subMenuBootConfig->SetItemLabel(_("&Boot time scan")); // language sub-menu UD_UpdateMenuItemLabel(ID_LangTranslateOnline , "Translate &online" , ""); UD_UpdateMenuItemLabel(ID_LangTranslateOffline , "Translate o&ffline" , ""); UD_UpdateMenuItemLabel(ID_LangOpenFolder , "&Translations folder" , ""); // boot time scan sub-menu UD_UpdateMenuItemLabel(ID_BootEnable , "&Enable" , "F11"); UD_UpdateMenuItemLabel(ID_BootScript , "&Script" , "F12"); // sorting sub-menu UD_UpdateMenuItemLabel(ID_SortByPath , "By &path" , ""); UD_UpdateMenuItemLabel(ID_SortBySize , "By &size" , ""); UD_UpdateMenuItemLabel(ID_SortByCreationDate , "By &creation time" , ""); UD_UpdateMenuItemLabel(ID_SortByModificationDate , "By last &modification time" , ""); UD_UpdateMenuItemLabel(ID_SortByLastAccessDate , "By &last access time" , ""); UD_UpdateMenuItemLabel(ID_SortAscending , "In &ascending order" , ""); UD_UpdateMenuItemLabel(ID_SortDescending , "In &descending order" , ""); // help menu UD_UpdateMenuItemLabel(ID_HelpContents , "&Contents" , "F1"); UD_UpdateMenuItemLabel(ID_HelpBestPractice , "Best &practice" , "F2"); UD_UpdateMenuItemLabel(ID_HelpFaq , "&Frequently asked questions" , "F3"); UD_UpdateMenuItemLabel(ID_HelpLegend , "Cluster map &legend" , ""); // upgrade sub-menu m_subMenuUpgrade->SetItemLabel(_("&Upgrade")); UD_UpdateMenuItemLabel(ID_HelpUpgradeNone , "&Never check" , ""); UD_UpdateMenuItemLabel(ID_HelpUpgradeStable , "Check &stable releases only" , ""); UD_UpdateMenuItemLabel(ID_HelpUpgradeAll , "Check &all releases" , ""); UD_UpdateMenuItemLabel(ID_HelpUpgradeCheck , "&Check now" , ""); UD_UpdateMenuItemLabel(ID_HelpAbout , "&About" , "F4"); // debug sub-menu m_subMenuDebug->SetItemLabel(_("&Debug")); UD_UpdateMenuItemLabel(ID_DebugLog , "Open &log" , "Alt+L"); UD_UpdateMenuItemLabel(ID_DebugSend , "Send bug &report" , ""); // update tool-tips that differ from menu labels wxString label = _("&Boot time scan"); label << wxT(" (F11)"); m_toolBar->SetToolShortHelp(ID_BootEnable,label); label = _("Boot time script"); label << wxT(" (F12)"); m_toolBar->SetToolShortHelp(ID_BootScript,label); label = _("&Help"); label << wxT(" (F1)"); m_toolBar->SetToolShortHelp(ID_HelpContents,label); // update list column labels wxListItem item; item.SetMask(wxLIST_MASK_TEXT); item.SetText(_("Drive")); m_vList->SetColumn(0,item); item.SetText(_("Status")); m_vList->SetColumn(1,item); item.SetText(_("Fragmentation")); m_vList->SetColumn(2,item); item.SetText(_("Total space")); m_vList->SetColumn(3,item); item.SetText(_("Free space")); m_vList->SetColumn(4,item); //xgettext:no-c-format item.SetText(_("% free")); m_vList->SetColumn(5,item); // set mono-space font for the list unless Burmese translation is selected if(g_locale->GetCanonicalName().Left(2) != wxT("my")){ wxFont font = m_vList->GetFont(); if(font.SetFaceName(wxT("Courier New"))) m_vList->SetFont(font); } else { m_vList->SetFont(*m_vListFont); } // update list status fields for(int i = 0; i < m_vList->GetItemCount(); i++){ int letter = (int)m_vList->GetItemText(i)[0]; wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED,ID_UpdateVolumeStatus); event.SetInt(letter); ProcessEvent(event); } // update task-bar icon overlay ProcessCommandEvent(ID_AdjustTaskbarIconOverlay); // update progress counters ProcessCommandEvent(ID_UpdateStatusBar); // update report translation App::SaveReportTranslation(); }
void wxVListBox::InitEvent(wxCommandEvent& event, int n) { event.SetEventObject(this); event.SetInt(n); }