X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bd9396d52dc2118f2f527ecea55271e79a893ed4..ff1865910312d960737474a75a77737d5ce94864:/utils/framelayout/samples/sample/fl_sample.cpp diff --git a/utils/framelayout/samples/sample/fl_sample.cpp b/utils/framelayout/samples/sample/fl_sample.cpp index 06458f05e7..147d7f0d03 100644 --- a/utils/framelayout/samples/sample/fl_sample.cpp +++ b/utils/framelayout/samples/sample/fl_sample.cpp @@ -26,7 +26,6 @@ #endif #include "controlbar.h" -#include "objstore.h" // plugins used #include "barhintspl.h" @@ -35,7 +34,9 @@ #include "wx/textctrl.h" // ADDED by alex (linker complaints...): +#ifndef wxDUMMY_OBJ_INCLUDED char wxDummyChar=0; +#endif #define ID_LOAD 102 #define ID_STORE 103 @@ -56,7 +57,6 @@ protected: wxWindow* mpClientWnd; wxPanel* mpInternalFrm; - void SerializeMe( wxObjectStorage& store ); wxTextCtrl* CreateTextCtrl( const wxString& value ); @@ -65,8 +65,6 @@ public: MyFrame( wxWindow* parent, char *title ); ~MyFrame(); - void OnLoad( wxCommandEvent& event ); - void OnStore( wxCommandEvent& event ); void OnQuit( wxCommandEvent& event ); bool OnClose(void) { return TRUE; } @@ -110,8 +108,6 @@ bool MyApp::OnInit(void) BEGIN_EVENT_TABLE(MyFrame, wxFrame) - EVT_MENU( ID_LOAD, MyFrame::OnLoad ) - EVT_MENU( ID_STORE, MyFrame::OnStore ) EVT_MENU( ID_QUIT, MyFrame::OnQuit ) END_EVENT_TABLE() @@ -202,46 +198,6 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value ) return pCtrl; } -void MyFrame::OnLoad( wxCommandEvent& event ) -{ - if ( !wxFileExists( LAYOUT_FILE ) ) - { - wxMessageBox( "layout data file `layout.dat' not found\n\n store layout first" ); - - return; - } - - mpLayout->HideBarWindows(); // hide first, to avoid flickered destruction - mpLayout->DestroyBarWindows(); - - if ( mpClientWnd ) - { - mpClientWnd->Destroy(); - delete mpLayout; - - mpClientWnd = NULL; - } - - wxIOStreamWrapper stm; - stm.CreateForInput( LAYOUT_FILE ); // TRUE - create stream for input - - wxObjectStorage store( stm ); - - SerializeMe( store ); - - mpLayout->Activate(); -} - -void MyFrame::OnStore( wxCommandEvent& event ) -{ - wxIOStreamWrapper stm; - stm.CreateForOutput( LAYOUT_FILE ); // FALSE - create stream for output - - wxObjectStorage store( stm ); - - SerializeMe( store ); -} - void MyFrame::OnQuit( wxCommandEvent& event ) { Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction @@ -249,21 +205,6 @@ void MyFrame::OnQuit( wxCommandEvent& event ) Close(TRUE); } -void MyFrame::SerializeMe( wxObjectStorage& store ) -{ - // mark contaienr-frames as not serializable - - store.AddInitialRef( mpInternalFrm ); - store.AddInitialRef( this ); - - // does all the rest for as - - store.XchgObjPtr( (wxObject**) &(mpLayout) ); - store.XchgObjPtr( (wxObject**) &(mpClientWnd) ); - - store.Finalize(); // finish serialization -} - #ifdef __HACK_MY_MSDEV40__ ////////////// new 2.0-magic (linker errors...) ////////////////