// 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)
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;
// 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();
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 );
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()