X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/83ae4c616cd965afda87c4bff6509dba3b3254ab..3030ae493df7500fd5da7555f141c0c8a690bd8a:/contrib/samples/ogl/studio/mainfrm.cpp diff --git a/contrib/samples/ogl/studio/mainfrm.cpp b/contrib/samples/ogl/studio/mainfrm.cpp index 3f4ab32ae5..e5f97fc674 100644 --- a/contrib/samples/ogl/studio/mainfrm.cpp +++ b/contrib/samples/ogl/studio/mainfrm.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: mainfrm.cpp +// Name: ogl/stufio/mainfrm.cpp // Purpose: Studio main frame // Author: Julian Smart // Modified by: @@ -52,8 +52,7 @@ BEGIN_EVENT_TABLE(csFrame, wxDocMDIParentFrame) END_EVENT_TABLE() // Define my frame constructor -csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, - long style): +csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxDocMDIParentFrame(manager, parent, id, title, pos, size, style, _T("frame")) { CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL); @@ -73,19 +72,24 @@ csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wx void csFrame::OnHelp(wxCommandEvent& WXUNUSED(event)) { - wxGetApp().GetHelpController().DisplayContents(); + wxHelpControllerBase* help; + help = wxGetApp().GetHelpController(); + if (help) + help->DisplayContents(); } void csFrame::OnSettings(wxCommandEvent& WXUNUSED(event)) { +#if wxUSE_WX_RESOURCES csSettingsDialog* dialog = new csSettingsDialog(this); /* int ret = */ dialog->ShowModal(); dialog->Destroy(); +#endif // wxUSE_WX_RESOURCES } void csFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - Close(TRUE); + Close(true); } void csFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) @@ -155,24 +159,24 @@ void csFrame::OnIdle(wxIdleEvent& event) wxSashLayoutWindow* diagramToolBarWin = wxGetApp().GetDiagramToolBarSashWindow(); if (!paletteWin || !diagramToolBarWin) return; - bool doLayout = FALSE; + bool doLayout = false; if (GetActiveChild()) { if (!paletteWin->IsShown() || !diagramToolBarWin->IsShown()) { - paletteWin->Show(TRUE); - diagramToolBarWin->Show(TRUE); + paletteWin->Show(true); + diagramToolBarWin->Show(true); - doLayout = TRUE; + doLayout = true; } } else { if (paletteWin->IsShown() || diagramToolBarWin->IsShown()) { - paletteWin->Show(FALSE); - diagramToolBarWin->Show(FALSE); - doLayout = TRUE; + paletteWin->Show(false); + diagramToolBarWin->Show(false); + doLayout = true; } } if (doLayout) @@ -180,13 +184,13 @@ void csFrame::OnIdle(wxIdleEvent& event) wxLayoutAlgorithm layout; layout.LayoutMDIFrame(this); -#if defined(__WXMSW__) && defined(__WIN95__) +#if defined(__WXMSW__) // Need to do something else to get it to refresh properly // when a client frame is first displayed; moving the client // window doesn't cause the proper refresh. Just refreshing the // client doesn't work (presumably because it's clipping the // children). - // FIXED in wxWindows, by intercepting wxMDIClientWindow::DoSetSize + // FIXED in wxWidgets, by intercepting wxMDIClientWindow::DoSetSize // and checking if the position has changed, before redrawing the // child windows. #if 0 @@ -198,7 +202,7 @@ void csFrame::OnIdle(wxIdleEvent& event) } #endif -#endif +#endif // __WXMSW__ } event.Skip(); } @@ -206,7 +210,7 @@ void csFrame::OnIdle(wxIdleEvent& event) // General handler for disabling items void csFrame::OnUpdateDisable(wxUpdateUIEvent& event) { - event.Enable(FALSE); + event.Enable(false); } void csFrame::OnSaveUpdate(wxUpdateUIEvent& event) @@ -273,4 +277,3 @@ void csMDIChildFrame::OnActivate(wxActivateEvent& event) layout.LayoutMDIFrame((wxMDIParentFrame*) GetParent()); */ } -