X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bd9396d52dc2118f2f527ecea55271e79a893ed4..de90d3e08462ab3b2e586a80b21eeaca0166d071:/utils/framelayout/samples/test/fl_test.cpp?ds=sidebyside diff --git a/utils/framelayout/samples/test/fl_test.cpp b/utils/framelayout/samples/test/fl_test.cpp index d1fb4e22a7..2ef179f116 100644 --- a/utils/framelayout/samples/test/fl_test.cpp +++ b/utils/framelayout/samples/test/fl_test.cpp @@ -48,7 +48,9 @@ // comment it out if it breaks, (this is my workaround for MSDev 4.0 linker) +#ifndef wxDUMMY_OBJ_INCLUDED char wxDummyChar; +#endif IMPLEMENT_APP (MyApp) @@ -61,8 +63,6 @@ bool MyApp::OnInit(void) wxMenu *file_menu = new wxMenu; - file_menu->Append( NEW_TEST_LOAD, "&Load layouts" ); - file_menu->Append( NEW_TEST_SAVE, "&Store layouts" ); file_menu->Append( NEW_TEST_EXIT, "E&xit" ); wxMenuBar *menu_bar = new wxMenuBar; @@ -98,52 +98,10 @@ BEGIN_EVENT_TABLE( MyFrame, wxFrame ) // EVT_CHAR_HOOK(MyFrame::OnKeyDown) // EVT_PAINT( MyFrame::OnPaint ) - EVT_MENU( NEW_TEST_SAVE, MyFrame::OnSave ) - EVT_MENU( NEW_TEST_LOAD, MyFrame::OnLoad ) EVT_MENU( NEW_TEST_EXIT, MyFrame::OnExit ) END_EVENT_TABLE() -void MyFrame::OnLoad( wxCommandEvent& event ) -{ - mpLayout->HideBarWindows(); - mpLayout->DestroyBarWindows(); - delete mpLayout; - - if ( mpClientWnd ) - { - mpClientWnd->Destroy(); - mpClientWnd = NULL; - } - - mpLayout = NULL; - - wxIOStreamWrapper& stm = *(new wxIOStreamWrapper()); - - stm.CreateForInput( "layouts1.dat" ); - - mStore.SetDataStream( stm ); - - mStore.XchgObjPtr( (wxObject**) &mpLayout ); - - mStore.Finalize(); // finish serialization - - mpLayout->Activate(); -} - -void MyFrame::OnSave( wxCommandEvent& event ) -{ - wxIOStreamWrapper& stm = *(new wxIOStreamWrapper()); - - stm.CreateForOutput( "layouts1.dat" ); - - mStore.SetDataStream( stm ); - - mStore.XchgObjPtr( (wxObject**) &mpLayout ); - - mStore.Finalize(); // finish serialization -} - void MyFrame::OnExit( wxCommandEvent& event ) { Destroy(); @@ -169,18 +127,9 @@ MyFrame::MyFrame(wxFrame *frame) wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION, "freimas" ) { -#ifdef __WXMSW__ mpInternalFrm = (wxPanel*)this; -#else - mpInternalFrm = new wxPanel( this, -1 ); -#endif - - mpClientWnd = CreateTextCtrl( "Client window" ); - mStore.AddInitialRef( this ); - mStore.AddInitialRef( mpInternalFrm ); - //mStore.AddInitialRef( mpClientWnd ); mpLayout = new wxFrameLayout( mpInternalFrm, mpClientWnd ); @@ -255,38 +204,7 @@ MyFrame::MyFrame(wxFrame *frame) TRUE ); - mpLayout->AddBar( CreateTextCtrl("Fixed0"), // bar window - sizes1, wxTOP, // alignment ( 0-top,1-bottom, etc) - 0, // insert into 0th row (vert. position) - 0, // offset from the start of row (in pixels) - "ToolBar1", // name to refere in customization pop-ups - TRUE - ); - - wxDynamicToolBar* pToolBar = new wxDynamicToolBar(); - - pToolBar->Create( mpInternalFrm, -1 ); - - // 1001-1006 ids of command events fired by added tool-buttons - - pToolBar->AddTool( 1001, "new.bmp" ); - pToolBar->AddTool( 1002, "open.bmp" ); - pToolBar->AddTool( 1003, "save.bmp" ); - - pToolBar->AddTool( 1004, "cut.bmp" ); - pToolBar->AddTool( 1005, "copy.bmp" ); - pToolBar->AddTool( 1006, "paste.bmp" ); - - - mpLayout->AddBar( pToolBar, // bar window (can be NULL) - sizes2, wxTOP, // alignment ( 0-top,1-bottom, etc) - 0, // insert into 0th row (vert. position) - 0, // offset from the start of row (in pixels) - "ToolBar2", // name to refere in customization pop-ups - FALSE - ); - - mpLayout->EnableFloating( TRUE ); // off, thinking bout wxGtk... + mpLayout->EnableFloating( FALSE ); // off, thinking bout wxGtk... } MyFrame::~MyFrame()