applied patch #935127: "wxDIALOG_MODAL and wxDIALOG_MODELESS cleaning"; some cosmetic cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2004-05-25 12:44:56 +00:00
parent be5a51fb59
commit 2a21ac1590
19 changed files with 585 additions and 618 deletions

View File

@@ -182,7 +182,7 @@ void MyApp::PropertyListTest(bool useDialog)
if (useDialog) if (useDialog)
{ {
propDialog = new PropListDialog(view, NULL, _T("Property Sheet Test"), propDialog = new PropListDialog(view, NULL, _T("Property Sheet Test"),
wxDefaultPosition, wxSize(400, 500), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODELESS); wxDefaultPosition, wxSize(400, 500));
m_childWindow = propDialog; m_childWindow = propDialog;
} }
else else
@@ -230,7 +230,7 @@ void MyApp::PropertyFormTest(bool useDialog)
if (useDialog) if (useDialog)
{ {
propDialog = new PropFormDialog(view, NULL, _T("Property Form Test"), propDialog = new PropFormDialog(view, NULL, _T("Property Form Test"),
wxDefaultPosition, wxSize(380, 250), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL); wxDefaultPosition, wxSize(380, 250));
m_childWindow = propDialog; m_childWindow = propDialog;
} }
else else

View File

@@ -73,7 +73,7 @@ bool MyApp::OnInit(void)
file_menu->Append( ID_STORE, _("&Store layouts") ); file_menu->Append( ID_STORE, _("&Store layouts") );
file_menu->AppendSeparator(); file_menu->AppendSeparator();
file_menu->Append( ID_AUTOSAVE, _("&Auto Save Layouts"), _("save layouts on exit"), TRUE ); file_menu->Append( ID_AUTOSAVE, _("&Auto Save Layouts"), _("save layouts on exit"), wxITEM_CHECK );
file_menu->AppendSeparator(); file_menu->AppendSeparator();
file_menu->Append(MINIMAL_ABOUT, _("A&bout !")); file_menu->Append(MINIMAL_ABOUT, _("A&bout !"));
@@ -87,9 +87,9 @@ bool MyApp::OnInit(void)
active_menu->Append( ID_RECREATE, _("Re&create") ); active_menu->Append( ID_RECREATE, _("Re&create") );
active_menu->AppendSeparator(); active_menu->AppendSeparator();
active_menu->Append( ID_FIRST, _("Activate f&irst layout \tF1"), _("activate it"), TRUE ); active_menu->Append( ID_FIRST, _("Activate f&irst layout \tF1"), _("activate it"), wxITEM_CHECK );
active_menu->Append( ID_SECOND, _("Activate &second layout\tF2"), _("activate it"), TRUE ); active_menu->Append( ID_SECOND, _("Activate &second layout\tF2"), _("activate it"), wxITEM_CHECK );
active_menu->Append( ID_THIRD, _("Activate &third layout\tF3"), _("activate it"), TRUE ); active_menu->Append( ID_THIRD, _("Activate &third layout\tF3"), _("activate it"), wxITEM_CHECK );
wxMenuBar *menu_bar = new wxMenuBar; wxMenuBar *menu_bar = new wxMenuBar;
@@ -103,11 +103,11 @@ bool MyApp::OnInit(void)
frame->SyncMenuBarItems(); frame->SyncMenuBarItems();
// Show the frame // Show the frame
frame->Show(TRUE); frame->Show(true);
SetTopWindow(frame); SetTopWindow(frame);
return TRUE; return true;
} }
MyFrame::~MyFrame() MyFrame::~MyFrame()
@@ -155,25 +155,25 @@ END_EVENT_TABLE()
// My frame constructor // My frame constructor
MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h) MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h)
: wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)), : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)),
mpNestedLayout( NULL ), mpNestedLayout( NULL ),
mpAboutBoxLayout( NULL ), mpAboutBoxLayout( NULL ),
mActiveLayoutNo( FIRST_LAYOUT ), mActiveLayoutNo( FIRST_LAYOUT ),
mAutoSave( TRUE ), mAutoSave( true ),
mSavedAlready( FALSE ), mSavedAlready( false ),
mpClntWindow( NULL ), mpClntWindow( NULL ),
mImageList( 16,16, FALSE, 2 ) mImageList( 16,16, false, 2 )
{ {
int i; int i;
mpInternalFrm = (wxPanel*)this; mpInternalFrm = (wxPanel*)this;
mAboutBox.Create( this, -1, _T("About box in wxWidgets style..."), mAboutBox.Create( this, wxID_ANY, _T("About box in wxWidgets style..."),
wxDefaultPosition, wxDefaultPosition,
wxSize( 385,220), wxSize( 385,220),
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL ); wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL );
for( i = 0; i != MAX_LAYOUTS; ++i ) for( i = 0; i != MAX_LAYOUTS; ++i )
mLayouts[i] = NULL; mLayouts[i] = NULL;
@@ -224,7 +224,7 @@ bool MyFrame::OnClose(void)
// USEFUL TRICK:: avoids flickering of application's frame // USEFUL TRICK:: avoids flickering of application's frame
// when closing NN windows on exit: // when closing NN windows on exit:
this->Show(FALSE); Show(false);
if ( (mAutoSave && mSavedAlready) || !mAutoSave ) if ( (mAutoSave && mSavedAlready) || !mAutoSave )
{ {
@@ -232,13 +232,13 @@ bool MyFrame::OnClose(void)
else else
{ {
wxCommandEvent evt; wxCommandEvent evt;
this->OnStore(evt); OnStore(evt);
} }
mAboutBox.Destroy(); mAboutBox.Destroy();
this->Destroy(); Destroy();
return TRUE; return true;
} }
void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
@@ -256,7 +256,7 @@ void MyFrame::OnAutoSave( wxCommandEvent& WXUNUSED(event) )
mAutoSave = !mAutoSave; mAutoSave = !mAutoSave;
wxCommandEvent evt; wxCommandEvent evt;
this->OnStore(evt); OnStore(evt);
SyncMenuBarItems(); SyncMenuBarItems();
} }
@@ -308,7 +308,7 @@ void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
// USEFUL TRICK:: avoids flickering of application's frame // USEFUL TRICK:: avoids flickering of application's frame
// when closing NN windows on exit: // when closing NN windows on exit:
this->Show(FALSE); Show(false);
if ( (mAutoSave && mSavedAlready) || !mAutoSave ) if ( (mAutoSave && mSavedAlready) || !mAutoSave )
{ {
@@ -316,7 +316,7 @@ void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
else else
{ {
wxCommandEvent evt; wxCommandEvent evt;
this->OnStore(evt); OnStore(evt);
} }
Destroy(); Destroy();
@@ -340,7 +340,7 @@ void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
#endif #endif
mAboutBox.Center( wxBOTH ); mAboutBox.Center( wxBOTH );
mAboutBox.Show(TRUE); mAboutBox.Show(true);
} }
@@ -350,19 +350,19 @@ void MyFrame::OnChar( wxKeyEvent& event )
if ( event.m_keyCode == WXK_F1 ) if ( event.m_keyCode == WXK_F1 )
{ {
this->OnFirst( evt ); OnFirst( evt );
} }
else else
{ {
if ( event.m_keyCode == WXK_F2 ) if ( event.m_keyCode == WXK_F2 )
{ {
this->OnSecond( evt ); OnSecond( evt );
} }
else else
{ {
if ( event.m_keyCode == WXK_F3 ) if ( event.m_keyCode == WXK_F3 )
{ {
this->OnThird( evt ); OnThird( evt );
} }
if ( event.m_keyCode == WXK_F4 && !event.AltDown() ) if ( event.m_keyCode == WXK_F4 && !event.AltDown() )
{ {
@@ -376,7 +376,7 @@ void MyFrame::OnChar( wxKeyEvent& event )
// USEFUL TRICK:: avoids flickering of application's frame // USEFUL TRICK:: avoids flickering of application's frame
// when closing NN windows on exit: // when closing NN windows on exit:
this->Show(FALSE); Show(false);
if ( (mAutoSave && mSavedAlready) || !mAutoSave ) if ( (mAutoSave && mSavedAlready) || !mAutoSave )
{ {
@@ -384,7 +384,7 @@ void MyFrame::OnChar( wxKeyEvent& event )
else else
{ {
wxCommandEvent evt; wxCommandEvent evt;
this->OnStore(evt); OnStore(evt);
} }
Destroy(); Destroy();
@@ -405,17 +405,17 @@ void MyFrame::OnSayItsOk( wxCommandEvent& WXUNUSED(event) )
void MyFrame::OnBtnYes( wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnBtnYes( wxCommandEvent& WXUNUSED(event) )
{ {
mAboutBox.Show(FALSE); mAboutBox.Show(false);
} }
void MyFrame::OnBtnNo( wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnBtnNo( wxCommandEvent& WXUNUSED(event) )
{ {
mAboutBox.Show(FALSE); mAboutBox.Show(false);
} }
void MyFrame::OnBtnEsc( wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnBtnEsc( wxCommandEvent& WXUNUSED(event) )
{ {
mAboutBox.Show(FALSE); mAboutBox.Show(false);
} }
/*** helper methods ***/ /*** helper methods ***/
@@ -424,25 +424,25 @@ void MyFrame::InitAboutBox()
{ {
wxPanel* pArea = new wxPanel(); wxPanel* pArea = new wxPanel();
pArea->Create( &mAboutBox, -1 ); pArea->Create( &mAboutBox, wxID_ANY );
new wxStaticText(pArea, -1, _("This is wxFrameLayout contribution demo."), new wxStaticText(pArea, wxID_ANY, _("This is wxFrameLayout contribution demo."),
wxPoint(10, 10) ); wxPoint(10, 10) );
new wxStaticText(pArea, -1, _("Aleksandras Gluchovas (c) 1998"), new wxStaticText(pArea, wxID_ANY, _("Aleksandras Gluchovas (c) 1998"),
wxPoint(10, 30) ); wxPoint(10, 30) );
new wxStaticText(pArea, -1, _("<mailto:alex@soften.ktu.lt>"), new wxStaticText(pArea, wxID_ANY, _("<mailto:alex@soften.ktu.lt>"),
wxPoint(10, 50) ); wxPoint(10, 50) );
mpAboutBoxLayout = new wxFrameLayout( &mAboutBox, pArea, TRUE ); mpAboutBoxLayout = new wxFrameLayout( &mAboutBox, pArea, true );
wxFrameLayout& layout = *mpAboutBoxLayout; wxFrameLayout& layout = *mpAboutBoxLayout;
cbDimInfo sizes( 90,40, // when docked horizontally cbDimInfo sizes( 90,40, // when docked horizontally
45,55, // when docked vertically 45,55, // when docked vertically
90,40, // when floated 90,40, // when floated
TRUE, 4, 4 // true - bar is fixed-size true, 4, 4 // true - bar is fixed-size
); );
@@ -461,7 +461,7 @@ void MyFrame::InitAboutBox()
layout.GetPaneProperties( props, FL_ALIGN_TOP ); layout.GetPaneProperties( props, FL_ALIGN_TOP );
props.mShow3DPaneBorderOn = FALSE; props.mShow3DPaneBorderOn = false;
layout.SetPaneProperties( props, wxALL_PANES ); layout.SetPaneProperties( props, wxALL_PANES );
@@ -474,7 +474,7 @@ void MyFrame::InitAboutBox()
wxTextCtrl* MyFrame::CreateTxtCtrl( const wxString& txt, wxWindow* parent ) wxTextCtrl* MyFrame::CreateTxtCtrl( const wxString& txt, wxWindow* parent )
{ {
return new wxTextCtrl( (parent != NULL ) ? parent : mpInternalFrm, return new wxTextCtrl( (parent != NULL ) ? parent : mpInternalFrm,
-1, txt, wxDefaultPosition, wxDefaultSize, wxID_ANY, txt, wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE ); wxTE_MULTILINE );
} }
@@ -487,7 +487,7 @@ wxButton* MyFrame::CreateButton( const wxString& label,
wxTreeCtrl* MyFrame::CreateTreeCtrl( const wxString& label ) wxTreeCtrl* MyFrame::CreateTreeCtrl( const wxString& label )
{ {
wxTreeCtrl* pTree = new wxTreeCtrl( mpInternalFrm, -1 ); wxTreeCtrl* pTree = new wxTreeCtrl( mpInternalFrm, wxID_ANY );
const wxTreeItemId rootid = pTree->AppendItem( (long)0, label, 0); const wxTreeItemId rootid = pTree->AppendItem( (long)0, label, 0);
@@ -530,7 +530,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
cbDimInfo sizes2( 275,38, // when docked horizontally cbDimInfo sizes2( 275,38, // when docked horizontally
45,275, // when docked vertically 45,275, // when docked vertically
80,30, // when floated 80,30, // when floated
TRUE, // the bar is fixed-size true, // the bar is fixed-size
4, // vertical gap (bar border) 4, // vertical gap (bar border)
4, // horizontal gap (bar border) 4, // horizontal gap (bar border)
new cbDynToolBarDimHandler() new cbDynToolBarDimHandler()
@@ -539,7 +539,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
cbDimInfo sizes3( 275,55, // when docked horizontally cbDimInfo sizes3( 275,55, // when docked horizontally
275,60, // when docked vertically 275,60, // when docked vertically
45,130, // when floated 45,130, // when floated
TRUE, // the bar is fixed-size true, // the bar is fixed-size
4, // vertical gap (bar border) 4, // vertical gap (bar border)
4, // horizontal gap (bar border) 4, // horizontal gap (bar border)
new cbDynToolBarDimHandler() new cbDynToolBarDimHandler()
@@ -548,15 +548,15 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
cbDimInfo sizes4( 430,35, // when docked horizontally cbDimInfo sizes4( 430,35, // when docked horizontally
44,375, // when docked vertically 44,375, // when docked vertically
80,100, // when floated 80,100, // when floated
TRUE, // the bar is fixed-size true, // the bar is fixed-size
4, // vertical gap (bar border) 4, // vertical gap (bar border)
4, // horizontal gap (bar border) 4, // horizontal gap (bar border)
new cbDynToolBarDimHandler() new cbDynToolBarDimHandler()
); );
wxDynamicToolBar* pTBar2 = new wxDynamicToolBar( mpInternalFrm, -1 ); wxDynamicToolBar* pTBar2 = new wxDynamicToolBar( mpInternalFrm, wxID_ANY );
wxChoice* pChoice = new wxChoice( pTBar2, -1, wxDefaultPosition, wxSize( 140,25 ) ); wxChoice* pChoice = new wxChoice( pTBar2, wxID_ANY, wxDefaultPosition, wxSize( 140,25 ) );
pTBar2->AddTool( 1, pChoice ); pTBar2->AddTool( 1, pChoice );
pTBar2->AddTool( 2, wxString(wxT(BMP_DIR)) + wxT("search.bmp") ); pTBar2->AddTool( 2, wxString(wxT(BMP_DIR)) + wxT("search.bmp") );
@@ -565,7 +565,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
pTBar2->AddTool( 4, wxString(wxT(BMP_DIR)) + wxT("nextmark.bmp") ); pTBar2->AddTool( 4, wxString(wxT(BMP_DIR)) + wxT("nextmark.bmp") );
pTBar2->AddTool( 5, wxString(wxT(BMP_DIR)) + wxT("prevmark.bmp") ); pTBar2->AddTool( 5, wxString(wxT(BMP_DIR)) + wxT("prevmark.bmp") );
wxDynamicToolBar* pTBar3 = new wxDynamicToolBar( mpInternalFrm, -1 ); wxDynamicToolBar* pTBar3 = new wxDynamicToolBar( mpInternalFrm, wxID_ANY );
pTBar3->AddTool( 1, wxString(wxT(BMP_DIR)) + wxT("open.bmp"), wxBITMAP_TYPE_BMP, wxString(_(" Open ")) ); pTBar3->AddTool( 1, wxString(wxT(BMP_DIR)) + wxT("open.bmp"), wxBITMAP_TYPE_BMP, wxString(_(" Open ")) );
pTBar3->AddTool( 2, wxString(wxT(BMP_DIR)) + wxT("save.bmp"), wxBITMAP_TYPE_BMP, wxString(_(" Save ")) ); pTBar3->AddTool( 2, wxString(wxT(BMP_DIR)) + wxT("save.bmp"), wxBITMAP_TYPE_BMP, wxString(_(" Save ")) );
@@ -576,19 +576,19 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
pTBar3->AddTool( 6, wxString(wxT(BMP_DIR)) + wxT("paste.bmp"), wxBITMAP_TYPE_BMP, wxString(_(" Paste ")) ); pTBar3->AddTool( 6, wxString(wxT(BMP_DIR)) + wxT("paste.bmp"), wxBITMAP_TYPE_BMP, wxString(_(" Paste ")) );
#ifdef __WXMSW__ #ifdef __WXMSW__
pTBar3->EnableTool( 2, FALSE ); pTBar3->EnableTool( 2, false );
#endif #endif
wxDynamicToolBar* pTBar4 = new wxDynamicToolBar( mpInternalFrm, -1 ); wxDynamicToolBar* pTBar4 = new wxDynamicToolBar( mpInternalFrm, wxID_ANY );
pTBar4->AddTool( 1, wxString(wxT(BMP_DIR)) + wxT("bookmarks.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Bookmarks ")), TRUE ); pTBar4->AddTool( 1, wxString(wxT(BMP_DIR)) + wxT("bookmarks.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Bookmarks ")), true );
pTBar4->AddTool( 2, wxString(wxT(BMP_DIR)) + wxT("nextmark.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Next bookmark ")), TRUE ); pTBar4->AddTool( 2, wxString(wxT(BMP_DIR)) + wxT("nextmark.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Next bookmark ")), true );
pTBar4->AddTool( 3, wxString(wxT(BMP_DIR)) + wxT("prevmark.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Prev bookmark ")), TRUE ); pTBar4->AddTool( 3, wxString(wxT(BMP_DIR)) + wxT("prevmark.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Prev bookmark ")), true );
//pTBar4->AddSeparator(); //pTBar4->AddSeparator();
pTBar4->AddTool( 4, wxString(wxT(BMP_DIR)) + wxT("search.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Search ")), TRUE ); pTBar4->AddTool( 4, wxString(wxT(BMP_DIR)) + wxT("search.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Search ")), true );
#ifdef __WXMSW__ #ifdef __WXMSW__
pTBar4->EnableTool( 4, FALSE ); pTBar4->EnableTool( 4, false );
#endif #endif
layout.AddBar( pTBar2, layout.AddBar( pTBar2,
@@ -596,7 +596,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
0, 0,
0, 0,
wxT("Search"), wxT("Search"),
TRUE true
); );
layout.AddBar( pTBar3, layout.AddBar( pTBar3,
@@ -604,7 +604,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
0, 0,
0, 0,
wxT("Titled"), wxT("Titled"),
TRUE true
); );
layout.AddBar( pTBar4, layout.AddBar( pTBar4,
@@ -612,7 +612,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
1, 1,
0, 0,
wxT("Bookmarks"), wxT("Bookmarks"),
TRUE true
); );
} }
@@ -642,14 +642,14 @@ wxWindow* MyFrame::CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent )
cbDimInfo sizes4( cbWidth,cbHeight, cbDimInfo sizes4( cbWidth,cbHeight,
cbWidth,cbHeight, cbWidth,cbHeight,
cbWidth,cbHeight, FALSE ); cbWidth,cbHeight, false );
cbWidth = 75; cbWidth = 75;
cbHeight = 31; cbHeight = 31;
cbDimInfo sizes5( cbWidth,cbHeight, cbDimInfo sizes5( cbWidth,cbHeight,
42,65, 42,65,
cbWidth,cbHeight, TRUE, cbWidth,cbHeight, true,
3, // vertical gap (bar border) 3, // vertical gap (bar border)
3 // horizontal gap (bar border) 3 // horizontal gap (bar border)
); );
@@ -657,10 +657,10 @@ wxWindow* MyFrame::CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent )
// create "workplace" window in the third layout // create "workplace" window in the third layout
// SEB: originally here was a wxpp (wxWorkshop) class demotrated // SEB: originally here was a wxpp (wxWorkshop) class demotrated
// wxTabbedWindow* pMiniTabArea = new wxTabbedWindow(); // wxTabbedWindow* pMiniTabArea = new wxTabbedWindow();
// pMiniTabArea->Create( pParent, -1 ); // pMiniTabArea->Create( pParent, wxID_ANY );
wxTreeCtrl* pClassView = new wxTreeCtrl( pParent, -1, wxTreeCtrl* pClassView = new wxTreeCtrl( pParent, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS ); wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS );
pClassView->SetImageList( &mImageList ); pClassView->SetImageList( &mImageList );
@@ -671,14 +671,14 @@ wxWindow* MyFrame::CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent )
pClassView->AppendItem( rootId, _("serializer-classes (grabbed at run-time)"), 0 ); pClassView->AppendItem( rootId, _("serializer-classes (grabbed at run-time)"), 0 );
// now create "output" window // now create "output" window
wxNotebook* pTabbedArea = new wxNotebook(pParent, -1); wxNotebook* pTabbedArea = new wxNotebook(pParent, wxID_ANY);
// SEB: originally here was a wxpp (wxWorkshop) class used // SEB: originally here was a wxpp (wxWorkshop) class used
// wxPaggedWindow* pTabbedArea = new wxPaggedWindow(); // wxPaggedWindow* pTabbedArea = new wxPaggedWindow();
// pTabbedArea->Create( pParent, -1 ); // pTabbedArea->Create( pParent, wxID_ANY );
wxPanel* pSheet3 = new wxPanel(); wxPanel* pSheet3 = new wxPanel();
pSheet3->Create( pTabbedArea, -1 ); pSheet3->Create( pTabbedArea, wxID_ANY );
pSheet3->Show(FALSE); pSheet3->Show(false);
pTabbedArea->AddPage( CreateTxtCtrl(wxT("build"), pTabbedArea), wxT("Build")); pTabbedArea->AddPage( CreateTxtCtrl(wxT("build"), pTabbedArea), wxT("Build"));
pTabbedArea->AddPage( CreateTxtCtrl(wxT("debug"), pTabbedArea), wxT("Debug")); pTabbedArea->AddPage( CreateTxtCtrl(wxT("debug"), pTabbedArea), wxT("Debug"));
@@ -709,35 +709,35 @@ void MyFrame::DropInSomeBars( int layoutNo )
cbDimInfo sizes( cbWidth,cbHeight, // when docked horizontally cbDimInfo sizes( cbWidth,cbHeight, // when docked horizontally
cbWidth,cbHeight, // when docked vertically cbWidth,cbHeight, // when docked vertically
cbWidth,cbHeight, // when floated cbWidth,cbHeight, // when floated
TRUE // true - bar is fixed-size true // true - bar is fixed-size
); );
cbWidth = 120; cbWidth = 120;
cbDimInfo sizes1( cbWidth,cbHeight, cbDimInfo sizes1( cbWidth,cbHeight,
cbWidth,cbHeight, cbWidth,cbHeight,
cbWidth,cbHeight, FALSE ); // false - bar is "flexible" cbWidth,cbHeight, false ); // false - bar is "flexible"
cbWidth = 120; cbWidth = 120;
cbHeight = 40; cbHeight = 40;
cbDimInfo sizes3( cbWidth,cbHeight, cbDimInfo sizes3( cbWidth,cbHeight,
cbWidth,cbHeight, cbWidth,cbHeight,
cbWidth,cbHeight, TRUE ); // -/- cbWidth,cbHeight, true ); // -/-
cbWidth = 200; cbWidth = 200;
cbHeight = 150; cbHeight = 150;
cbDimInfo sizes4( cbWidth,cbHeight, cbDimInfo sizes4( cbWidth,cbHeight,
cbWidth,cbHeight, cbWidth,cbHeight,
cbWidth,cbHeight, FALSE ); // -/- cbWidth,cbHeight, false ); // -/-
cbWidth = 63; cbWidth = 63;
cbHeight = 31; cbHeight = 31;
cbDimInfo sizes5( cbWidth,cbHeight, cbDimInfo sizes5( cbWidth,cbHeight,
cbHeight,cbWidth, cbHeight,cbWidth,
cbWidth,cbHeight, TRUE, cbWidth,cbHeight, true,
3, // vertical gap (bar border) 3, // vertical gap (bar border)
3 // horizontal gap (bar border) 3 // horizontal gap (bar border)
); // -/- ); // -/-
@@ -751,11 +751,11 @@ void MyFrame::DropInSomeBars( int layoutNo )
pGreenOne->SetBackgroundColour( wxColour(128,255,128) ); pGreenOne->SetBackgroundColour( wxColour(128,255,128) );
layout.AddBar( pGreenOne, sizes, FL_ALIGN_TOP, 0, 50, wxT("Bar1"), TRUE ); layout.AddBar( pGreenOne, sizes, FL_ALIGN_TOP, 0, 50, wxT("Bar1"), true );
layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_TOP, 2, 50, wxT("Bar2"), TRUE ); layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_TOP, 2, 50, wxT("Bar2"), true );
layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_BOTTOM, 2, 50, wxT("Bar3"), TRUE ); layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_BOTTOM, 2, 50, wxT("Bar3"), true );
layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_LEFT, 2, 50, wxT("Bar4"), TRUE ); layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_LEFT, 2, 50, wxT("Bar4"), true );
layout.AddBar( new MyTestPanel(mpInternalFrm), sizes1, wxCBAR_HIDDEN, 2, 50, wxT("Super-Bar"), TRUE ); layout.AddBar( new MyTestPanel(mpInternalFrm), sizes1, wxCBAR_HIDDEN, 2, 50, wxT("Super-Bar"), true );
} }
else else
{ {
@@ -767,8 +767,8 @@ void MyFrame::DropInSomeBars( int layoutNo )
layout.AddBar( CreateButton(wxT("OK")), sizes, FL_ALIGN_TOP, 0, 100, wxT("First Button") ); layout.AddBar( CreateButton(wxT("OK")), sizes, FL_ALIGN_TOP, 0, 100, wxT("First Button") );
layout.AddBar( CreateTxtCtrl(), sizes1, FL_ALIGN_BOTTOM, 0, 50, wxT("First Tree") ); layout.AddBar( CreateTxtCtrl(), sizes1, FL_ALIGN_BOTTOM, 0, 50, wxT("First Tree") );
layout.AddBar( CreateTreeCtrl(wxT("Root")), sizes1, FL_ALIGN_LEFT, 0, 0, wxT("TreeCtrl Window") ); layout.AddBar( CreateTreeCtrl(wxT("Root")), sizes1, FL_ALIGN_LEFT, 0, 0, wxT("TreeCtrl Window") );
layout.AddBar( CreateChoice(wxT("Choice 1")), sizes3, FL_ALIGN_TOP, 0, 0, wxT("Choice 1 (buggy)"), FALSE, wxCBAR_HIDDEN ); layout.AddBar( CreateChoice(wxT("Choice 1")), sizes3, FL_ALIGN_TOP, 0, 0, wxT("Choice 1 (buggy)"), false, wxCBAR_HIDDEN );
layout.AddBar( CreateChoice(wxT("Choice 2")), sizes3, FL_ALIGN_TOP, 0, 0, wxT("Choice 2 (buggy)"), FALSE, wxCBAR_HIDDEN ); layout.AddBar( CreateChoice(wxT("Choice 2")), sizes3, FL_ALIGN_TOP, 0, 0, wxT("Choice 2 (buggy)"), false, wxCBAR_HIDDEN );
layout.AddBar( CreateTreeCtrl(wxT("X-Files")), sizes1, FL_ALIGN_RIGHT, 0, 100, wxT("X-Files") ); layout.AddBar( CreateTreeCtrl(wxT("X-Files")), sizes1, FL_ALIGN_RIGHT, 0, 100, wxT("X-Files") );
layout.AddBar( CreateTxtCtrl(wxT("smaller1")), sizes3, FL_ALIGN_TOP, 0, 50, wxT("smaller Area1") ); layout.AddBar( CreateTxtCtrl(wxT("smaller1")), sizes3, FL_ALIGN_TOP, 0, 50, wxT("smaller Area1") );
layout.AddBar( CreateTxtCtrl(wxT("smaller2")), sizes3, FL_ALIGN_TOP, 0, 50, wxT("sm&ller Area2") ); layout.AddBar( CreateTxtCtrl(wxT("smaller2")), sizes3, FL_ALIGN_TOP, 0, 50, wxT("sm&ller Area2") );
@@ -780,7 +780,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
#if defined(__WXGTK__) || defined(__WXX11__) #if defined(__WXGTK__) || defined(__WXX11__)
cbCommonPaneProperties props; cbCommonPaneProperties props;
layout.GetPaneProperties( props ); layout.GetPaneProperties( props );
props.mRealTimeUpdatesOn = FALSE; // real-time OFF for gtk!!! props.mRealTimeUpdatesOn = false; // real-time OFF for gtk!!!
layout.SetPaneProperties( props, wxALL_PANES ); layout.SetPaneProperties( props, wxALL_PANES );
#endif #endif
@@ -795,7 +795,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
cbDimInfo sizes10( 175,35, // when docked horizontally cbDimInfo sizes10( 175,35, // when docked horizontally
175,38, // when docked vertically 175,38, // when docked vertically
170,35, // when floated 170,35, // when floated
TRUE, // the bar is not fixed-size true, // the bar is not fixed-size
4, // vertical gap (bar border) 4, // vertical gap (bar border)
4, // horizontal gap (bar border) 4, // horizontal gap (bar border)
new cbDynToolBarDimHandler() new cbDynToolBarDimHandler()
@@ -803,7 +803,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
wxDynamicToolBar* pToolBar = new wxDynamicToolBar(); wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
pToolBar->Create( mpInternalFrm, -1 ); pToolBar->Create( mpInternalFrm, wxID_ANY );
// 1001-1006 ids of command events fired by added tool-buttons // 1001-1006 ids of command events fired by added tool-buttons
@@ -820,7 +820,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
0, // insert into 0th row (vert. position) 0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels) 0, // offset from the start of row (in pixels)
wxT("Real-Toolbar"), // name to refere in customization pop-ups wxT("Real-Toolbar"), // name to refere in customization pop-ups
FALSE false
); );
// create first "developement" layout // create first "developement" layout
@@ -832,7 +832,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
// the third sheet of the outter one's output bar // the third sheet of the outter one's output bar
mpNestedLayout = new wxFrameLayout( pSheet3, mpNestedLayout = new wxFrameLayout( pSheet3,
CreateTxtCtrl(wxT("\"Mobils in Mobile\" --C.Nemo"),pSheet3), FALSE ); CreateTxtCtrl(wxT("\"Mobils in Mobile\" --C.Nemo"),pSheet3), false );
CreateDevLayout( *mpNestedLayout, pSheet3 ); CreateDevLayout( *mpNestedLayout, pSheet3 );
@@ -844,7 +844,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
void MyFrame::CreateLayout( int layoutNo ) void MyFrame::CreateLayout( int layoutNo )
{ {
wxFrameLayout* pLayout = new wxFrameLayout( mpInternalFrm, mpClntWindow, FALSE ); wxFrameLayout* pLayout = new wxFrameLayout( mpInternalFrm, mpClntWindow, false );
if ( layoutNo == THIRD_LAYOUT ) if ( layoutNo == THIRD_LAYOUT )
{ {
@@ -930,7 +930,7 @@ END_EVENT_TABLE()
void StartButton95::OnMouseDown( wxMouseEvent& WXUNUSED(event) ) void StartButton95::OnMouseDown( wxMouseEvent& WXUNUSED(event) )
{ {
m_bPressed = TRUE; m_bPressed = true;
Refresh(); Refresh();
CaptureMouse(); CaptureMouse();
} }

View File

@@ -1643,7 +1643,7 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
wxBeginBusyCursor(); wxBeginBusyCursor();
wxPropertyStringListEditorDialog *dialog = new wxPropertyStringListEditorDialog(parent, wxPropertyStringListEditorDialog *dialog = new wxPropertyStringListEditorDialog(parent,
title, wxPoint(10, 10), wxSize(400, 400), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL); title, wxPoint(10, 10), wxSize(400, 400));
dialog->m_stringList = stringList; dialog->m_stringList = stringList;

View File

@@ -7,8 +7,6 @@
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) 1993-1998 Chris Breeze // Copyright: (c) 1993-1998 Chris Breeze
// Licence: wxWindows licence // Licence: wxWindows licence
//---------------------------------------------------------------------------
// Last modified: 22nd July 1998 - ported to wxWidgets 2.0
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -44,9 +42,7 @@ PlayerSelectionDialog::PlayerSelectionDialog(
wxWindow* parent, wxWindow* parent,
ScoreFile* file ScoreFile* file
) : ) :
wxDialog(parent, wxID_ANY, _T("Player Selection"), wxDialog(parent, wxID_ANY, _T("Player Selection"), wxDefaultPosition),
wxDefaultPosition, wxDefaultSize,
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE),
m_scoreFile(file) m_scoreFile(file)
{ {
wxStaticText* msg = new wxStaticText(this, wxID_ANY, _T("Please select a name or type a new one:")); wxStaticText* msg = new wxStaticText(this, wxID_ANY, _T("Please select a name or type a new one:"));
@@ -65,7 +61,7 @@ PlayerSelectionDialog::PlayerSelectionDialog(
list->Append(players[i]); list->Append(players[i]);
} }
m_textField = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, 0); m_textField = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize);
m_OK = new wxButton(this, wxID_OK, _T("OK")); m_OK = new wxButton(this, wxID_OK, _T("OK"));
m_cancel = new wxButton(this, wxID_CANCEL, _T("Cancel")); m_cancel = new wxButton(this, wxID_CANCEL, _T("Cancel"));
@@ -99,7 +95,7 @@ void PlayerSelectionDialog::OnSize(wxSizeEvent& WXUNUSED(event))
const wxString& PlayerSelectionDialog::GetPlayersName() const wxString& PlayerSelectionDialog::GetPlayersName()
{ {
/* /*
m_player = ""; m_player = wxEmptyString;
Show(true); Show(true);
*/ */
return m_player; return m_player;
@@ -107,7 +103,7 @@ const wxString& PlayerSelectionDialog::GetPlayersName()
void PlayerSelectionDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) void PlayerSelectionDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{ {
m_player = _T(""); m_player = wxEmptyString;
EndModal(wxID_CANCEL); EndModal(wxID_CANCEL);
} }
@@ -144,7 +140,7 @@ void PlayerSelectionDialog::ButtonCallback(wxCommandEvent& event)
} }
else else
{ {
m_player = _T(""); m_player = wxEmptyString;
EndModal(wxID_CANCEL); EndModal(wxID_CANCEL);
} }
} }

View File

@@ -7,8 +7,6 @@
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) 1993-1998 Chris Breeze // Copyright: (c) 1993-1998 Chris Breeze
// Licence: wxWindows licence // Licence: wxWindows licence
//---------------------------------------------------------------------------
// Last modified: 22nd July 1998 - ported to wxWidgets 2.0
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(__APPLE__) #if defined(__GNUG__) && !defined(__APPLE__)
@@ -49,7 +47,7 @@ private:
}; };
ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile, const wxPoint& pos, wxSize& size) : ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile, const wxPoint& pos, wxSize& size) :
wxScrolledWindow(parent, -1, pos, size, wxSUNKEN_BORDER) wxScrolledWindow(parent, wxID_ANY, pos, size, wxSUNKEN_BORDER)
{ {
SetBackgroundColour(*wxWHITE); SetBackgroundColour(*wxWHITE);
#ifdef __WXGTK__ #ifdef __WXGTK__
@@ -137,8 +135,7 @@ END_EVENT_TABLE()
ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) : ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) :
wxDialog(parent, wxID_ANY, _("Scores"), wxDialog(parent, wxID_ANY, _("Scores"),
wxDefaultPosition, wxSize(400, 300), wxDefaultPosition, wxSize(400, 300)),
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE),
m_scoreFile(file) m_scoreFile(file)
{ {
// create grid with players // create grid with players

View File

@@ -7,8 +7,6 @@
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) 1993-1998 Chris Breeze // Copyright: (c) 1993-1998 Chris Breeze
// Licence: wxWindows licence // Licence: wxWindows licence
//---------------------------------------------------------------------------
// Last modified: 14th May 1998 - ported to wxWidgets 2.0
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -68,7 +66,7 @@ ScoreFile::ScoreFile(const wxString& appName)
} }
#endif #endif
m_config = new wxConfig(appName, _T("wxWidgets"), appName, _T(""), m_config = new wxConfig(appName, _T("wxWidgets"), appName, wxEmptyString,
wxCONFIG_USE_LOCAL_FILE); // only local wxCONFIG_USE_LOCAL_FILE); // only local
} }

View File

@@ -78,11 +78,8 @@ END_EVENT_TABLE()
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
LifeSamplesDialog::LifeSamplesDialog(wxWindow *parent) LifeSamplesDialog::LifeSamplesDialog(wxWindow *parent)
: wxDialog(parent, -1, : wxDialog(parent, wxID_ANY, _("Sample games"),
_("Sample games"), wxDefaultPosition, wxDefaultSize)
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL)
{ {
m_value = 0; m_value = 0;
@@ -97,11 +94,11 @@ LifeSamplesDialog::LifeSamplesDialog(wxWindow *parent)
m_list->Append(g_patterns[i].m_name); m_list->Append(g_patterns[i].m_name);
// descriptions // descriptions
wxStaticBox *statbox = new wxStaticBox( this, -1, _("Description")); wxStaticBox *statbox = new wxStaticBox( this, wxID_ANY, _("Description"));
m_life = new Life(); m_life = new Life();
m_life->SetPattern(g_patterns[0]); m_life->SetPattern(g_patterns[0]);
m_canvas = new LifeCanvas( this, m_life, FALSE ); m_canvas = new LifeCanvas( this, m_life, false );
m_text = new wxTextCtrl( this, -1, m_text = new wxTextCtrl( this, wxID_ANY,
g_patterns[0].m_description, g_patterns[0].m_description,
wxDefaultPosition, wxDefaultPosition,
wxSize(300, 60), wxSize(300, 60),
@@ -118,14 +115,13 @@ LifeSamplesDialog::LifeSamplesDialog(wxWindow *parent)
wxBoxSizer *sizer3 = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *sizer3 = new wxBoxSizer( wxVERTICAL );
sizer3->Add( CreateTextSizer(_("Select one configuration")), 0, wxALL, 10 ); sizer3->Add( CreateTextSizer(_("Select one configuration")), 0, wxALL, 10 );
sizer3->Add( new wxStaticLine(this, -1), 0, wxGROW | wxLEFT | wxRIGHT, 10 ); sizer3->Add( new wxStaticLine(this, wxID_ANY), 0, wxGROW | wxLEFT | wxRIGHT, 10 );
sizer3->Add( sizer2, 1, wxGROW | wxALL, 5 ); sizer3->Add( sizer2, 1, wxGROW | wxALL, 5 );
sizer3->Add( new wxStaticLine(this, -1), 0, wxGROW | wxLEFT | wxRIGHT, 10 ); sizer3->Add( new wxStaticLine(this, wxID_ANY), 0, wxGROW | wxLEFT | wxRIGHT, 10 );
sizer3->Add( CreateButtonSizer(wxOK | wxCANCEL), 0, wxCENTRE | wxALL, 10 ); sizer3->Add( CreateButtonSizer(wxOK | wxCANCEL), 0, wxCENTRE | wxALL, 10 );
// activate // activate
SetSizer(sizer3); SetSizer(sizer3);
SetAutoLayout(TRUE);
sizer3->SetSizeHints(this); sizer3->SetSizeHints(this);
sizer3->Fit(this); sizer3->Fit(this);
Centre(wxBOTH | wxCENTRE_ON_SCREEN); Centre(wxBOTH | wxCENTRE_ON_SCREEN);
@@ -164,35 +160,31 @@ void LifeSamplesDialog::OnListBox(wxCommandEvent& event)
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
LifeAboutDialog::LifeAboutDialog(wxWindow *parent) LifeAboutDialog::LifeAboutDialog(wxWindow *parent)
: wxDialog(parent, -1, : wxDialog(parent, wxID_ANY, _("About Life!"),
_("About Life!"), wxDefaultPosition, wxDefaultSize)
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL)
{ {
// logo // logo
wxBitmap bmp = wxBITMAP(life); wxBitmap bmp = wxBITMAP(life);
#if !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXMAC__) #if !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXMAC__)
bmp.SetMask(new wxMask(bmp, *wxBLUE)); bmp.SetMask(new wxMask(bmp, *wxBLUE));
#endif #endif
wxStaticBitmap *sbmp = new wxStaticBitmap(this, -1, bmp); wxStaticBitmap *sbmp = new wxStaticBitmap(this, wxID_ANY, bmp);
// layout components // layout components
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
sizer->Add( sbmp, 0, wxCENTRE | wxALL, 10 ); sizer->Add( sbmp, 0, wxCENTRE | wxALL, 10 );
sizer->Add( new wxStaticLine(this, -1), 0, wxGROW | wxLEFT | wxRIGHT, 5 ); sizer->Add( new wxStaticLine(this, wxID_ANY), 0, wxGROW | wxLEFT | wxRIGHT, 5 );
sizer->Add( CreateTextSizer(_("Life! version 2.2 for wxWidgets\n\n\ sizer->Add( CreateTextSizer(_("Life! version 2.2 for wxWidgets\n\n\
(c) 2000 Guillermo Rodriguez Garcia\n\n\ (c) 2000 Guillermo Rodriguez Garcia\n\n\
<guille@iies.es>\n\n\ <guille@iies.es>\n\n\
Portions of the code are based in XLife;\n\ Portions of the code are based in XLife;\n\
XLife is (c) 1989 by Jon Bennett et al.")), XLife is (c) 1989 by Jon Bennett et al.")),
0, wxCENTRE | wxALL, 20 ); 0, wxCENTRE | wxALL, 20 );
sizer->Add( new wxStaticLine(this, -1), 0, wxGROW | wxLEFT | wxRIGHT, 5 ); sizer->Add( new wxStaticLine(this, wxID_ANY), 0, wxGROW | wxLEFT | wxRIGHT, 5 );
sizer->Add( CreateButtonSizer(wxOK), 0, wxCENTRE | wxALL, 10 ); sizer->Add( CreateButtonSizer(wxOK), 0, wxCENTRE | wxALL, 10 );
// activate // activate
SetSizer(sizer); SetSizer(sizer);
SetAutoLayout(TRUE);
sizer->SetSizeHints(this); sizer->SetSizeHints(this);
sizer->Fit(this); sizer->Fit(this);
Centre(wxBOTH | wxCENTRE_ON_SCREEN); Centre(wxBOTH | wxCENTRE_ON_SCREEN);

View File

@@ -44,7 +44,7 @@ class LifeCanvas : public wxWindow
{ {
public: public:
// ctor and dtor // ctor and dtor
LifeCanvas(wxWindow* parent, Life* life, bool interactive = TRUE); LifeCanvas(wxWindow* parent, Life* life, bool interactive = true);
~LifeCanvas(); ~LifeCanvas();
// view management // view management

View File

@@ -39,7 +39,7 @@ bool MyApp::OnInit(void)
{ {
// Create the main window // Create the main window
#if USE_TABBED_DIALOG #if USE_TABBED_DIALOG
dialog = new MyDialog((wxFrame *) NULL, -1, (char *) "Tabbed Dialog", wxPoint(-1, -1), wxSize(365, 390), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE); dialog = new MyDialog((wxFrame *) NULL, wxID_ANY, (char *) "Tabbed Dialog", wxPoint(-1, -1), wxSize(365, 390));
dialog->ShowModal(); dialog->ShowModal();

View File

@@ -36,7 +36,7 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void) bool MyApp::OnInit(void)
{ {
// Create the main frame window // Create the main frame window
dialog = new MyDialog(NULL, wxID_ANY, wxT("wxTaskBarIcon Test Dialog"), wxDefaultPosition, wxSize(365, 290), wxDIALOG_MODELESS|wxDEFAULT_DIALOG_STYLE); dialog = new MyDialog(NULL, wxID_ANY, wxT("wxTaskBarIcon Test Dialog"), wxDefaultPosition, wxSize(365, 290));
dialog->Show(true); dialog->Show(true);

View File

@@ -171,7 +171,7 @@ void MyFrame::OnToggleBell(wxCommandEvent& event)
MyDialog::MyDialog( wxWindow *parent, const wxString& title, MyDialog::MyDialog( wxWindow *parent, const wxString& title,
const wxPoint& pos, const wxSize& size, const long WXUNUSED(style) ) : const wxPoint& pos, const wxSize& size, const long WXUNUSED(style) ) :
wxDialog(parent, VALIDATE_DIALOG_ID, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxRESIZE_BORDER) wxDialog(parent, VALIDATE_DIALOG_ID, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{ {
// Sizers automatically ensure a workable layout. // Sizers automatically ensure a workable layout.
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );

View File

@@ -144,8 +144,7 @@ void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data) bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
{ {
if ( !wxDialog::Create(parent, -1, wxT("Colour"), if ( !wxDialog::Create(parent, -1, wxT("Colour"),
wxPoint(0, 0), wxSize(900, 900), wxPoint(0, 0), wxSize(900, 900)) )
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL) )
return FALSE; return FALSE;
dialogParent = parent; dialogParent = parent;

View File

@@ -82,8 +82,7 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
long max, long max,
const wxPoint& pos) const wxPoint& pos)
: wxDialog(parent, -1, caption, : wxDialog(parent, -1, caption,
pos, wxDefaultSize, pos, wxDefaultSize)
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL )
{ {
m_value = value; m_value = value;
m_max = max; m_max = max;

View File

@@ -107,7 +107,6 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
: wxDialog(parent, -1, _("Print"), : wxDialog(parent, -1, _("Print"),
wxPoint(0, 0), wxSize(600, 600), wxPoint(0, 0), wxSize(600, 600),
wxDEFAULT_DIALOG_STYLE | wxDEFAULT_DIALOG_STYLE |
wxDIALOG_MODAL |
wxTAB_TRAVERSAL) wxTAB_TRAVERSAL)
{ {
if ( data ) if ( data )
@@ -121,7 +120,6 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
: wxDialog(parent, -1, _("Print"), : wxDialog(parent, -1, _("Print"),
wxPoint(0, 0), wxSize(600, 600), wxPoint(0, 0), wxSize(600, 600),
wxDEFAULT_DIALOG_STYLE | wxDEFAULT_DIALOG_STYLE |
wxDIALOG_MODAL |
wxTAB_TRAVERSAL) wxTAB_TRAVERSAL)
{ {
if ( data ) if ( data )
@@ -133,7 +131,7 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent)) void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
{ {
// wxDialog::Create(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600), // wxDialog::Create(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600),
// wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL | wxTAB_TRAVERSAL); // wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL);
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
@@ -405,7 +403,7 @@ wxDC *wxGenericPrintDialog::GetPrintDC()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data): wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data):
wxDialog(parent, -1, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL) wxDialog(parent, -1, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL)
{ {
Init(data); Init(data);
} }
@@ -598,7 +596,7 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
_("Page Setup"), _("Page Setup"),
wxPoint(0, 0), wxPoint(0, 0),
wxSize(600, 600), wxSize(600, 600),
wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL ) wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL )
{ {
if (data) if (data)
m_pageData = *data; m_pageData = *data;

View File

@@ -144,8 +144,8 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
if ( maximum > 0 ) if ( maximum > 0 )
{ {
// note that we can't use wxGA_SMOOTH because it happens to also mean // note that we can't use wxGA_SMOOTH because it happens to
// wxDIALOG_MODAL and will cause the dialog to be modal. Have an extra // cause the dialog to be modal. Have an extra
// style argument to wxProgressDialog, perhaps. // style argument to wxProgressDialog, perhaps.
m_gauge = new wxGauge(this, -1, m_maximum, m_gauge = new wxGauge(this, -1, m_maximum,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,

View File

@@ -177,12 +177,6 @@ bool wxDialog::IsModal() const
void wxDialog::SetModal( bool WXUNUSED(flag) ) void wxDialog::SetModal( bool WXUNUSED(flag) )
{ {
/*
if (flag)
m_windowStyle |= wxDIALOG_MODAL;
else
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
*/
wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") ); wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") );
} }

View File

@@ -133,7 +133,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
m_needParent = FALSE; m_needParent = FALSE;
if (!PreCreation( parent, pos, wxDefaultSize ) || if (!PreCreation( parent, pos, wxDefaultSize ) ||
!CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, wxT("filedialog") )) !CreateBase( parent, wxID_ANY, pos, wxDefaultSize, style, wxDefaultValidator, wxT("filedialog") ))
{ {
wxFAIL_MSG( wxT("wxXX creation failed") ); wxFAIL_MSG( wxT("wxXX creation failed") );
return; return;

View File

@@ -177,12 +177,6 @@ bool wxDialog::IsModal() const
void wxDialog::SetModal( bool WXUNUSED(flag) ) void wxDialog::SetModal( bool WXUNUSED(flag) )
{ {
/*
if (flag)
m_windowStyle |= wxDIALOG_MODAL;
else
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
*/
wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") ); wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") );
} }

View File

@@ -133,7 +133,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
m_needParent = FALSE; m_needParent = FALSE;
if (!PreCreation( parent, pos, wxDefaultSize ) || if (!PreCreation( parent, pos, wxDefaultSize ) ||
!CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, wxT("filedialog") )) !CreateBase( parent, wxID_ANY, pos, wxDefaultSize, style, wxDefaultValidator, wxT("filedialog") ))
{ {
wxFAIL_MSG( wxT("wxXX creation failed") ); wxFAIL_MSG( wxT("wxXX creation failed") );
return; return;