X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03206f17a616c02f7c5349c066917809b64106ea..a6f4dbbd86b54c720bdeab1aea1fad5eb3f030e6:/contrib/samples/fl/fl_sample2.cpp diff --git a/contrib/samples/fl/fl_sample2.cpp b/contrib/samples/fl/fl_sample2.cpp index 281f49fa14..d2dae82c74 100644 --- a/contrib/samples/fl/fl_sample2.cpp +++ b/contrib/samples/fl/fl_sample2.cpp @@ -49,7 +49,7 @@ protected: wxTextCtrl* CreateTextCtrl( const wxString& value ); public: - MyFrame( wxWindow* parent, char *title ); + MyFrame( wxWindow* parent, const wxChar *title ); ~MyFrame(); void populateMyFrame(); @@ -57,7 +57,7 @@ public: void OnStore( wxCommandEvent& event ); void OnQuit( wxCommandEvent& event ); - bool OnClose(void) { return TRUE; } + bool OnClose(void) { return true; } DECLARE_EVENT_TABLE() }; @@ -68,30 +68,32 @@ IMPLEMENT_APP (MyApp) bool MyApp::OnInit(void) { - // wxWindows boiler-plate: + // wxWidgets boiler-plate: - MyFrame *frame = new MyFrame(NULL, "wxFrameLayout sample"); + MyFrame *frame = new MyFrame(NULL, _("wxFrameLayout sample")); wxMenu *file_menu = new wxMenu; - file_menu->Append( ID_LOAD, "&Load layout" ); - file_menu->Append( ID_STORE, "&Store layout" ); + file_menu->Append( ID_LOAD, _("&Load layout") ); + file_menu->Append( ID_STORE, _("&Store layout") ); file_menu->AppendSeparator(); - file_menu->Append( ID_QUIT, "E&xit" ); + file_menu->Append( ID_QUIT, _("E&xit") ); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _("&File")); +#if wxUSE_STATUSBAR frame->CreateStatusBar(3); +#endif // wxUSE_STATUSBAR frame->SetMenuBar(menu_bar); - frame->Show(TRUE); + frame->Show(true); SetTopWindow(frame); frame->populateMyFrame(); - return TRUE; + return true; } /***** Immlementation for class MyFrame *****/ @@ -102,18 +104,18 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU( ID_QUIT, MyFrame::OnQuit ) END_EVENT_TABLE() -MyFrame::MyFrame( wxWindow* parent, char *title ) - : wxFrame( parent, -1, "NewTest-II", wxDefaultPosition, +MyFrame::MyFrame( wxWindow* parent, const wxChar *title ) + : wxFrame( parent, wxID_ANY, title, wxDefaultPosition, wxSize( 700, 500 ), wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION, - "freimas" ) + wxT("freimas") ) { } void MyFrame::populateMyFrame() { - mpClientWnd = CreateTextCtrl( "Client window" ); + mpClientWnd = CreateTextCtrl( _("Client window") ); mpLayout = new wxFrameLayout( this, mpClientWnd ); @@ -124,7 +126,7 @@ void MyFrame::populateMyFrame() cbDimInfo sizes( 80,65, // when docked horizontally 80,165, // when docked vertically 180,30, // when floated - TRUE, // the bar is fixed-size + true, // the bar is fixed-size 5, // vertical gap (bar border) 5 // horizontal gap (bar border) ); @@ -135,16 +137,16 @@ void MyFrame::populateMyFrame() wxSleep(1); wxYield(); // CHECK! - char buf[4]; - sprintf( buf, "%d", i ); - wxString name = wxString("Bar-"); + wxChar buf[4]; + wxSprintf( buf, wxT("%d"), i ); + wxString name = wxString(wxT("Bar-")); name += buf; //sizes.mIsFixed = i % 2 > 0; // every fifth bar is not fixed-size - if ( !sizes.mIsFixed ) name += " (flexible)"; + if ( !sizes.mIsFixed ) name += wxT(" (flexible)"); // mpLayout->AddBar( CreateTextCtrl(name),// bar window - mpLayout->AddBar( new wxTextCtrl(this, -1, name),// bar window + mpLayout->AddBar( new wxTextCtrl(this, wxID_ANY, name),// bar window sizes, i % MAX_PANES,// alignment ( 0-top,1-bottom, etc) 0, // insert into 0th row (vert. position) 0, // offset from the start of row (in pixels) @@ -167,7 +169,7 @@ MyFrame::~MyFrame() wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value ) { - wxTextCtrl* pCtrl = new wxTextCtrl( this, -1, value, + wxTextCtrl* pCtrl = new wxTextCtrl( this, wxID_ANY, value, wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE ); pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) ); @@ -175,20 +177,20 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value ) return pCtrl; } -void MyFrame::OnLoad( wxCommandEvent& event ) +void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) ) { - wxMessageBox("Hey - you found a BIG question-mark !!"); + wxMessageBox(wxT("Hey - you found a BIG question-mark !!")); } -void MyFrame::OnStore( wxCommandEvent& event ) +void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) ) { - wxMessageBox("Hey - you found another BIG question-mark !!"); + wxMessageBox(wxT("Hey - you found another BIG question-mark !!")); } -void MyFrame::OnQuit( wxCommandEvent& event ) +void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) ) { - Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction + Show( false ); // TRICK:: hide it, to avoid flickered destruction - Close(TRUE); + Close(true); }