- if ( (mAutoSave && mSavedAlready) || !mAutoSave );
- else
- {
- wxCommandEvent evt;
- this->OnStore(evt);
- }
-
- mAboutBox.Destroy();
- this->Destroy();
-
- return TRUE;
-}
-
-void MyFrame::OnLoad( wxCommandEvent& event )
-{
- if ( !wxFileExists( "layouts_for_demo.dat" ) )
- {
- wxMessageBox(
-
-"File \"layouts_for_demo.dat\" was not found,\n select\
-(File|Store Layouts) menu item to store layout information first"
- );
- return;
- }
-
- DestroyEverything();
-
- wxIOStreamWrapper stm;
- stm.CreateForInput( "layouts_for_demo.dat" );
-
- wxObjectStorage store( stm );
-
- SerializeMe( store );
-
- if ( mLayouts[mActiveLayoutNo] )
-
- mLayouts[mActiveLayoutNo]->Activate();
-}
-
-void MyFrame::OnStore( wxCommandEvent& event )
-{
- wxIOStreamWrapper stm;
- stm.CreateForOutput( "layouts_for_demo.dat" );
-
- wxObjectStorage store( stm );
-
- SerializeMe( store );
-
- mSavedAlready = TRUE;
-}
-
-void MyFrame::OnAutoSave( wxCommandEvent& event )
-{
- mAutoSave = !mAutoSave;