X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62a1177692935b06dc6382c22cb65620b5cf6888..e396018defb4bb0c5726c5cd533c22f15755845b:/samples/richedit/wxLayout.cpp diff --git a/samples/richedit/wxLayout.cpp b/samples/richedit/wxLayout.cpp index 5ed2b19b31..cdb8016177 100644 --- a/samples/richedit/wxLayout.cpp +++ b/samples/richedit/wxLayout.cpp @@ -7,10 +7,6 @@ * */ -#ifdef __GNUG__ -#pragma implementation "wxLayout.h" -#endif - #include "wx/wxprec.h" #ifdef __BORLANDC__ # pragma hdrstop @@ -66,8 +62,8 @@ BEGIN_EVENT_TABLE(MyFrame,wxFrame) EVT_MENU(ID_PREVIEW_PS, MyFrame::OnPrintPreviewPS) EVT_MENU(ID_PRINT_SETUP_PS, MyFrame::OnPrintSetupPS) EVT_MENU(ID_PAGE_SETUP_PS, MyFrame::OnPageSetupPS) - EVT_MENU (-1, MyFrame::OnCommand) - EVT_COMMAND (-1,-1, MyFrame::OnCommand) + EVT_MENU (wxID_ANY, MyFrame::OnCommand) + EVT_COMMAND (wxID_ANY,wxID_ANY, MyFrame::OnCommand) EVT_CHAR ( wxLayoutWindow::OnChar ) END_EVENT_TABLE() @@ -76,9 +72,10 @@ MyFrame::MyFrame() : wxFrame( (wxFrame *) NULL, wxID_ANY, _T("wxLayout"), wxDefaultPosition, wxDefaultSize ) { +#if wxUSE_STATUSBAR CreateStatusBar( 2 ); - - SetStatusText( _T("wxLayout by Karsten Ballüder.") ); + SetStatusText( _T("wxLayout by Karsten Ballueder.") ); +#endif // wxUSE_STATUSBAR wxMenuBar *menu_bar = new wxMenuBar(); @@ -128,7 +125,9 @@ MyFrame::MyFrame() : SetMenuBar( menu_bar ); m_lwin = new wxLayoutWindow(this); +#if wxUSE_STATUSBAR m_lwin->SetStatusBar(GetStatusBar(), 0, 1); +#endif // wxUSE_STATUSBAR m_lwin->SetMouseTracking(true); m_lwin->SetEditable(true); m_lwin->SetWrapMargin(40); @@ -180,14 +179,7 @@ void MyFrame::AddSampleText(wxLayoutList *llist) llist->LineBreak(); llist->Insert(_T("Hello ")); - wxBitmap *icon = -#if wxICON_IS_BITMAP - new wxIcon(Micon_xpm) -#else - new wxBitmap (wxIcon(Micon_xpm)) -#endif - - ; + wxBitmap *icon = new wxBitmap (wxIcon(Micon_xpm)); llist->Insert(new wxLayoutObjectIcon(icon)); llist->SetFontWeight(wxBOLD); @@ -434,7 +426,7 @@ void MyFrame::OnCommand( wxCommandEvent &event ) // VZ: this doesn't work, of course, but I think it should - // wxLayoutWindow should have a flag m_highlightUrls and do it itself // (instead of doing it manually like M does now) - m_lwin->GetLayoutList()->Insert(_T("http://www.wxwindows.org/")); + m_lwin->GetLayoutList()->Insert(_T("http://www.wxwidgets.org/")); m_lwin->Refresh(); } }; @@ -523,7 +515,7 @@ void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event)) #else wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT); #endif - wxPageSetupData data; + wxPageSetupDialogData data; #if defined(__WXMSW__) || defined(__WXMAC__) wxPageSetupDialog pageSetupDialog(this, & data); @@ -532,7 +524,7 @@ void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event)) #endif pageSetupDialog.ShowModal(); - data = pageSetupDialog.GetPageSetupData(); + data = pageSetupDialog.GetPageSetupDialogData(); } void MyFrame::OnPrintSetupPS(wxCommandEvent& WXUNUSED(event)) @@ -577,7 +569,7 @@ bool MyApp::OnInit() wxFrame *frame = new MyFrame(); wxInitAllImageHandlers(); frame->Show( true ); -// wxSetAFMPath("/usr/local/src/wxWindows/misc/afm/"); +// wxSetAFMPath("/usr/local/src/wxWidgets/misc/afm/"); return true; };