/*! * This function is called when the user clicks "Clear". It deletes all the * done, canceled or error jobs. */ void GamessQFrame::OnClearClick( wxCommandEvent& event ) { GreyButtons(); mQueueManager.Clear(); RefreshList(); RefreshButtons(); }
/*! * This function is called whenever the user clicks "Add". It calls NewJob(). */ void GamessQFrame::OnADDClick( wxCommandEvent& event ) { GreyButtons(); NewJob(); RefreshList(); RefreshButtons(); }
void LocationDlg::OnStoreAs( wxCommandEvent &event ) { int num = m_pSaver->NumLocations(); wxString str; str.Printf(_("Location %d"), num+1); wxTextEntryDialog dlg(NULL, _("Type a name for the new location:"), _("Location Name"), str); if (dlg.ShowModal() != wxID_OK) return; str = dlg.GetValue(); #if SUPPORT_WSTRING bool success = m_pSaver->StoreTo(num, str.wc_str()); #else bool success = m_pSaver->StoreTo(num, (const char *) str.ToUTF8()); #endif if (success) { RefreshList(); m_pLocList->SetSelection(num); RefreshButtons(); } else BlockingMessageBox(_("Couldn't store point, probably a coordinate system transformation problem.")); }
void LWRouteMain::RefreshData(int childnum) { if (childnum == -2) { RefreshList(); RefreshButtons(); } }
void GamessQFrame::OnJoblistctrlEndLabelEdit( wxListEvent& event ) { Job *job = mJobList.Item(event.GetIndex())->GetData(); if (mQueueManager.SetName(job->GetId(), event.GetLabel())) { job->SetName(event.GetLabel()); } RefreshButtons(); }
void LocationDlg::OnRemove( wxCommandEvent &event ) { int num = m_pLocList->GetSelection(); if (num >= 0 && num < m_pSaver->NumLocations()) m_pSaver->Remove(num); RefreshList(); RefreshButtons(); }
/*! * This function is called when the refresh timer goes off (at a * user-determined interval). It calls RefreshList(). */ void GamessQFrame::OnTimer( wxTimerEvent& event ) { if (mConnected) { GreyButtons(); RefreshList(); RefreshButtons(); } }
void LWRouteMain::OnClickedRbuttoninsert() { WayPointDialog::ClickedOnInsert(); RefreshList(); RefreshButtons(); RefreshWpDialog(); }
void LWRouteMain::OnClickedRbuttondelete() { WayPointDialog::ClickedOnDelete(); RefreshList(); RefreshButtons(); RefreshWpDialog(); }
void LWRouteMain::OnClickedRbuttonapplyalt() { if (Todays_Packages.pack[Todays_Packages.hipack].packagestatus!=Profile::PS_SPARE) { Profile& pack = Todays_Packages.pack[Todays_Packages.hipack]; UniqueID wpuid = pack.route; //DeadCode JIM 20Oct00 int i=1; info_waypoint* cwp=*Persons2::ConvertPtrUID(Todays_Packages.hiwp); int worldY=cwp->World.Y; if (cwp->uid==-SGR_WPP_BombRendezvous || cwp->uid==-SGR_WPP_BombDisperse) worldY+=worldY; Todays_Packages[Todays_Packages.hipack].SetTargetGlobrefs(); //CSB 27Jun00 Todays_Packages[Todays_Packages.hipack].RecalcPrimaryPositions(); //CSB 27Jun00 while (wpuid) { info_waypoint* wp=*Persons2::ConvertPtrUID(wpuid); if (wp->applygroup.Evaluate()==ENABLE_COMPLEX_VAL) //Not TO or land //JIM 28Jun00 { if (wp->uid==-SGR_WPP_BombRendezvous || wp->uid==-SGR_WPP_BombDisperse) wp->World.Y = worldY/2; else wp->World.Y = worldY; Coords3D pos=wp->World; if (wp->target.Evaluate()!=ENABLE_COMPLEX_VAL) pos-=Persons2::ConvertPtrUID(UniqueID(wp->target.Evaluate())); wp->position.RecalcDeltasToMatch(pos); //CSB 27Jun00 } wpuid = wp->nextwp; } if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW) { Directives::LW::MissTypes misstype = LWDirectivesResults::LWMissType(); MMC.directives.lw.userprofiles[misstype].mainalt = cwp->World.Y; }else { Directives::RAF::MissTypes misstype = RAFDirectivesResults::RAFMissType(Todays_Packages.hipack); MMC.directives.raf.userprofiles[misstype].mainalt = cwp->World.Y; } } while (!Todays_Packages[Todays_Packages.hipack].CalcWPTimes()) Todays_Packages[Todays_Packages.hipack].primarytargetETA+=10; RefreshList(); RefreshButtons(); }
void GamessQFrame::OnRemoveClick( wxCommandEvent& event ) { GreyButtons(); int index = jobListCtrl->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); while (index != -1) { Job *job = mJobList.Item(index)->GetData(); mQueueManager.Remove(job->GetId()); index = jobListCtrl->GetNextItem(index, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); } RefreshList(); RefreshButtons(); }
void LWRouteMain::OnSelectRlistboxctrl1(long row, long column) { //DEADCODE 23/02/00 if (Todays_Packages.pack[Todays_Packages.hipack].packagestatus!=Profile::PS_SPARE) //DEADCODE 23/02/00 { //DEADCODE 23/02/00 Profile& pack = Todays_Packages.pack[Todays_Packages.hipack]; //DEADCODE 23/02/00 //DEADCODE 23/02/00 UniqueID wpuid = pack.route; //DEADCODE 23/02/00 int i = 1; //DEADCODE 23/02/00 while ( (wpuid) && (i != row)) //DEADCODE 23/02/00 { //DEADCODE 23/02/00 info_waypoint* wp=*Persons2::ConvertPtrUID(wpuid); //DEADCODE 23/02/00 wpuid = wp->nextwp; //DEADCODE 23/02/00 i++; //DEADCODE 23/02/00 } //DEADCODE 23/02/00 RDialog::m_pView->SetHiLightInfo(Todays_Packages.hipack, 0,wpuid); //DEADCODE 23/02/00 //DEADCODE 23/02/00 RefreshButtons(); //DEADCODE 23/02/00 RefreshWpDialog(); //DEADCODE 23/02/00 m_pView->m_mapdlg.Invalidate(); //DEADCODE 23/02/00 //DEADCODE 23/02/00 //DEADCODE 23/02/00 //DEADCODE 23/02/00 //DEADCODE 23/02/00 } int index = row -1; if ( (row > 0) && (row <= maxentry) ) { RDialog::m_pView->SetHiLightInfo(Todays_Packages.hipack, 0,WpList[index]); RefreshList(); RefreshButtons(); RefreshWpDialog(); m_pView->m_mapdlg.Invalidate(); } }
void LocationDlg::OnLoad( wxCommandEvent &event ) { wxFileDialog loadFile(NULL, _("Load Locations"), _T(""), _T(""), FSTRING_LOC, wxFD_OPEN); bool bResult = (loadFile.ShowModal() == wxID_OK); if (!bResult) return; wxString path = loadFile.GetPath(); vtString upath = (const char *) path.mb_str(wxConvUTF8); if (m_pSaver->Read(upath)) { RefreshList(); RefreshButtons(); } }
void LWRouteMain::OnClickedRbuttonnewdogleg() { Profile& pk = Todays_Packages.pack[Todays_Packages.hipack]; TargetGroup* targp=Node_Data[pk.packagetarget[0].currentid]; int i = 0; while ( (pk.doglegloc != targp->doglegs[i]) && (i < 3) ) i++; i++; if (i >= 3 || targp->doglegs[i] == UID_Null) i = 0; if (targp->doglegs[i] != UID_Null) { pk.doglegloc = targp->doglegs[i]; //DeadCode JIM 20Oct00 UniqueID wpuid = pk.route; //DeadCode JIM 7Aug00 while ( (wpuid) //DeadCode JIM 7Aug00 && (Profile::WPType(wpuid) == IDS_WP_DOGLEG) //DeadCode JIM 7Aug00 ) //DeadCode JIM 7Aug00 { //DeadCode JIM 7Aug00 info_waypoint* wp=*Persons2::ConvertPtrUID(wpuid); //DeadCode JIM 7Aug00 wpuid = wp->nextwp; //DeadCode JIM 7Aug00 } //DeadCode JIM 7Aug00 //DeadCode JIM 7Aug00 if (wpuid) { //DeadCode JIM 7Aug00 info_waypoint* hwp=*Persons2::ConvertPtrUID(wpuid); //DeadCode JIM 7Aug00 hwp->target = targp->doglegs[i]; RefreshWpDialog(); Todays_Packages[Todays_Packages.hipack].RecalcRoutePositionsAndTime(); m_pView->m_mapdlg.Invalidate(); RefreshList(); RefreshButtons(); } } }
LocationDlg::LocationDlg( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style ) : LocationDlgBase( parent, id, title, position, size, style ) { m_bActive = true; m_bLoop = true; m_bContinuous = false; m_bSmooth = true; m_bPosOnly = false; m_iAnim = -1; m_iPos = 0; m_fSpeed = 1.0f; m_bSetting = false; m_fRecordSpacing = 1.0f; m_bRecordLinear = true; m_bRecordInterval = false; m_pSaver = NULL; m_pAnimPaths = NULL; m_pLocList = GetLoclist(); // Work around wxFormDesigner's lack of support for limiting to smallest size GetSizer()->SetSizeHints(this); AddValidator(this, ID_ACTIVE, &m_bActive); AddValidator(this, ID_LOOP, &m_bLoop); AddValidator(this, ID_CONTINUOUS, &m_bContinuous); AddValidator(this, ID_SMOOTH, &m_bSmooth); AddValidator(this, ID_POS_ONLY, &m_bPosOnly); AddNumValidator(this, ID_SPEED, &m_fSpeed, 2); AddValidator(this, ID_SPEEDSLIDER, &m_iSpeed); AddNumValidator(this, ID_RECORD_SPACING, &m_fRecordSpacing); AddValidator(this, ID_ANIM_POS, &m_iPos); AddValidator(this, ID_RECORD_LINEAR, &m_bRecordLinear); AddValidator(this, ID_RECORD_INTERVAL, &m_bRecordInterval); RefreshButtons(); UpdateEnabling(); }
BOOL LWRouteMain::OnInitDialog() { CDialog::OnInitDialog(); //DEADCODE RDH 07/01/00 currwp = UID_NULL; //DEADCODE RDH 04/01/00 CRListBox* rlistbox; //DEADCODE RDH 04/01/00 rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1); //DEADCODE RDH 04/01/00 rlistbox->Clear(); //DEADCODE RDH 04/01/00 rlistbox->AddColumn(80); //DEADCODE RDH 04/01/00 rlistbox->AddColumn(TARGETFIELDWIDTH); //RDH 02/06/99 //DEADCODE RDH 04/01/00 rlistbox->AddColumn(70); //RDH 02/06/99 //DEADCODE RDH 04/01/00 rlistbox->AddColumn(60); //RDH 02/06/99 //DEADCODE RDH 04/01/00 rlistbox->AddColumn(60); //DEADCODE RDH 04/01/00 rlistbox->AddColumn(60); //DEADCODE RDH 04/01/00 rlistbox->AddColumn(60); //DEADCODE RDH 04/01/00 rlistbox->AddString("",0); //DEADCODE RDH 04/01/00 rlistbox->AddString(RESSTRING(LOCATION),1); //DEADCODE RDH 04/01/00 rlistbox->AddString(RESSTRING(ALT),2); //DEADCODE RDH 04/01/00 rlistbox->AddString(RESSTRING(ETA),3); //DEADCODE RDH 04/01/00 rlistbox->AddString(RESSTRING(RELTOT),4); //DEADCODE RDH 04/01/00 rlistbox->AddString(RESSTRING(STRIKEFUEL),5); //DEADCODE RDH 04/01/00 rlistbox->AddString(RESSTRING(ESCORTFUEL),6); //DEADCODE ROD 17/12/99 rlistbox->AddString("Strike",0); //DEADCODE ROD 17/12/99 rlistbox->AddString("Wissen",1); //DEADCODE ROD 17/12/99 rlistbox->AddString("20,000ft",2); //DEADCODE ROD 17/12/99 rlistbox->AddString("14:00",3); //DEADCODE ROD 17/12/99 rlistbox->AddString("-01:20",4); //DEADCODE ROD 17/12/99 rlistbox->AddString("3000",5); //DEADCODE ROD 17/12/99 rlistbox->AddString("3000",6); //DEADCODE ROD 17/12/99 RefreshList(); RefreshButtons(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void LWRouteMain::OnSelectTab() { RefreshList(); RefreshButtons(); }
void GamessQFrame::CreateControls() { ////@begin GamessQFrame content construction GamessQFrame* itemFrame1 = this; wxMenuBar* menuBar = new wxMenuBar; AppMenu = new wxMenu; AppMenu->Append(wxID_PREFERENCES, _("&Preferences"), _("Change the way GamessQ behaves"), wxITEM_NORMAL); AppMenu->Append(ID_PAUSEALL, _("&Pause All"), _("Pause Everything"), wxITEM_CHECK); AppMenu->AppendSeparator(); AppMenu->Append(wxID_EXIT, _("E&xit"), _("Exit GamessQ"), wxITEM_NORMAL); menuBar->Append(AppMenu, _("&Queue")); jobsMenu = new wxMenu; { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, wxID_ADD, _("&Add Jobs\tCtrl+A"), _("Add new GAMESS jobs to the end of the queue"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/add-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, wxID_REMOVE, _("Remove Jobs"), _("Remove the selected GAMESS jobs from the queue"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/remove-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } jobsMenu->AppendSeparator(); { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, wxID_CANCEL, _("&Cancel Jobs"), _("Cancel the selected GAMESS jobs"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/cancel-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_PAUSE, _("&Pause Jobs\tCtrl+P"), _("Pause the selected GAMESS jobs"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/pause-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_RESUME, _("&Resume Jobs\tCtrl+R"), _("Resume the selected paused GAMESS jobs"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/resume-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } jobsMenu->AppendSeparator(); { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_SAVEFOLDER, _("Save Output to Folder\tCtrl+S"), _("Save GAMESS output for selected jobs to a folder"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("menu/wxSave"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_SAVEAS, _("Save Output As..."), _("Save GAMESS output for this job"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("menu/wxSaveAs"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } jobsMenu->Append(ID_MACMOLPLT, _("Open in wxMacMolPlt\tCtrl+O"), _T(""), wxITEM_NORMAL); jobsMenu->Append(ID_VIEWLOGS, _("View &Logs"), _("View the GAMESS log files for the selected jobs"), wxITEM_NORMAL); jobsMenu->AppendSeparator(); { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_REFRESH, _("Refresh\tAlt-R"), _("Refresh the display of the queue status"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/refresh-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } jobsMenu->AppendSeparator(); { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, wxID_CLEAR, _("Clean Up"), _("Clear all finished GAMESS jobs from the queue"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/clear-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } menuBar->Append(jobsMenu, _("&Jobs")); //Yes this is a complete copy of the menu that was just added to the Menubar. At least in //wx 3.0 wx throws an assertion saying that a popupmenu is not supposed to be attached to //another menu or menubar. So after attaching the previous copy recreate it. The copy //attached to the menu is now "owned" by the Menu/window. jobsMenu = new wxMenu; { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, wxID_ADD, _("&Add Jobs\tCtrl+A"), _("Add new GAMESS jobs to the end of the queue"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/add-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, wxID_REMOVE, _("Remove Jobs"), _("Remove the selected GAMESS jobs from the queue"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/remove-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } jobsMenu->AppendSeparator(); { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, wxID_CANCEL, _("&Cancel Jobs"), _("Cancel the selected GAMESS jobs"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/cancel-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_PAUSE, _("&Pause Jobs\tCtrl+P"), _("Pause the selected GAMESS jobs"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/pause-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_RESUME, _("&Resume Jobs\tCtrl+R"), _("Resume the selected paused GAMESS jobs"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/resume-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } jobsMenu->AppendSeparator(); { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_SAVEFOLDER, _("Save Output to Folder\tCtrl+S"), _("Save GAMESS output for selected jobs to a folder"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("menu/wxSave"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_SAVEAS, _("Save Output As..."), _("Save GAMESS output for this job"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("menu/wxSaveAs"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } jobsMenu->Append(ID_MACMOLPLT, _("Open in wxMacMolPlt\tCtrl+O"), _T(""), wxITEM_NORMAL); jobsMenu->Append(ID_VIEWLOGS, _("View &Logs"), _("View the GAMESS log files for the selected jobs"), wxITEM_NORMAL); jobsMenu->AppendSeparator(); { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, ID_REFRESH, _("Refresh\tAlt-R"), _("Refresh the display of the queue status"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/refresh-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } jobsMenu->AppendSeparator(); { wxMenuItem* menuItem = new wxMenuItem(jobsMenu, wxID_CLEAR, _("Clean Up"), _("Clear all finished GAMESS jobs from the queue"), wxITEM_NORMAL); wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("icons/clear-16.png"))); menuItem->SetBitmap(bitmap); jobsMenu->Append(menuItem); } wxMenu* itemMenu24 = new wxMenu; itemMenu24->Append(wxID_ABOUT, _("&About"), _T(""), wxITEM_NORMAL); menuBar->Append(itemMenu24, _("&Help")); itemFrame1->SetMenuBar(menuBar); jobsToolbar = CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT|wxTB_NODIVIDER, ID_TOOLBAR1 ); jobsToolbar->SetToolBitmapSize(wxSize(24, 24)); wxBitmap itemtool27Bitmap(itemFrame1->GetBitmapResource(wxT("icons/add-24.png"))); wxBitmap itemtool27BitmapDisabled; jobsToolbar->AddTool(wxID_ADD, _("Add"), itemtool27Bitmap, itemtool27BitmapDisabled, wxITEM_NORMAL, _T(""), _("Add a new GAMESS jobs to the end of the queue")); wxBitmap itemtool28Bitmap(itemFrame1->GetBitmapResource(wxT("icons/remove-24.png"))); wxBitmap itemtool28BitmapDisabled; jobsToolbar->AddTool(wxID_REMOVE, _("Remove"), itemtool28Bitmap, itemtool28BitmapDisabled, wxITEM_NORMAL, _T(""), _("Remove the selected GAMESS jobs from the queue")); jobsToolbar->AddSeparator(); wxBitmap itemtool30Bitmap(itemFrame1->GetBitmapResource(wxT("icons/cancel-24.png"))); wxBitmap itemtool30BitmapDisabled; jobsToolbar->AddTool(wxID_CANCEL, _("Cancel"), itemtool30Bitmap, itemtool30BitmapDisabled, wxITEM_NORMAL, _T(""), _("Cancel the selected GAMESS jobs")); wxBitmap itemtool31Bitmap(itemFrame1->GetBitmapResource(wxT("icons/pause-24.png"))); wxBitmap itemtool31BitmapDisabled; jobsToolbar->AddTool(ID_PAUSE, _("Pause"), itemtool31Bitmap, itemtool31BitmapDisabled, wxITEM_NORMAL, _T(""), _("Pause the selected GAMESS jobs")); wxBitmap itemtool32Bitmap(itemFrame1->GetBitmapResource(wxT("icons/resume-24.png"))); wxBitmap itemtool32BitmapDisabled; jobsToolbar->AddTool(ID_RESUME, _("Resume"), itemtool32Bitmap, itemtool32BitmapDisabled, wxITEM_NORMAL, _T(""), _("Resume the selected paused GAMESS jobs")); jobsToolbar->AddSeparator(); wxBitmap itemtool34Bitmap(itemFrame1->GetBitmapResource(wxT("icons/refresh-24.png"))); wxBitmap itemtool34BitmapDisabled; jobsToolbar->AddTool(ID_REFRESH, _("Refresh"), itemtool34Bitmap, itemtool34BitmapDisabled, wxITEM_NORMAL, _T(""), _("Refresh the display of the queue status")); jobsToolbar->AddSeparator(); wxBitmap itemtool36Bitmap(itemFrame1->GetBitmapResource(wxT("icons/clear-24.png"))); wxBitmap itemtool36BitmapDisabled; jobsToolbar->AddTool(wxID_CLEAR, _("Clean Up"), itemtool36Bitmap, itemtool36BitmapDisabled, wxITEM_NORMAL, _T(""), _("Clear all finished GAMESS jobs from the queue")); jobsToolbar->Realize(); itemFrame1->SetToolBar(jobsToolbar); wxBoxSizer* itemBoxSizer37 = new wxBoxSizer(wxVERTICAL); itemFrame1->SetSizer(itemBoxSizer37); jobListCtrl = new wxListCtrl( itemFrame1, ID_JOBLISTCTRL, wxDefaultPosition, wxSize(590, 300), wxLC_REPORT|wxLC_EDIT_LABELS|wxLC_HRULES|wxLC_VRULES|wxSUNKEN_BORDER ); itemBoxSizer37->Add(jobListCtrl, 1, wxGROW|wxALL, 0); wxStatusBar* itemStatusBar39 = new wxStatusBar( itemFrame1, ID_STATUSBAR1, wxNO_BORDER ); itemStatusBar39->SetFieldsCount(1); itemFrame1->SetStatusBar(itemStatusBar39); ////@end GamessQFrame content construction // create the dialog objects mConfigDialog = new ConfigurationDialog(this); mJobOptionsDialog = new JobOptionsDialog(this); // initiate the queue manager, if this fails, we're toast if (! mQueueManager.Init()) { wxLogFatalError(wxT("Failed to start the backend!")); } mActive = mQueueManager.IsActive(); AppMenu->Check(ID_PAUSEALL, ! mActive); // load settings mConfig = new wxConfig(WX_CONFIG_APPNAME); wxString stringFreq; long freq; if (mConfig->Read(wxT("Refresh Frequency"), &freq)) { mRefreshFrequency = freq; } else { mConfigDialog->SetRefreshFrequency(mRefreshFrequency / 1000); mConfigDialog->SetGamessPath(mQueueManager.GetGamessDir()); mConfigDialog->SetSpoolDir(mQueueManager.GetSpoolDir()); mConfigDialog->Show(); } // start the timer mRefreshTimer = new wxTimer(this, ID_TIMER); mRefreshTimer->Start(mRefreshFrequency, wxTIMER_ONE_SHOT); // set up the queue list jobListCtrl->InsertColumn(0, wxT("Name")); jobListCtrl->InsertColumn(1, wxT("Processors")); jobListCtrl->InsertColumn(2, wxT("Status")); jobListCtrl->SetColumnWidth(0, 400); jobListCtrl->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER); jobListCtrl->SetColumnWidth(2, 80); RefreshList(); RefreshButtons(); SetDropTarget(new DropTarget(this)); }
/*! * Creates the search bar and keeps it hidden */ void PasswordSafeSearch::CreateSearchBar() { wxASSERT(m_toolbar == 0); wxPanel *panel = new wxPanel(m_parentFrame, wxID_ANY); wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL); panel->SetSizer(panelSizer); m_toolbar = new wxToolBar(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxTB_BOTTOM | wxTB_HORIZONTAL, wxT("SearchBar")); panelSizer->Add(m_toolbar, wxSizerFlags().Proportion(1).Expand()); m_toolbar->AddTool(ID_FIND_CLOSE, wxT(""), wxBitmap(findclose_xpm), wxNullBitmap, wxITEM_NORMAL, _("Close SearchBar")); wxSize srchCtrlSize(m_parentFrame->GetSize().GetWidth()/5, wxDefaultSize.GetHeight()); wxSearchCtrl* srchCtrl = new wxSearchCtrl(m_toolbar, ID_FIND_EDITBOX, wxEmptyString, wxDefaultPosition, srchCtrlSize, wxTE_PROCESS_ENTER); srchCtrl->ShowCancelButton(true); srchCtrl->ShowSearchButton(true); m_toolbar->AddControl(srchCtrl); m_toolbar->AddTool(ID_FIND_NEXT, wxT(""), wxBitmap(find_xpm), wxBitmap(find_disabled_xpm), wxITEM_NORMAL, _("Find Next")); m_toolbar->AddCheckTool(ID_FIND_IGNORE_CASE, wxT(""), wxBitmap(findcase_i_xpm), wxBitmap(findcase_s_xpm), _("Case Insensitive Search")); m_toolbar->AddTool(ID_FIND_ADVANCED_OPTIONS, wxT(""), wxBitmap(findadvanced_xpm), wxNullBitmap, wxITEM_CHECK, _("Advanced Find Options")); m_toolbar->AddTool(ID_FIND_CREATE_REPORT, wxT(""), wxBitmap(findreport_xpm), wxNullBitmap, wxITEM_NORMAL, _("Create report of previous Find search")); m_toolbar->AddTool(ID_FIND_CLEAR, wxT(""), wxBitmap(findclear_xpm), wxNullBitmap, wxITEM_NORMAL, _("Clear Find")); m_toolbar->AddControl(new wxStaticText(m_toolbar, ID_FIND_STATUS_AREA, wxEmptyString, wxDefaultPosition, srchCtrlSize.Scale(3,1), wxTE_READONLY)); RefreshButtons(); if (!m_toolbar->Realize()) wxMessageBox(_("Could not create Search Bar"), _("Lumimaja")); wxSizer* origSizer = m_parentFrame->GetSizer(); wxASSERT(origSizer); if (!origSizer) return; wxASSERT(origSizer->IsKindOf(wxBoxSizer(wxVERTICAL).GetClassInfo())); wxASSERT(((wxBoxSizer*)origSizer)->GetOrientation() == wxVERTICAL); origSizer->Add(panel, 0, wxEXPAND); origSizer->Layout(); if (!m_toolbar->Show(true) && !m_toolbar->IsShownOnScreen()) wxMessageBox(_("Could not display searchbar")); //This gross hack is the only way I could think of to get ESC keystrokes from the text ctrl user is typing into if (wxDynamicCast(static_cast<wxControl*>(srchCtrl), wxTextCtrl)) { //searchCtrl is a wxTextCtrl derivative, like on Mac OS X 10.3+ wxDynamicCast(static_cast<wxControl*>(srchCtrl), wxTextCtrl)->Connect(wxEVT_CHAR, wxCharEventHandler(PasswordSafeSearch::OnSearchBarTextChar), NULL, this); } else { //The wxTextCtrl is buried inside the wxSearchCtrl wxWindowList& srchChildren = srchCtrl->GetChildren(); for( wxWindowList::const_iterator itr = srchChildren.begin(); itr != srchChildren.end(); ++itr) { wxTextCtrl* txtCtrl = wxDynamicCast(*itr, wxTextCtrl); if (txtCtrl) { txtCtrl->Connect(wxEVT_CHAR, wxCharEventHandler(PasswordSafeSearch::OnSearchBarTextChar), NULL, this); break; } } } srchCtrl->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(PasswordSafeSearch::OnSearchTextChanged), NULL, this); srchCtrl->Connect(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, wxCommandEventHandler(PasswordSafeSearch::OnDoSearch), NULL, this); srchCtrl->Connect(wxEVT_COMMAND_TEXT_ENTER, wxTextEventHandler(PasswordSafeSearch::OnDoSearch), NULL, this); m_toolbar->Connect(ID_FIND_CLOSE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(PasswordSafeSearch::OnSearchClose), NULL, this); m_toolbar->Connect(ID_FIND_ADVANCED_OPTIONS, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(PasswordSafeSearch::OnAdvancedSearchOptions), NULL, this); m_toolbar->Connect(ID_FIND_NEXT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(PasswordSafeSearch::OnDoSearch), NULL, this); m_toolbar->Connect(ID_FIND_CLEAR, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(PasswordSafeSearch::OnSearchClear), NULL, this); }
void LocationDlg::SetLocSaver(vtLocationSaver *saver) { m_pSaver = saver; RefreshList(); RefreshButtons(); }
void LWDiaryDetails::Refresh() { CRRadio* pradio; pradio=GETDLGITEM(IDC_RRADIODISPLAY); if (quickmission) pradio->ShowWindow(false); else pradio->ShowWindow(true); pradio->AddButton(RESSTRING(VIEWSINGLE)); pradio->AddButton(RESSTRING(ALL)); pradio->SetCurrentSelection(0); CRListBox* rlistbox; rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1); rlistbox->Clear(); rlistbox->AddColumn(60); rlistbox->AddColumn(80); //RDH 02/06/99 rlistbox->AddColumn(60); //RDH 02/06/99 rlistbox=GETDLGITEM(IDC_RLISTBOXOTHERS); rlistbox->Clear(); rlistbox->AddColumn(60); rlistbox->AddColumn(60); //RDH 02/06/99 rlistbox->AddString(RESSTRING(GRUPPE),0); rlistbox->AddString(RESSTRING(TASK),1); CRStatic* s; if ( (*currentptr >= 0) && (grdtlsptr[*currentptr]) ) { Diary::RaidGroup* raidgroup; Diary::Gruppen* grentry; raidgroup = Squad_Diary.GetRaidGroup(grdtlsptr[*currentptr]); Diary::Gruppen* othergr = Squad_Diary.GetFirstSquadron(raidgroup); rlistbox=GETDLGITEM(IDC_RLISTBOXOTHERS); while (othergr) { if (othergr != grdtlsptr[*currentptr] && othergr->noaclaunched) { Squadron* sq = &Node_Data[(SquadNum)othergr->squadnum]; CString name = sq->ShortName() + "/"; name = name + sq->SubName(); rlistbox->AddString(name,0); raidgroup = Squad_Diary.GetRaidGroup(othergr); int cnt = (int) raidgroup->misstype; rlistbox->AddString(RESLIST(MT_RAID, cnt),1); } othergr = Squad_Diary.GetNextSquadron(othergr); } //DeadCode RJS 4Sep00 raidgroup = Squad_Diary.GetRaidGroup(grdtlsptr[*currentptr]); raidgroup = Squad_Diary.GetRaidGroup(grdtlsptr[*currentptr]); if (raidgroup) { int theTime = 0; //RJS 4Sep00 //raid s=GETDLGITEM(IDC_RSTATICDIARYDATE); Diary::RaidPack* raidpack = Squad_Diary.GetRaidPack(raidgroup); if (raidpack) { s->SetString(GetDateName(raidpack->date * SECSPERDAY, DATE_LONG)); int strikeac = 0, attachedac = 0, detachedac = 0,myrole=0; TotalUpAc( strikeac, attachedac, detachedac ,myrole); s=GETDLGITEM(IDC_RSTATICMAIN); myrole&=Profile::AM_GROUPMASK; if (myrole==Profile::AM_LWPACKS) s->SetString(CSprintf("%i/%i",grdtlsptr[*currentptr]->noaclaunched,strikeac)); else s->SetString(CSprintf("%i",strikeac)); s=GETDLGITEM(IDC_RSTATICDETACHED); if (myrole==Profile::AM_DETACHED) s->SetString(CSprintf("%i/%i",grdtlsptr[*currentptr]->noaclaunched,detachedac)); else s->SetString(CSprintf("%i",detachedac)); s=GETDLGITEM(IDC_RSTATICATTACHED); if (myrole>=Profile::AM_ATTACHED) s->SetString(CSprintf("%i/%i",grdtlsptr[*currentptr]->noaclaunched,attachedac)); else s->SetString(CSprintf("%i",attachedac)); EncounteredAcType seenac[3]={{PT_BADMAX}}; int hurrseen = 0, spitseen = 0, hurrkilled = 0, spitkilled = 0; TotalEncounteredAc(seenac); CRListBox* rlistbox; rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1); rlistbox->AddString(RESSTRING(TYPE),0); rlistbox->AddString(RESSTRING(ENCOUNTERED),1); rlistbox->AddString(RESSTRING(CLAIMS),2); //DeadCode JIM 23Oct00 if (seenac[2].totalkilled) //DeadCode JIM 23Oct00 if (seenac[0].encountered==0) //DeadCode JIM 23Oct00 seenac[2].localkilled = seenac[0].localkilled; //DeadCode JIM 23Oct00 else //DeadCode JIM 23Oct00 if (seenac[1].encountered==0) //DeadCode JIM 23Oct00 seenac[2].localkilled = seenac[1].localkilled; for (int i=0;i<3;i++) if (seenac[i].encountered) { if (seenac[i].localkilled>seenac[i].totalkilled) seenac[i].localkilled=seenac[i].totalkilled; rlistbox->AddString(RESLIST(SPIT_A,seenac[i].type),0); rlistbox->AddString(CSprintf("%i",seenac[i].encountered),1); rlistbox->AddString(CSprintf("%i/%i",seenac[i].localkilled,seenac[i].totalkilled),2); } rlistbox->AddString(RESSTRING(TOTAL),0); rlistbox->AddString(CSprintf("%i", seenac[0].encountered+seenac[1].encountered+seenac[2].encountered),1); rlistbox->AddString(CSprintf("%i/%i", seenac[0].localkilled+seenac[1].localkilled+seenac[2].localkilled, seenac[0].totalkilled+seenac[1].totalkilled+seenac[2].totalkilled ),2); theTime = raidpack->takeofftime; //RJS 4Sep00 } else { s->SetString(""); s=GETDLGITEM(IDC_RSTATICMAIN); s->SetString(""); s=GETDLGITEM(IDC_RSTATICDETACHED); s->SetString(""); s=GETDLGITEM(IDC_RSTATICATTACHED); s->SetString(""); } s=GETDLGITEM(IDC_RSTATICPERSONNEL); s->SetString(""); s=GETDLGITEM(IDC_RSTATICTARGET); if(!raidgroup->target) { s->SetString(""); s=GETDLGITEM(IDC_RSTATICRESULT); s->SetString(""); } else { s->SetString(GetTargName(raidgroup->target)); s=GETDLGITEM(IDC_RSTATICRESULT); //DeadCode JIM 20Oct00 TargetNoDetail* trg = Node_Data[raidgroup->target]; CString missString; //RJS 9Nov00 Squad_Diary.GetMissResult(grdtlsptr[*currentptr],raidgroup,missString); s->SetString(missString); //RJS 9Nov00 //DeadCode RJS 09Nov00 s->SetString(RESLIST(MR_NULL,raidgroup->missresult)); //DeadCode JIM 13Oct00 int j = trg->PlayerStatus(); //DeadCode JIM 13Oct00 if ( (j == Target::TS_FLAG_UNKNOWN)) //DeadCode JIM 13Oct00 s->SetString(RESSTRING(TT_UNKNOWN)); //DeadCode JIM 13Oct00 else //DeadCode JIM 13Oct00 { //DeadCode JIM 13Oct00 if (j >= Target::TS_NEARLYDESTROYED) j = 3; //DeadCode JIM 13Oct00 elseif (j>Target::TS_BADDAMAGE) j=2; //DeadCode JIM 13Oct00 elseif (j>Target::TS_LIGHTDAMAGE) j=1; //DeadCode JIM 13Oct00 else j=0; //DeadCode JIM 13Oct00 s->SetString(RESLIST(UNDAMAGED, j)); //DeadCode JIM 13Oct00 } } s=GETDLGITEM(IDC_RSTATICTASK); s->SetString(RESLIST(MT_RAID, raidgroup->misstype)); s=GETDLGITEM(IDC_RSTATICTIME); if (raidgroup->targettime) //RJS 4Sep00 theTime = raidgroup->targettime; //RJS 4Sep00 //RJS 4Sep00 theTime/=60; //RJS 4Sep00 s->SetString(CSprintf("%02i:%02i",theTime/60,theTime%60)); //RJS 4Sep00 s=GETDLGITEM(IDC_RSTATICAIRCRAFT); Squadron* sq = Node_Data[*grnumptr]; s->SetString(RESLIST(SPIT_A, sq->AcType())); } s=GETDLGITEM(IDC_RSTATICDAMAGED); s->SetString(CSprintf("%i",grdtlsptr[*currentptr]->numacdamaged)); s=GETDLGITEM(IDC_RSTATICDESTROYED); s->SetString(CSprintf("%i",grdtlsptr[*currentptr]->numlosses)); s=GETDLGITEM(IDC_RSTATICAIRCREW); s->SetString(CSprintf("%i",grdtlsptr[*currentptr]->numpilotslost)); }else { s=GETDLGITEM(IDC_RSTATICDIARYDATE); s->SetString(""); s=GETDLGITEM(IDC_RSTATICTASK); s->SetString(""); s=GETDLGITEM(IDC_RSTATICTIME); s->SetString(""); s=GETDLGITEM(IDC_RSTATICAIRCRAFT); s->SetString(""); s=GETDLGITEM(IDC_RSTATICRESULT); s->SetString(""); s=GETDLGITEM(IDC_RSTATICTARGET); s->SetString(""); s=GETDLGITEM(IDC_RSTATICMAIN); s->SetString(""); s=GETDLGITEM(IDC_RSTATICDETACHED); s->SetString(""); s=GETDLGITEM(IDC_RSTATICATTACHED); s->SetString(""); s=GETDLGITEM(IDC_RSTATICPERSONNEL); s->SetString(""); s=GETDLGITEM(IDC_RSTATICDAMAGED); s->SetString(""); s=GETDLGITEM(IDC_RSTATICDESTROYED); s->SetString(""); s=GETDLGITEM(IDC_RSTATICAIRCREW); s->SetString(""); } RefreshButtons(); }
void LocationDlg::OnLocList( wxCommandEvent &event ) { RefreshButtons(); }
PWSDragBar::PWSDragBar(PasswordSafeFrame* frame) : CDragBar(frame, this), m_frame(frame) { RefreshButtons(); }
void GamessQFrame::OnJoblistctrlDeselected( wxListEvent& event ) { RefreshButtons(); }