int CEditorRoot::SelectRollUpBar( int rollupBarId ) { if (GetMainFrame()) return GetMainFrame()->SelectRollUpBar( rollupBarId ); else return 0; }
CRollupCtrl* CEditorRoot::GetRollUpControl( int rollupId ) { if (!GetMainFrame()) { return NULL; } return GetMainFrame()->GetRollUpControl(rollupId); }
void CDirstatDoc::SetWorkingItem(CItem *item) { if (GetMainFrame() != NULL) { if (item != NULL) GetMainFrame()->ShowProgress(item->GetProgressRange()); else GetMainFrame()->HideProgress(); } m_workingItem= item; }
void CExtensionListControl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { if(nChar == VK_TAB) { GetMainFrame()->MoveFocus(LF_DIRECTORYLIST); } else if(nChar == VK_ESCAPE) { GetMainFrame()->MoveFocus(LF_NONE); } COwnerDrawnListControl::OnKeyDown(nChar, nRepCnt, nFlags); }
void CMyTreeListControl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { if (nChar == VK_TAB) { GetMainFrame()->MoveFocus(LF_EXTENSIONLIST); } else if (nChar == VK_ESCAPE) { GetMainFrame()->MoveFocus(LF_NONE); } CTreeListControl::OnKeyDown(nChar, nRepCnt, nFlags); }
void PropPanel::OnAddTag( wxCommandEvent &event ) { GetMainFrame()->RenderingPause(); TagDlg dlg(GetMainFrame(), -1, _T("Add New Tag")); if (dlg.ShowModal() == wxID_OK) { vtTag tag; tag.name = dlg.m_strName.mb_str(); tag.value = dlg.m_strValue.mb_str(); m_pCurrentItem->AddTag(tag); UpdateTagList(); } GetMainFrame()->RenderingResume(); }
/** * @brief Called when "Select..." button for filters is selected. */ void COpenView::OnSelectFilter() { String filterPrefix = _("[F] "); String curFilter; const BOOL bUseMask = theApp.m_pGlobalFileFilter->IsUsingMask(); GetDlgItemText(IDC_EXT_COMBO, curFilter); curFilter = string_trim_ws(curFilter); GetMainFrame()->SelectFilter(); String filterNameOrMask = theApp.m_pGlobalFileFilter->GetFilterNameOrMask(); if (theApp.m_pGlobalFileFilter->IsUsingMask()) { // If we had filter chosen and now has mask we can overwrite filter if (!bUseMask || curFilter[0] != '*') { SetDlgItemText(IDC_EXT_COMBO, filterNameOrMask); } } else { filterNameOrMask = filterPrefix + filterNameOrMask; SetDlgItemText(IDC_EXT_COMBO, filterNameOrMask); } }
/** * @brief Load line filters to the compare context. * Loads linefilters, converts them to UTF-8 and sets them for compare context. */ void CDirDoc::LoadLineFilterList() { ASSERT(m_pCtxt); BOOL bFilters = GetOptionsMgr()->GetBool(OPT_LINEFILTER_ENABLED); String filters = GetMainFrame()->m_pLineFilters->GetAsString(); if (!bFilters || filters.empty()) { delete m_pCtxt->m_pFilterList; m_pCtxt->m_pFilterList = NULL; return; } if (m_pCtxt->m_pFilterList) m_pCtxt->m_pFilterList->RemoveAllFilters(); else m_pCtxt->m_pFilterList = new FilterList(); char * regexp_str; FilterList::EncodingType type; regexp_str = UCS2UTF8_ConvertToUtf8(filters.c_str()); type = FilterList::ENC_UTF8; m_pCtxt->m_pFilterList->AddRegExp(regexp_str, type); UCS2UTF8_Dealloc(regexp_str); }
//----------------------------------------------------------------------------- void EdProjectManager::MaybeSaveCurrentProject() { #if 0 if( m_currentProject != nil ) { //if( m_currentProject->isDirty ) { QMessageBox::StandardButton ret = QMessageBox::warning( GetMainFrame(), TR("Application"), //tr("The document has been modified.\n" //"Do you want to save your changes?"), TR("Do you want to save the project?"), QMessageBox::Save | QMessageBox::Discard //| QMessageBox::Cancel ); if( QMessageBox::Save == ret ) { SaveCurrentProject(); } //else if( QMessageBox::Cancel == ret ) //{ // return false; //} //m_currentProject->isDirty = false; } } #endif }
CWnd* CInformErrorDialog::GetSafeParent() { CWnd *Parent = NULL; #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) // if the splash box is up, use that as the parent Parent = CSplashDialog::GetpWnd(); if (Parent) return Parent; #endif // WEBSTER-ranbirr-12/11/96 #ifndef WEBSTER #ifndef STANDALONE // If there is a print-related dlg up, use it as the parent Parent = CCPrintDialog::GetPrintCWnd(); if (Parent) return Parent; #endif #endif //webster // see if mainframe is up - use it if visible Parent = GetMainFrame(); if (Parent && Parent->IsWindowVisible()) return Parent; return NULL; }
void ScribbleWindow::disp(int i) { CPMainFrame *mf = GetMainFrame(); ScribbleDocument * sdoc = (ScribbleDocument *) GetDocument(); PegRect ChildRect = mf->BottomAppRectangle(); int num; if (!trai && i<180) num=page0[i]; else if (trai==1) num=page1[i]; else if (trai==2) num=page2[i]; else if (trai==3) num=page3[i]; else if (trai==4) num=page4[i]; if ((num==57 | num==89) && trai==1) { trai=4; Draw(); Redraw(); } else if (num) { CounterWindow* cwin = new CounterWindow(ChildRect,this,sdoc,mf); OnCount(); cwin->disp(num); sdoc->OnChangedData(this); } }
void GJContext::ShowMainPanel() { if(IsSignedIn()&&m_pMainFrame) GetMainFrame().Appear(); else if(!IsSignedIn()&&m_pLoginFrame) SetForegroundWindow(*m_pLoginFrame); }
// What to do when a view is created. Creates actual // windows for displaying the view. bool wxStfView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) { childFrame = wxGetApp().CreateChildFrame(doc, this); if (childFrame==NULL) { return false; } // extract file name: wxFileName fn(doc->GetFilename()); childFrame->SetTitle(fn.GetName()); graph = GetMainFrame()->CreateGraph(this, childFrame); if (graph==NULL) { return false; } childFrame->GetMgr()->AddPane( graph, wxAuiPaneInfo().Caption(wxT("Traces")).Name(wxT("Traces")).CaptionVisible(true). CloseButton(false).Centre().PaneBorder(true) ); childFrame->GetMgr()->Update(); // childFrame->ActivateGraph(); #if defined(__X__) || defined(__WXMAC__) // X seems to require a forced resize // childFrame->SetClientSize(800,600); #endif childFrame->Show(true); Activate(true); return true; }
BOOL CTHRESHDlg::OnInitDialog() { CDialog::OnInitDialog(); pCount=(CStatic*)GetDlgItem(IDC_STATIC_COUNT); pThresh=(CStatic*)GetDlgItem(IDC_STATIC_THRESH); pMax=(CStatic*)GetDlgItem(IDC_STATIC_MAX); pMin=(CStatic*)GetDlgItem(IDC_STATIC_MIN); p_Slider=(CSliderCtrl*)GetDlgItem(IDC_SLIDER); pCount->SetWindowText("Count"); pThresh->SetWindowText("Threshold"); pMax->SetWindowText("255"); pMin->SetWindowText("0"); pView = (CImageView*)GetMainFrame()->GetActiveFrame()->GetActiveView(); // TODO: Add extra initialization here p_Slider->SetRange(0, 255, TRUE ); p_Slider->SetTic( 50 ); p_Slider->SetTicFreq( 8 );//origin 1,1,1,now 8,4,4 p_Slider->SetLineSize( 1 );//for increment by arrow move p_Slider->SetPageSize( 4 );//for increment by dragging by mouse or by pageup ordown p_Slider->SetPos( m_nCur ); curMin=m_RMin; CString msg; msg.Format("%.4f",m_RMin); pMin->SetWindowText(msg); msg.Format("%.4f",m_RMax); pMax->SetWindowText(msg); msg.Format("%.4f",curMin); pThresh->SetWindowText(msg); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
// Overrides bool PowerTabView::OnCreate(wxDocument *doc, long flags) { //------Last Checked------// // - Jan 27, 2005 WXUNUSED(flags); MainFrame* mainFrame = GetMainFrame(); wxCHECK(mainFrame != NULL, false); m_frame = mainFrame->CreateChildFrame(doc, this); wxCHECK(m_frame != NULL, false); m_frame->SetTitle(wxT("PowerTabView")); m_canvas = CreateCanvas(this, m_frame); wxCHECK(m_canvas != NULL, false); #ifdef __X__ // X seems to require a forced resize int x, y; m_frame->GetSize(&x, &y); m_frame->SetSize(-1, -1, x, y); #endif m_frame->Show(true); Activate(true); return (true); }
void CDirstatApp::RestartApplication( ) { // First, try to create the suspended process auto si = zeroInitSTARTUPINFO( ); si.cb = sizeof( si ); auto pi = zeroInitPROCESS_INFORMATION( ); auto appFileName = GetAppFileName( ); BOOL success = CreateProcess( appFileName, NULL, NULL, NULL, false, CREATE_SUSPENDED, NULL, NULL, &si, &pi ); if (!success) { CString c = _T( "CreateProcess( " ); c += appFileName; c += _T( ") failed: " ); c += GetLastErrorAsFormattedMessage( ); AfxMessageBox( c ); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); return; } // We _send_ the WM_CLOSE here to ensure that all CPersistence-Settings like column widths an so on are saved before the new instance is resumed. // This will post a WM_QUIT message. GetMainFrame( )->SendMessage( WM_CLOSE ); DWORD dw = ::ResumeThread( pi.hThread ); if ( dw != 1 ) { TRACE( _T( "ResumeThread() didn't return 1\r\n" ) ); } CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); }
void CChildFrame::OnClose() { // clean up pointers. CMDIChildWnd::OnClose(); GetMainFrame()->ClearStatusbarItemCount(); }
virtual void CreateUI(const GamePtr& game, wxAuiManager& manager) { // Create all of the UI needed for network games. wxWindow* frame = GetMainFrame(); wxSize minSize = wxSize(165, 150); // Create the notebook off screen to avoid flicker. wxSize size = frame->GetClientSize(); wxAuiNotebook* notebook = new wxAuiNotebook(frame, wxID_ANY, wxPoint(size.x, size.y), minSize, wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT |wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER); // Chat window. wxChatUI* chat = new wxChatUI(notebook); notebook->AddPage(chat, stChat); // Event window. wxEventUI* event = new wxEventUI(notebook); notebook->AddPage(event, stEvents); // Spectator window. wxSpectatorUI* spectators = new wxSpectatorUI(notebook); notebook->AddPage(spectators, stSpectators); manager.AddPane(notebook, wxAuiPaneInfo().MinSize(minSize) .Caption(stNetwork).CloseButton(false) .MaximizeButton(false).Dockable(true).Right() .Name(swNetwork)); }
void CDirstatApp::RestartApplication() { // First, try to create the suspended process STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb= sizeof(si); PROCESS_INFORMATION pi; ZeroMemory(&pi, sizeof(pi)); BOOL success = CreateProcess(GetAppFileName(), NULL, NULL, NULL, false, CREATE_SUSPENDED, NULL, NULL, &si, &pi); if (!success) { CString s; s.FormatMessage(IDS_CREATEPROCESSsFAILEDs, GetAppFileName(), MdGetWinerrorText(GetLastError())); AfxMessageBox(s); return; } // We _send_ the WM_CLOSE here to ensure that all CPersistence-Settings // like column widths an so on are saved before the new instance is resumed. // This will post a WM_QUIT message. GetMainFrame()->SendMessage(WM_CLOSE); DWORD dw= ::ResumeThread(pi.hThread); if (dw != 1) TRACE(_T("ResumeThread() didn't return 1\r\n")); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); }
// Overrides bool PowerTabTuningView::OnCreate(wxDocument* doc, long flags) { //------Last Checked------// // - Dec 30, 2004 WXUNUSED(flags); MainFrame* mainFrame = GetMainFrame(); wxCHECK(mainFrame != NULL, false); m_frame = mainFrame->CreateChildFrame(doc, this); wxCHECK(m_frame != NULL, false); m_window = CreateViewWindow(); wxCHECK(m_window != NULL, false); #ifdef __X__ // X seems to require a forced resize int x, y; m_frame->GetSize(&x, &y); m_frame->SetSize(-1, -1, x, y); #endif m_frame->Show(true); Activate(true); return (true); }
// This method does some work for ticks ms. // return: true if done or suspended. // bool CDirstatDoc::Work(DWORD ticks) { if(NULL == m_rootItem) { return true; } if(GetMainFrame()->IsProgressSuspended()) { return true; } if(!m_rootItem->IsDone()) { m_rootItem->DoSomeWork(ticks); if(m_rootItem->IsDone()) { m_extensionDataValid = false; GetMainFrame()->SetProgressPos100(); GetMainFrame()->RestoreTypeView(); GetMainFrame()->RestoreGraphView(); UpdateAllViews(NULL); } else { ASSERT(m_workingItem != NULL); if(m_workingItem != NULL) // to be honest, "defensive programming" is stupid, but c'est la vie: it's safer. { GetMainFrame()->SetProgressPos(m_workingItem->GetProgressPos()); } UpdateAllViews(NULL, HINT_SOMEWORKDONE); } } if(m_rootItem->IsDone()) { SetWorkingItem(NULL); return true; } else { return false; } }
//----------------------------------------------------------------- void ScribbleWindow::OnCount() { CPMainFrame * mf = GetMainFrame(); ScribbleDocument * sdoc = (ScribbleDocument *) GetDocument(); PegRect ChildRect = mf->BottomAppRectangle(); CounterWindow* cwin = new CounterWindow(ChildRect,this,sdoc,mf); mf->SetBottomWindow(cwin); }
void CDirstatDoc::OnEditCopy() { const CItem *item= GetSelection(); ASSERT(item != NULL); ASSERT(item->GetType() == IT_DRIVE || item->GetType() == IT_DIRECTORY || item->GetType() == IT_FILE); GetMainFrame()->CopyToClipboard(item->GetPath()); }
void CFindDlg::OnOK() { if (!UpdateData()) return; UpdateSearchHistory(); GetMainFrame()->SendMessage(WM_COMMAND, ID_FIND_STRING); }
CViewport* CEditorRoot::GetActiveView() { if (!GetMainFrame()) { return NULL; } CLayoutViewPane* viewPane = (CLayoutViewPane*) GetMainFrame()->GetActiveView(); if (viewPane) { CWnd *pWnd = viewPane->GetViewport(); if (pWnd && pWnd->IsKindOf(RUNTIME_CLASS(CViewport))) { return (CViewport*)pWnd; } } return 0; }
void CItem::DriveVisualUpdateDuringWork() { MSG msg; while (PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE)) DispatchMessage(&msg); GetMainFrame()->DrivePacman(); UpwardDrivePacman(); }
wxFrame *MyApp::CreateChildFrame(wxDocument *doc, wxView *view, bool isCanvas) { //// Make a child frame wxDocChildFrame *subframe = new wxDocChildFrame(doc, view, GetMainFrame(), wxID_ANY, _T("Child Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE); #ifdef __WXMSW__ subframe->SetIcon(wxString(isCanvas ? _T("chrt_icn") : _T("notepad_icn"))); #endif //// Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(wxID_NEW, _T("&New...")); file_menu->Append(wxID_OPEN, _T("&Open...")); file_menu->Append(wxID_CLOSE, _T("&Close")); file_menu->Append(wxID_SAVE, _T("&Save")); file_menu->Append(wxID_SAVEAS, _T("Save &As...")); if (isCanvas) { file_menu->AppendSeparator(); file_menu->Append(wxID_PRINT, _T("&Print...")); file_menu->Append(wxID_PRINT_SETUP, _T("Print &Setup...")); file_menu->Append(wxID_PREVIEW, _T("Print Pre&view")); } wxMenu *edit_menu = (wxMenu *) NULL; if (isCanvas) { edit_menu = new wxMenu; edit_menu->Append(wxID_UNDO, _T("&Undo")); edit_menu->Append(wxID_REDO, _T("&Redo")); edit_menu->AppendSeparator(); edit_menu->Append(DOCVIEW_CUT, _T("&Cut last segment")); doc->GetCommandProcessor()->SetEditMenu(edit_menu); } wxMenu *help_menu = new wxMenu; help_menu->Append(DOCVIEW_ABOUT, _T("&About")); wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, _T("&File")); if (isCanvas) menu_bar->Append(edit_menu, _T("&Edit")); menu_bar->Append(help_menu, _T("&Help")); //// Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); subframe->Centre(wxBOTH); return subframe; }
virtual void HandleMainMenuClick(const wxString& key) { wxASSERT(swSettings == key); wxSettingsPane* pane = new wxSettingsPane(GetMainFrame()); Controller::get().Transmit(shEventChangeMainPane, DataObject(static_cast<PaneMixin*>(pane), stSettings)); }
static BOOL RunOilHelp(LPCTSTR lpcszHelpPath, UINT32 nCommand, DWORD dwData) { #if !defined(EXCLUDE_FROM_XARALX) // Firing up the help engine can take a while, so show an hour-glass cursor. HCURSOR hOldCursor; HCURSOR hBusyCursor = ::LoadCursor(NULL, _R(IDC_WAIT)); if (hBusyCursor != NULL) hOldCursor = ::SetCursor(hBusyCursor); // We always pass the handle of the main-frame window as the "owning" window. HWND hwndInvoker = GetMainFrame()->GetSafeHwnd(); #endif // If we are running on a pure 32-bit platform such as Windows NT then we must fake // the WinHelp() function, as we want the 16-bit engine to be run, not WINHLP32.EXE. // The current help-file build includes references to 16-bit DLLs that seem to be // almost too much for the 32-bit engine. We don't have to do this if we aren't // running the engine to browse a file, but simply issuing a command, such as // HELP_HELPONHELP. BOOL fOk; // Running under Chicago or Win32s, or the helpfile parameter is NULL, so run the // "normal" engine. Here we should really "thunk" (translate) the 32-bit HWND // to a 16-bit HWND, I think? // TRACEUSER( "JustinF", _T("Help being invoked normally\n")); fOk = TRUE; if(nCommand != HELP_QUIT) { wxString strHelpFileName(lpcszHelpPath); wxString Context = _T(""); if (dwData) { Context = PCTSTR(String_256( dwData )); if (_T("") != Context) // so that the string table contains a bit less, the ::/xarax/ and .htm // are here, because they are common to every HTML help path. strHelpFileName += _T("xarax/") + Context + _T(".htm"); } CCamApp::LaunchWebBrowser( strHelpFileName ); } #if !defined(EXCLUDE_FROM_XARALX) // Get some slightly useful information if it all goes horribly wrong. #ifdef _DEBUG if (!fOk) TRACEUSER( "Ollie", _T("RunOilHelp failed - last error: %lu\n"), (UINT32) ::GetLastError()); #endif // Undo the hour-glass cursor and return a success code. if (hBusyCursor != NULL) ::SetCursor(hOldCursor); #endif return fOk; }
ScribbleWindow::ScribbleWindow(PegRect rect, ScribbleDocument* doc, CPMainFrame * frame) :CPModuleWindow(rect,0,doc,frame) { CPMainFrame * mf = GetMainFrame(); rect.wBottom -= 1; rect.wTop += 1; m_win = new DrawWindow(rect, doc); Add(m_win); SetScrollMode(WSM_AUTOVSCROLL); }