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:
@@ -182,7 +182,7 @@ void MyApp::PropertyListTest(bool useDialog)
|
||||
if (useDialog)
|
||||
{
|
||||
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;
|
||||
}
|
||||
else
|
||||
@@ -230,7 +230,7 @@ void MyApp::PropertyFormTest(bool useDialog)
|
||||
if (useDialog)
|
||||
{
|
||||
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;
|
||||
}
|
||||
else
|
||||
|
@@ -73,7 +73,7 @@ bool MyApp::OnInit(void)
|
||||
file_menu->Append( ID_STORE, _("&Store layouts") );
|
||||
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->Append(MINIMAL_ABOUT, _("A&bout !"));
|
||||
@@ -87,9 +87,9 @@ bool MyApp::OnInit(void)
|
||||
active_menu->Append( ID_RECREATE, _("Re&create") );
|
||||
active_menu->AppendSeparator();
|
||||
|
||||
active_menu->Append( ID_FIRST, _("Activate f&irst layout \tF1"), _("activate it"), TRUE );
|
||||
active_menu->Append( ID_SECOND, _("Activate &second layout\tF2"), _("activate it"), TRUE );
|
||||
active_menu->Append( ID_THIRD, _("Activate &third layout\tF3"), _("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"), wxITEM_CHECK );
|
||||
active_menu->Append( ID_THIRD, _("Activate &third layout\tF3"), _("activate it"), wxITEM_CHECK );
|
||||
|
||||
wxMenuBar *menu_bar = new wxMenuBar;
|
||||
|
||||
@@ -103,11 +103,11 @@ bool MyApp::OnInit(void)
|
||||
frame->SyncMenuBarItems();
|
||||
|
||||
// Show the frame
|
||||
frame->Show(TRUE);
|
||||
frame->Show(true);
|
||||
|
||||
SetTopWindow(frame);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
MyFrame::~MyFrame()
|
||||
@@ -155,25 +155,25 @@ END_EVENT_TABLE()
|
||||
// My frame constructor
|
||||
|
||||
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 ),
|
||||
mpAboutBoxLayout( NULL ),
|
||||
|
||||
mActiveLayoutNo( FIRST_LAYOUT ),
|
||||
mAutoSave( TRUE ),
|
||||
mSavedAlready( FALSE ),
|
||||
mAutoSave( true ),
|
||||
mSavedAlready( false ),
|
||||
mpClntWindow( NULL ),
|
||||
|
||||
mImageList( 16,16, FALSE, 2 )
|
||||
mImageList( 16,16, false, 2 )
|
||||
{
|
||||
int i;
|
||||
|
||||
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,
|
||||
wxSize( 385,220),
|
||||
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL );
|
||||
wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL );
|
||||
|
||||
for( i = 0; i != MAX_LAYOUTS; ++i )
|
||||
mLayouts[i] = NULL;
|
||||
@@ -224,7 +224,7 @@ bool MyFrame::OnClose(void)
|
||||
// USEFUL TRICK:: avoids flickering of application's frame
|
||||
// when closing NN windows on exit:
|
||||
|
||||
this->Show(FALSE);
|
||||
Show(false);
|
||||
|
||||
if ( (mAutoSave && mSavedAlready) || !mAutoSave )
|
||||
{
|
||||
@@ -232,13 +232,13 @@ bool MyFrame::OnClose(void)
|
||||
else
|
||||
{
|
||||
wxCommandEvent evt;
|
||||
this->OnStore(evt);
|
||||
OnStore(evt);
|
||||
}
|
||||
|
||||
mAboutBox.Destroy();
|
||||
this->Destroy();
|
||||
Destroy();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
|
||||
@@ -256,7 +256,7 @@ void MyFrame::OnAutoSave( wxCommandEvent& WXUNUSED(event) )
|
||||
mAutoSave = !mAutoSave;
|
||||
|
||||
wxCommandEvent evt;
|
||||
this->OnStore(evt);
|
||||
OnStore(evt);
|
||||
|
||||
SyncMenuBarItems();
|
||||
}
|
||||
@@ -308,7 +308,7 @@ void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||
// USEFUL TRICK:: avoids flickering of application's frame
|
||||
// when closing NN windows on exit:
|
||||
|
||||
this->Show(FALSE);
|
||||
Show(false);
|
||||
|
||||
if ( (mAutoSave && mSavedAlready) || !mAutoSave )
|
||||
{
|
||||
@@ -316,7 +316,7 @@ void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||
else
|
||||
{
|
||||
wxCommandEvent evt;
|
||||
this->OnStore(evt);
|
||||
OnStore(evt);
|
||||
}
|
||||
|
||||
Destroy();
|
||||
@@ -340,7 +340,7 @@ void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
|
||||
#endif
|
||||
|
||||
mAboutBox.Center( wxBOTH );
|
||||
mAboutBox.Show(TRUE);
|
||||
mAboutBox.Show(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -350,19 +350,19 @@ void MyFrame::OnChar( wxKeyEvent& event )
|
||||
|
||||
if ( event.m_keyCode == WXK_F1 )
|
||||
{
|
||||
this->OnFirst( evt );
|
||||
OnFirst( evt );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( event.m_keyCode == WXK_F2 )
|
||||
{
|
||||
this->OnSecond( evt );
|
||||
OnSecond( evt );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( event.m_keyCode == WXK_F3 )
|
||||
{
|
||||
this->OnThird( evt );
|
||||
OnThird( evt );
|
||||
}
|
||||
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
|
||||
// when closing NN windows on exit:
|
||||
|
||||
this->Show(FALSE);
|
||||
Show(false);
|
||||
|
||||
if ( (mAutoSave && mSavedAlready) || !mAutoSave )
|
||||
{
|
||||
@@ -384,7 +384,7 @@ void MyFrame::OnChar( wxKeyEvent& event )
|
||||
else
|
||||
{
|
||||
wxCommandEvent evt;
|
||||
this->OnStore(evt);
|
||||
OnStore(evt);
|
||||
}
|
||||
|
||||
Destroy();
|
||||
@@ -405,17 +405,17 @@ void MyFrame::OnSayItsOk( wxCommandEvent& WXUNUSED(event) )
|
||||
|
||||
void MyFrame::OnBtnYes( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
mAboutBox.Show(FALSE);
|
||||
mAboutBox.Show(false);
|
||||
}
|
||||
|
||||
void MyFrame::OnBtnNo( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
mAboutBox.Show(FALSE);
|
||||
mAboutBox.Show(false);
|
||||
}
|
||||
|
||||
void MyFrame::OnBtnEsc( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
mAboutBox.Show(FALSE);
|
||||
mAboutBox.Show(false);
|
||||
}
|
||||
|
||||
/*** helper methods ***/
|
||||
@@ -424,25 +424,25 @@ void MyFrame::InitAboutBox()
|
||||
{
|
||||
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) );
|
||||
|
||||
new wxStaticText(pArea, -1, _("Aleksandras Gluchovas (c) 1998"),
|
||||
new wxStaticText(pArea, wxID_ANY, _("Aleksandras Gluchovas (c) 1998"),
|
||||
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) );
|
||||
|
||||
mpAboutBoxLayout = new wxFrameLayout( &mAboutBox, pArea, TRUE );
|
||||
mpAboutBoxLayout = new wxFrameLayout( &mAboutBox, pArea, true );
|
||||
|
||||
wxFrameLayout& layout = *mpAboutBoxLayout;
|
||||
|
||||
cbDimInfo sizes( 90,40, // when docked horizontally
|
||||
45,55, // when docked vertically
|
||||
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 );
|
||||
|
||||
props.mShow3DPaneBorderOn = FALSE;
|
||||
props.mShow3DPaneBorderOn = false;
|
||||
|
||||
layout.SetPaneProperties( props, wxALL_PANES );
|
||||
|
||||
@@ -474,7 +474,7 @@ void MyFrame::InitAboutBox()
|
||||
wxTextCtrl* MyFrame::CreateTxtCtrl( const wxString& txt, wxWindow* parent )
|
||||
{
|
||||
return new wxTextCtrl( (parent != NULL ) ? parent : mpInternalFrm,
|
||||
-1, txt, wxDefaultPosition, wxDefaultSize,
|
||||
wxID_ANY, txt, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_MULTILINE );
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ wxButton* MyFrame::CreateButton( 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);
|
||||
|
||||
@@ -530,7 +530,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
|
||||
cbDimInfo sizes2( 275,38, // when docked horizontally
|
||||
45,275, // when docked vertically
|
||||
80,30, // when floated
|
||||
TRUE, // the bar is fixed-size
|
||||
true, // the bar is fixed-size
|
||||
4, // vertical gap (bar border)
|
||||
4, // horizontal gap (bar border)
|
||||
new cbDynToolBarDimHandler()
|
||||
@@ -539,7 +539,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
|
||||
cbDimInfo sizes3( 275,55, // when docked horizontally
|
||||
275,60, // when docked vertically
|
||||
45,130, // when floated
|
||||
TRUE, // the bar is fixed-size
|
||||
true, // the bar is fixed-size
|
||||
4, // vertical gap (bar border)
|
||||
4, // horizontal gap (bar border)
|
||||
new cbDynToolBarDimHandler()
|
||||
@@ -548,15 +548,15 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
|
||||
cbDimInfo sizes4( 430,35, // when docked horizontally
|
||||
44,375, // when docked vertically
|
||||
80,100, // when floated
|
||||
TRUE, // the bar is fixed-size
|
||||
true, // the bar is fixed-size
|
||||
4, // vertical gap (bar border)
|
||||
4, // horizontal gap (bar border)
|
||||
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( 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( 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( 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 ")) );
|
||||
|
||||
#ifdef __WXMSW__
|
||||
pTBar3->EnableTool( 2, FALSE );
|
||||
pTBar3->EnableTool( 2, false );
|
||||
#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( 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( 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( 3, wxString(wxT(BMP_DIR)) + wxT("prevmark.bmp"), wxBITMAP_TYPE_BMP, wxString(_("Prev bookmark ")), true );
|
||||
//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__
|
||||
pTBar4->EnableTool( 4, FALSE );
|
||||
pTBar4->EnableTool( 4, false );
|
||||
#endif
|
||||
|
||||
layout.AddBar( pTBar2,
|
||||
@@ -596,7 +596,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
|
||||
0,
|
||||
0,
|
||||
wxT("Search"),
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
|
||||
layout.AddBar( pTBar3,
|
||||
@@ -604,7 +604,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
|
||||
0,
|
||||
0,
|
||||
wxT("Titled"),
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
|
||||
layout.AddBar( pTBar4,
|
||||
@@ -612,7 +612,7 @@ void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pPare
|
||||
1,
|
||||
0,
|
||||
wxT("Bookmarks"),
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@@ -642,14 +642,14 @@ wxWindow* MyFrame::CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent )
|
||||
|
||||
cbDimInfo sizes4( cbWidth,cbHeight,
|
||||
cbWidth,cbHeight,
|
||||
cbWidth,cbHeight, FALSE );
|
||||
cbWidth,cbHeight, false );
|
||||
|
||||
cbWidth = 75;
|
||||
cbHeight = 31;
|
||||
|
||||
cbDimInfo sizes5( cbWidth,cbHeight,
|
||||
42,65,
|
||||
cbWidth,cbHeight, TRUE,
|
||||
cbWidth,cbHeight, true,
|
||||
3, // vertical 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
|
||||
// SEB: originally here was a wxpp (wxWorkshop) class demotrated
|
||||
// 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 );
|
||||
|
||||
pClassView->SetImageList( &mImageList );
|
||||
@@ -671,14 +671,14 @@ wxWindow* MyFrame::CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent )
|
||||
pClassView->AppendItem( rootId, _("serializer-classes (grabbed at run-time)"), 0 );
|
||||
|
||||
// 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
|
||||
// wxPaggedWindow* pTabbedArea = new wxPaggedWindow();
|
||||
// pTabbedArea->Create( pParent, -1 );
|
||||
// pTabbedArea->Create( pParent, wxID_ANY );
|
||||
|
||||
wxPanel* pSheet3 = new wxPanel();
|
||||
pSheet3->Create( pTabbedArea, -1 );
|
||||
pSheet3->Show(FALSE);
|
||||
pSheet3->Create( pTabbedArea, wxID_ANY );
|
||||
pSheet3->Show(false);
|
||||
|
||||
pTabbedArea->AddPage( CreateTxtCtrl(wxT("build"), pTabbedArea), wxT("Build"));
|
||||
pTabbedArea->AddPage( CreateTxtCtrl(wxT("debug"), pTabbedArea), wxT("Debug"));
|
||||
@@ -709,35 +709,35 @@ void MyFrame::DropInSomeBars( int layoutNo )
|
||||
cbDimInfo sizes( cbWidth,cbHeight, // when docked horizontally
|
||||
cbWidth,cbHeight, // when docked vertically
|
||||
cbWidth,cbHeight, // when floated
|
||||
TRUE // true - bar is fixed-size
|
||||
true // true - bar is fixed-size
|
||||
);
|
||||
|
||||
cbWidth = 120;
|
||||
|
||||
cbDimInfo sizes1( cbWidth,cbHeight,
|
||||
cbWidth,cbHeight,
|
||||
cbWidth,cbHeight, FALSE ); // false - bar is "flexible"
|
||||
cbWidth,cbHeight, false ); // false - bar is "flexible"
|
||||
|
||||
cbWidth = 120;
|
||||
cbHeight = 40;
|
||||
|
||||
cbDimInfo sizes3( cbWidth,cbHeight,
|
||||
cbWidth,cbHeight,
|
||||
cbWidth,cbHeight, TRUE ); // -/-
|
||||
cbWidth,cbHeight, true ); // -/-
|
||||
|
||||
cbWidth = 200;
|
||||
cbHeight = 150;
|
||||
|
||||
cbDimInfo sizes4( cbWidth,cbHeight,
|
||||
cbWidth,cbHeight,
|
||||
cbWidth,cbHeight, FALSE ); // -/-
|
||||
cbWidth,cbHeight, false ); // -/-
|
||||
|
||||
cbWidth = 63;
|
||||
cbHeight = 31;
|
||||
|
||||
cbDimInfo sizes5( cbWidth,cbHeight,
|
||||
cbHeight,cbWidth,
|
||||
cbWidth,cbHeight, TRUE,
|
||||
cbWidth,cbHeight, true,
|
||||
3, // vertical gap (bar border)
|
||||
3 // horizontal gap (bar border)
|
||||
); // -/-
|
||||
@@ -751,11 +751,11 @@ void MyFrame::DropInSomeBars( int layoutNo )
|
||||
|
||||
pGreenOne->SetBackgroundColour( wxColour(128,255,128) );
|
||||
|
||||
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_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), sizes1, wxCBAR_HIDDEN, 2, 50, wxT("Super-Bar"), 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_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), sizes1, wxCBAR_HIDDEN, 2, 50, wxT("Super-Bar"), true );
|
||||
}
|
||||
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( 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( 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 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( 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("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__)
|
||||
cbCommonPaneProperties 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 );
|
||||
#endif
|
||||
|
||||
@@ -795,7 +795,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
|
||||
cbDimInfo sizes10( 175,35, // when docked horizontally
|
||||
175,38, // when docked vertically
|
||||
170,35, // when floated
|
||||
TRUE, // the bar is not fixed-size
|
||||
true, // the bar is not fixed-size
|
||||
4, // vertical gap (bar border)
|
||||
4, // horizontal gap (bar border)
|
||||
new cbDynToolBarDimHandler()
|
||||
@@ -803,7 +803,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
|
||||
|
||||
wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
|
||||
|
||||
pToolBar->Create( mpInternalFrm, -1 );
|
||||
pToolBar->Create( mpInternalFrm, wxID_ANY );
|
||||
|
||||
// 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, // offset from the start of row (in pixels)
|
||||
wxT("Real-Toolbar"), // name to refere in customization pop-ups
|
||||
FALSE
|
||||
false
|
||||
);
|
||||
|
||||
// create first "developement" layout
|
||||
@@ -832,7 +832,7 @@ void MyFrame::DropInSomeBars( int layoutNo )
|
||||
// the third sheet of the outter one's output bar
|
||||
|
||||
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 );
|
||||
|
||||
@@ -844,7 +844,7 @@ void MyFrame::DropInSomeBars( 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 )
|
||||
{
|
||||
@@ -930,7 +930,7 @@ END_EVENT_TABLE()
|
||||
|
||||
void StartButton95::OnMouseDown( wxMouseEvent& WXUNUSED(event) )
|
||||
{
|
||||
m_bPressed = TRUE;
|
||||
m_bPressed = true;
|
||||
Refresh();
|
||||
CaptureMouse();
|
||||
}
|
||||
|
@@ -1643,7 +1643,7 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
|
||||
|
||||
wxBeginBusyCursor();
|
||||
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;
|
||||
|
||||
|
@@ -6,9 +6,7 @@
|
||||
// Created: 21/07/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1993-1998 Chris Breeze
|
||||
// Licence: wxWindows licence
|
||||
//---------------------------------------------------------------------------
|
||||
// Last modified: 22nd July 1998 - ported to wxWidgets 2.0
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -33,56 +31,54 @@
|
||||
const int ID_LISTBOX = 101;
|
||||
|
||||
BEGIN_EVENT_TABLE(PlayerSelectionDialog, wxDialog)
|
||||
EVT_SIZE(PlayerSelectionDialog::OnSize)
|
||||
EVT_BUTTON(wxID_OK, PlayerSelectionDialog::ButtonCallback)
|
||||
EVT_BUTTON(wxID_CANCEL, PlayerSelectionDialog::ButtonCallback)
|
||||
EVT_LISTBOX(ID_LISTBOX, PlayerSelectionDialog::SelectCallback)
|
||||
EVT_SIZE(PlayerSelectionDialog::OnSize)
|
||||
EVT_BUTTON(wxID_OK, PlayerSelectionDialog::ButtonCallback)
|
||||
EVT_BUTTON(wxID_CANCEL, PlayerSelectionDialog::ButtonCallback)
|
||||
EVT_LISTBOX(ID_LISTBOX, PlayerSelectionDialog::SelectCallback)
|
||||
EVT_CLOSE(PlayerSelectionDialog::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
PlayerSelectionDialog::PlayerSelectionDialog(
|
||||
wxWindow* parent,
|
||||
ScoreFile* file
|
||||
) :
|
||||
wxDialog(parent, wxID_ANY, _T("Player Selection"),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE),
|
||||
m_scoreFile(file)
|
||||
wxWindow* parent,
|
||||
ScoreFile* file
|
||||
) :
|
||||
wxDialog(parent, wxID_ANY, _T("Player Selection"), wxDefaultPosition),
|
||||
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:"));
|
||||
|
||||
wxListBox* list = new wxListBox(
|
||||
this, ID_LISTBOX,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
0, 0,
|
||||
wxLB_SINGLE
|
||||
);
|
||||
wxListBox* list = new wxListBox(
|
||||
this, ID_LISTBOX,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
0, 0,
|
||||
wxLB_SINGLE
|
||||
);
|
||||
|
||||
wxArrayString players;
|
||||
m_scoreFile->GetPlayerList(players);
|
||||
for (unsigned int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
list->Append(players[i]);
|
||||
}
|
||||
wxArrayString players;
|
||||
m_scoreFile->GetPlayerList(players);
|
||||
for (unsigned int i = 0; i < players.Count(); 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_cancel = new wxButton(this, wxID_CANCEL, _T("Cancel"));
|
||||
m_OK = new wxButton(this, wxID_OK, _T("OK"));
|
||||
m_cancel = new wxButton(this, wxID_CANCEL, _T("Cancel"));
|
||||
|
||||
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
button_sizer->Add( m_OK, 0, wxALL, 10 );
|
||||
button_sizer->Add( m_cancel, 0, wxALL, 10 );
|
||||
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
button_sizer->Add( m_OK, 0, wxALL, 10 );
|
||||
button_sizer->Add( m_cancel, 0, wxALL, 10 );
|
||||
|
||||
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
|
||||
topsizer->Add( msg, 0, wxALL , 10 );
|
||||
topsizer->Add( list, 1, wxEXPAND | wxLEFT | wxRIGHT, 10 );
|
||||
topsizer->Add( m_textField, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10 );
|
||||
topsizer->Add( button_sizer, 0, wxALIGN_LEFT );
|
||||
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
|
||||
topsizer->Add( msg, 0, wxALL , 10 );
|
||||
topsizer->Add( list, 1, wxEXPAND | wxLEFT | wxRIGHT, 10 );
|
||||
topsizer->Add( m_textField, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10 );
|
||||
topsizer->Add( button_sizer, 0, wxALIGN_LEFT );
|
||||
|
||||
SetSizer( topsizer );
|
||||
SetSizer( topsizer );
|
||||
|
||||
topsizer->SetSizeHints( this );
|
||||
topsizer->SetSizeHints( this );
|
||||
|
||||
CentreOnParent();
|
||||
}
|
||||
@@ -93,58 +89,58 @@ PlayerSelectionDialog::~PlayerSelectionDialog()
|
||||
|
||||
void PlayerSelectionDialog::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
{
|
||||
Layout();
|
||||
Layout();
|
||||
}
|
||||
|
||||
const wxString& PlayerSelectionDialog::GetPlayersName()
|
||||
{
|
||||
/*
|
||||
m_player = "";
|
||||
Show(true);
|
||||
m_player = wxEmptyString;
|
||||
Show(true);
|
||||
*/
|
||||
return m_player;
|
||||
return m_player;
|
||||
}
|
||||
|
||||
void PlayerSelectionDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
{
|
||||
m_player = _T("");
|
||||
m_player = wxEmptyString;
|
||||
EndModal(wxID_CANCEL);
|
||||
}
|
||||
|
||||
void PlayerSelectionDialog::SelectCallback(wxCommandEvent& event)
|
||||
{
|
||||
if (event.GetEventType() == wxEVT_COMMAND_LISTBOX_SELECTED)
|
||||
{
|
||||
// if (event.IsSelection())
|
||||
m_textField->SetValue(event.GetString());
|
||||
}
|
||||
if (event.GetEventType() == wxEVT_COMMAND_LISTBOX_SELECTED)
|
||||
{
|
||||
// if (event.IsSelection())
|
||||
m_textField->SetValue(event.GetString());
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerSelectionDialog::ButtonCallback(wxCommandEvent& event)
|
||||
{
|
||||
if (event.GetId() == wxID_OK)
|
||||
{
|
||||
wxString name = m_textField->GetValue();
|
||||
if (!name.IsNull() && name.Length() > 0)
|
||||
{
|
||||
if (name.Contains(_T('@')))
|
||||
{
|
||||
wxMessageBox(_T("Names should not contain the '@' character"), _T("Forty Thieves"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_player = name;
|
||||
EndModal(wxID_OK);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMessageBox(_T("Please enter your name"), _T("Forty Thieves"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_player = _T("");
|
||||
EndModal(wxID_CANCEL);
|
||||
}
|
||||
if (event.GetId() == wxID_OK)
|
||||
{
|
||||
wxString name = m_textField->GetValue();
|
||||
if (!name.IsNull() && name.Length() > 0)
|
||||
{
|
||||
if (name.Contains(_T('@')))
|
||||
{
|
||||
wxMessageBox(_T("Names should not contain the '@' character"), _T("Forty Thieves"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_player = name;
|
||||
EndModal(wxID_OK);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMessageBox(_T("Please enter your name"), _T("Forty Thieves"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_player = wxEmptyString;
|
||||
EndModal(wxID_CANCEL);
|
||||
}
|
||||
}
|
||||
|
@@ -6,9 +6,7 @@
|
||||
// Created: 21/07/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1993-1998 Chris Breeze
|
||||
// Licence: wxWindows licence
|
||||
//---------------------------------------------------------------------------
|
||||
// Last modified: 22nd July 1998 - ported to wxWidgets 2.0
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(__APPLE__)
|
||||
@@ -38,49 +36,49 @@
|
||||
class ScoreCanvas : public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile, const wxPoint& pos, wxSize& size);
|
||||
virtual ~ScoreCanvas();
|
||||
ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile, const wxPoint& pos, wxSize& size);
|
||||
virtual ~ScoreCanvas();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnDraw(wxDC& dc);
|
||||
|
||||
private:
|
||||
wxFont* m_font;
|
||||
wxString m_text;
|
||||
wxFont *m_font;
|
||||
wxString m_text;
|
||||
};
|
||||
|
||||
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);
|
||||
#ifdef __WXGTK__
|
||||
m_font = wxTheFontList->FindOrCreateFont(12, wxROMAN, wxNORMAL, wxNORMAL);
|
||||
m_font = wxTheFontList->FindOrCreateFont(12, wxROMAN, wxNORMAL, wxNORMAL);
|
||||
#else
|
||||
m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
#endif
|
||||
|
||||
wxArrayString players;
|
||||
scoreFile->GetPlayerList( players);
|
||||
scoreFile->GetPlayerList( players);
|
||||
|
||||
wxString os;
|
||||
wxString os;
|
||||
|
||||
os << wxT("Player\tWins\tGames\tScore\n");
|
||||
for (unsigned int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
int wins, games, score;
|
||||
scoreFile->ReadPlayersScore(players[i], wins, games, score);
|
||||
int average = 0;
|
||||
if (games > 0)
|
||||
{
|
||||
average = (2 * score + games) / (2 * games);
|
||||
}
|
||||
os << wxT("Player\tWins\tGames\tScore\n");
|
||||
for (unsigned int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
int wins, games, score;
|
||||
scoreFile->ReadPlayersScore(players[i], wins, games, score);
|
||||
int average = 0;
|
||||
if (games > 0)
|
||||
{
|
||||
average = (2 * score + games) / (2 * games);
|
||||
}
|
||||
|
||||
os << players[i] << wxT('\t')
|
||||
<< wins << wxT('\t')
|
||||
<< games << wxT('\t')
|
||||
<< average << wxT('\n');
|
||||
}
|
||||
os << wxT('\0');
|
||||
m_text = os;
|
||||
os << players[i] << wxT('\t')
|
||||
<< wins << wxT('\t')
|
||||
<< games << wxT('\t')
|
||||
<< average << wxT('\n');
|
||||
}
|
||||
os << wxT('\0');
|
||||
m_text = os;
|
||||
}
|
||||
|
||||
ScoreCanvas::~ScoreCanvas()
|
||||
@@ -89,45 +87,45 @@ ScoreCanvas::~ScoreCanvas()
|
||||
|
||||
void ScoreCanvas::OnDraw(wxDC& dc)
|
||||
{
|
||||
dc.SetFont(* m_font);
|
||||
dc.SetFont(* m_font);
|
||||
|
||||
const wxChar* str = m_text;
|
||||
unsigned int tab = 0;
|
||||
unsigned int tabstops[] = { 5, 100, 150, 200 };
|
||||
const wxChar* str = m_text;
|
||||
unsigned int tab = 0;
|
||||
unsigned int tabstops[] = { 5, 100, 150, 200 };
|
||||
|
||||
// get the line spacing for the current font
|
||||
int lineSpacing;
|
||||
{
|
||||
long w, h;
|
||||
dc.GetTextExtent(wxT("Testing"), &w, &h);
|
||||
lineSpacing = (int)h;
|
||||
}
|
||||
// get the line spacing for the current font
|
||||
int lineSpacing;
|
||||
{
|
||||
long w, h;
|
||||
dc.GetTextExtent(wxT("Testing"), &w, &h);
|
||||
lineSpacing = (int)h;
|
||||
}
|
||||
|
||||
int y = 0;
|
||||
while (*str)
|
||||
{
|
||||
wxChar text[256];
|
||||
wxChar* dest = text;
|
||||
int y = 0;
|
||||
while (*str)
|
||||
{
|
||||
wxChar text[256];
|
||||
wxChar* dest = text;
|
||||
|
||||
while (*str && *str >= ' ') *dest++ = *str++;
|
||||
*dest = '\0';
|
||||
while (*str && *str >= ' ') *dest++ = *str++;
|
||||
*dest = '\0';
|
||||
|
||||
dc.DrawText(text, tabstops[tab], y);
|
||||
dc.DrawText(text, tabstops[tab], y);
|
||||
|
||||
if (*str == '\t')
|
||||
{
|
||||
if (tab < sizeof(tabstops) / sizeof(tabstops[0]) - 1)
|
||||
{
|
||||
tab++;
|
||||
}
|
||||
}
|
||||
else if (*str == '\n')
|
||||
{
|
||||
tab = 0;
|
||||
y += lineSpacing;
|
||||
}
|
||||
if (*str) str++;
|
||||
}
|
||||
if (*str == '\t')
|
||||
{
|
||||
if (tab < sizeof(tabstops) / sizeof(tabstops[0]) - 1)
|
||||
{
|
||||
tab++;
|
||||
}
|
||||
}
|
||||
else if (*str == '\n')
|
||||
{
|
||||
tab = 0;
|
||||
y += lineSpacing;
|
||||
}
|
||||
if (*str) str++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -136,31 +134,30 @@ BEGIN_EVENT_TABLE(ScoreDialog, wxDialog)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) :
|
||||
wxDialog(parent, wxID_ANY, _("Scores"),
|
||||
wxDefaultPosition, wxSize(400, 300),
|
||||
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE),
|
||||
m_scoreFile(file)
|
||||
wxDialog(parent, wxID_ANY, _("Scores"),
|
||||
wxDefaultPosition, wxSize(400, 300)),
|
||||
m_scoreFile(file)
|
||||
{
|
||||
// create grid with players
|
||||
wxArrayString players;
|
||||
file->GetPlayerList(players);
|
||||
file->GetPlayerList(players);
|
||||
|
||||
wxSize sz = wxSize(400, 300);
|
||||
|
||||
#if USE_GRID_FOR_SCORE
|
||||
wxGrid* list = new wxGrid(this, wxID_ANY, wxDefaultPosition, sz, 0);
|
||||
wxGrid* list = new wxGrid(this, wxID_ANY, wxDefaultPosition, sz, 0);
|
||||
list->CreateGrid(players.Count(), 4);
|
||||
for (unsigned int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
int wins, games, score;
|
||||
for (unsigned int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
int wins, games, score;
|
||||
wxString string_value;
|
||||
|
||||
file->ReadPlayersScore(players[i], wins, games, score);
|
||||
int average = 0;
|
||||
if (games > 0)
|
||||
{
|
||||
average = (2 * score + games) / (2 * games);
|
||||
}
|
||||
file->ReadPlayersScore(players[i], wins, games, score);
|
||||
int average = 0;
|
||||
if (games > 0)
|
||||
{
|
||||
average = (2 * score + games) / (2 * games);
|
||||
}
|
||||
list->SetCellValue(i,0,players[i]);
|
||||
string_value.Printf( _T("%u"), wins );
|
||||
list->SetCellValue(i,1,string_value);
|
||||
@@ -181,7 +178,7 @@ ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) :
|
||||
list->EnableDragColSize(false);
|
||||
list->EnableDragGridSize(false);
|
||||
#else
|
||||
ScoreCanvas* list = new ScoreCanvas(this, m_scoreFile, wxDefaultPosition, sz);
|
||||
ScoreCanvas* list = new ScoreCanvas(this, m_scoreFile, wxDefaultPosition, sz);
|
||||
#endif
|
||||
|
||||
// locate and resize with sizers
|
||||
@@ -203,7 +200,7 @@ ScoreDialog::~ScoreDialog()
|
||||
|
||||
void ScoreDialog::Display()
|
||||
{
|
||||
Show(true);
|
||||
Show(true);
|
||||
}
|
||||
|
||||
void ScoreDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
|
@@ -6,9 +6,7 @@
|
||||
// Created: 21/07/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1993-1998 Chris Breeze
|
||||
// Licence: wxWindows licence
|
||||
//---------------------------------------------------------------------------
|
||||
// Last modified: 14th May 1998 - ported to wxWidgets 2.0
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -41,65 +39,65 @@
|
||||
ScoreFile::ScoreFile(const wxString& appName)
|
||||
{
|
||||
#if 0
|
||||
wxString filename;
|
||||
m_configFilename << "/usr/local/share/" << appName << ".scores";
|
||||
if (access(m_configFilename, F_OK) == 0)
|
||||
{
|
||||
if (access(m_configFilename, R_OK | W_OK) != 0)
|
||||
{
|
||||
// file is not r/w - use local file instead
|
||||
m_configFilename = wxFileConfig::GetLocalFileName(appName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int fd = creat(m_configFilename, 0666);
|
||||
wxString filename;
|
||||
m_configFilename << "/usr/local/share/" << appName << ".scores";
|
||||
if (access(m_configFilename, F_OK) == 0)
|
||||
{
|
||||
if (access(m_configFilename, R_OK | W_OK) != 0)
|
||||
{
|
||||
// file is not r/w - use local file instead
|
||||
m_configFilename = wxFileConfig::GetLocalFileName(appName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int fd = creat(m_configFilename, 0666);
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
// failed to create file - use local file instead
|
||||
m_configFilename = wxFileConfig::GetLocalFileName(appName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ensure created file has rw-rw-rw permissions
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
if (fd < 0)
|
||||
{
|
||||
// failed to create file - use local file instead
|
||||
m_configFilename = wxFileConfig::GetLocalFileName(appName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ensure created file has rw-rw-rw permissions
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
#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
|
||||
}
|
||||
|
||||
ScoreFile::~ScoreFile()
|
||||
{
|
||||
delete m_config;
|
||||
delete m_config;
|
||||
#ifdef __WXGTK__
|
||||
// ensure score file has rw-rw-rw permissions
|
||||
// (wxFileConfig sets them to rw-------)
|
||||
chmod(m_configFilename, 0666);
|
||||
// ensure score file has rw-rw-rw permissions
|
||||
// (wxFileConfig sets them to rw-------)
|
||||
chmod(m_configFilename, 0666);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void ScoreFile::GetPlayerList( wxArrayString &list )
|
||||
{
|
||||
m_config->SetPath(_T("/Players"));
|
||||
int length = m_config->GetNumberOfGroups();
|
||||
m_config->SetPath(_T("/Players"));
|
||||
int length = m_config->GetNumberOfGroups();
|
||||
|
||||
if (length <= 0) return;
|
||||
if (length <= 0) return;
|
||||
|
||||
wxString player;
|
||||
long index;
|
||||
if (m_config->GetFirstGroup(player, index))
|
||||
{
|
||||
list.Add( player );
|
||||
while (m_config->GetNextGroup(player, index))
|
||||
{
|
||||
list.Add( player );
|
||||
}
|
||||
}
|
||||
wxString player;
|
||||
long index;
|
||||
if (m_config->GetFirstGroup(player, index))
|
||||
{
|
||||
list.Add( player );
|
||||
while (m_config->GetNextGroup(player, index))
|
||||
{
|
||||
list.Add( player );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,73 +109,73 @@ long ScoreFile::CalcCheck(const wxString& name, int p1, int p2, int p3)
|
||||
size_t i, max = name.length();
|
||||
|
||||
for(i = 0; i < max; ++i )
|
||||
{
|
||||
check = (check << 1) ^ (long)name[i];
|
||||
check = ((check >> 23) ^ check) & 0xFFFFFF;
|
||||
}
|
||||
check = (check << 1) ^ (long)p1;
|
||||
check = ((check >> 23) ^ check) & 0xFFFFFF;
|
||||
check = (check << 1) ^ (long)p2;
|
||||
check = ((check >> 23) ^ check) & 0xFFFFFF;
|
||||
check = (check << 1) ^ (long)p3;
|
||||
check = ((check >> 23) ^ check) & 0xFFFFFF;
|
||||
{
|
||||
check = (check << 1) ^ (long)name[i];
|
||||
check = ((check >> 23) ^ check) & 0xFFFFFF;
|
||||
}
|
||||
check = (check << 1) ^ (long)p1;
|
||||
check = ((check >> 23) ^ check) & 0xFFFFFF;
|
||||
check = (check << 1) ^ (long)p2;
|
||||
check = ((check >> 23) ^ check) & 0xFFFFFF;
|
||||
check = (check << 1) ^ (long)p3;
|
||||
check = ((check >> 23) ^ check) & 0xFFFFFF;
|
||||
return check;
|
||||
}
|
||||
|
||||
wxString ScoreFile::GetPreviousPlayer() const
|
||||
{
|
||||
wxString result;
|
||||
m_config->SetPath(_T("/General"));
|
||||
m_config->Read(_T("LastPlayer"), &result);
|
||||
return result;
|
||||
wxString result;
|
||||
m_config->SetPath(_T("/General"));
|
||||
m_config->Read(_T("LastPlayer"), &result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void ScoreFile::ReadPlayersScore(
|
||||
const wxString& player,
|
||||
int& wins,
|
||||
int& games,
|
||||
int& score)
|
||||
const wxString& player,
|
||||
int& wins,
|
||||
int& games,
|
||||
int& score)
|
||||
{
|
||||
long check = 0;
|
||||
long myWins = 0, myGames = 0, myScore = 0;
|
||||
long check = 0;
|
||||
long myWins = 0, myGames = 0, myScore = 0;
|
||||
|
||||
games = wins = score = 0;
|
||||
games = wins = score = 0;
|
||||
|
||||
m_config->SetPath(_T("/Players"));
|
||||
m_config->SetPath(player);
|
||||
if (m_config->Read(_T("Score"), &myScore, 0L) &&
|
||||
m_config->Read(_T("Games"), &myGames, 0L) &&
|
||||
m_config->Read(_T("Wins"), &myWins, 0L) &&
|
||||
m_config->Read(_T("Check"), &check, 0L))
|
||||
{
|
||||
if (check != CalcCheck(player, myGames, myWins, myScore))
|
||||
{
|
||||
wxMessageBox(_T("Score file corrupted"), _T("Warning"),
|
||||
m_config->SetPath(_T("/Players"));
|
||||
m_config->SetPath(player);
|
||||
if (m_config->Read(_T("Score"), &myScore, 0L) &&
|
||||
m_config->Read(_T("Games"), &myGames, 0L) &&
|
||||
m_config->Read(_T("Wins"), &myWins, 0L) &&
|
||||
m_config->Read(_T("Check"), &check, 0L))
|
||||
{
|
||||
if (check != CalcCheck(player, myGames, myWins, myScore))
|
||||
{
|
||||
wxMessageBox(_T("Score file corrupted"), _T("Warning"),
|
||||
wxOK | wxICON_EXCLAMATION);
|
||||
}
|
||||
else
|
||||
{
|
||||
games = myGames;
|
||||
wins = myWins;
|
||||
score = myScore;
|
||||
}
|
||||
}
|
||||
WritePlayersScore(player, wins, games, score);
|
||||
}
|
||||
else
|
||||
{
|
||||
games = myGames;
|
||||
wins = myWins;
|
||||
score = myScore;
|
||||
}
|
||||
}
|
||||
WritePlayersScore(player, wins, games, score);
|
||||
}
|
||||
|
||||
|
||||
void ScoreFile::WritePlayersScore(const wxString& player, int wins, int games, int score)
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
m_config->SetPath(_T("/General"));
|
||||
m_config->Write(_T("LastPlayer"), wxString(player)); // Without wxString tmp, thinks it's bool in VC++
|
||||
{
|
||||
m_config->SetPath(_T("/General"));
|
||||
m_config->Write(_T("LastPlayer"), wxString(player)); // Without wxString tmp, thinks it's bool in VC++
|
||||
|
||||
m_config->SetPath(_T("/Players"));
|
||||
m_config->SetPath(player);
|
||||
m_config->Write(_T("Score"), (long)score);
|
||||
m_config->Write(_T("Games"), (long)games);
|
||||
m_config->Write(_T("Wins"), (long)wins);
|
||||
m_config->Write(_T("Check"), CalcCheck(player, games, wins, score));
|
||||
}
|
||||
m_config->SetPath(_T("/Players"));
|
||||
m_config->SetPath(player);
|
||||
m_config->Write(_T("Score"), (long)score);
|
||||
m_config->Write(_T("Games"), (long)games);
|
||||
m_config->Write(_T("Wins"), (long)wins);
|
||||
m_config->Write(_T("Check"), CalcCheck(player, games, wins, score));
|
||||
}
|
||||
}
|
||||
|
@@ -78,11 +78,8 @@ END_EVENT_TABLE()
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
LifeSamplesDialog::LifeSamplesDialog(wxWindow *parent)
|
||||
: wxDialog(parent, -1,
|
||||
_("Sample games"),
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL)
|
||||
: wxDialog(parent, wxID_ANY, _("Sample games"),
|
||||
wxDefaultPosition, wxDefaultSize)
|
||||
{
|
||||
m_value = 0;
|
||||
|
||||
@@ -97,11 +94,11 @@ LifeSamplesDialog::LifeSamplesDialog(wxWindow *parent)
|
||||
m_list->Append(g_patterns[i].m_name);
|
||||
|
||||
// descriptions
|
||||
wxStaticBox *statbox = new wxStaticBox( this, -1, _("Description"));
|
||||
wxStaticBox *statbox = new wxStaticBox( this, wxID_ANY, _("Description"));
|
||||
m_life = new Life();
|
||||
m_life->SetPattern(g_patterns[0]);
|
||||
m_canvas = new LifeCanvas( this, m_life, FALSE );
|
||||
m_text = new wxTextCtrl( this, -1,
|
||||
m_canvas = new LifeCanvas( this, m_life, false );
|
||||
m_text = new wxTextCtrl( this, wxID_ANY,
|
||||
g_patterns[0].m_description,
|
||||
wxDefaultPosition,
|
||||
wxSize(300, 60),
|
||||
@@ -118,14 +115,13 @@ LifeSamplesDialog::LifeSamplesDialog(wxWindow *parent)
|
||||
|
||||
wxBoxSizer *sizer3 = new wxBoxSizer( wxVERTICAL );
|
||||
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( 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 );
|
||||
|
||||
// activate
|
||||
SetSizer(sizer3);
|
||||
SetAutoLayout(TRUE);
|
||||
sizer3->SetSizeHints(this);
|
||||
sizer3->Fit(this);
|
||||
Centre(wxBOTH | wxCENTRE_ON_SCREEN);
|
||||
@@ -164,35 +160,31 @@ void LifeSamplesDialog::OnListBox(wxCommandEvent& event)
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
LifeAboutDialog::LifeAboutDialog(wxWindow *parent)
|
||||
: wxDialog(parent, -1,
|
||||
_("About Life!"),
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL)
|
||||
: wxDialog(parent, wxID_ANY, _("About Life!"),
|
||||
wxDefaultPosition, wxDefaultSize)
|
||||
{
|
||||
// logo
|
||||
wxBitmap bmp = wxBITMAP(life);
|
||||
#if !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXMAC__)
|
||||
bmp.SetMask(new wxMask(bmp, *wxBLUE));
|
||||
#endif
|
||||
wxStaticBitmap *sbmp = new wxStaticBitmap(this, -1, bmp);
|
||||
wxStaticBitmap *sbmp = new wxStaticBitmap(this, wxID_ANY, bmp);
|
||||
|
||||
// layout components
|
||||
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
|
||||
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\
|
||||
(c) 2000 Guillermo Rodriguez Garcia\n\n\
|
||||
<guille@iies.es>\n\n\
|
||||
Portions of the code are based in XLife;\n\
|
||||
XLife is (c) 1989 by Jon Bennett et al.")),
|
||||
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 );
|
||||
|
||||
// activate
|
||||
SetSizer(sizer);
|
||||
SetAutoLayout(TRUE);
|
||||
sizer->SetSizeHints(this);
|
||||
sizer->Fit(this);
|
||||
Centre(wxBOTH | wxCENTRE_ON_SCREEN);
|
||||
|
@@ -44,7 +44,7 @@ class LifeCanvas : public wxWindow
|
||||
{
|
||||
public:
|
||||
// ctor and dtor
|
||||
LifeCanvas(wxWindow* parent, Life* life, bool interactive = TRUE);
|
||||
LifeCanvas(wxWindow* parent, Life* life, bool interactive = true);
|
||||
~LifeCanvas();
|
||||
|
||||
// view management
|
||||
|
@@ -39,7 +39,7 @@ bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main window
|
||||
#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();
|
||||
|
||||
|
@@ -36,7 +36,7 @@ IMPLEMENT_APP(MyApp)
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// 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);
|
||||
|
||||
|
@@ -171,7 +171,7 @@ void MyFrame::OnToggleBell(wxCommandEvent& event)
|
||||
|
||||
MyDialog::MyDialog( wxWindow *parent, const wxString& title,
|
||||
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.
|
||||
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
@@ -144,8 +144,7 @@ void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
|
||||
{
|
||||
if ( !wxDialog::Create(parent, -1, wxT("Colour"),
|
||||
wxPoint(0, 0), wxSize(900, 900),
|
||||
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL) )
|
||||
wxPoint(0, 0), wxSize(900, 900)) )
|
||||
return FALSE;
|
||||
|
||||
dialogParent = parent;
|
||||
|
@@ -82,8 +82,7 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
|
||||
long max,
|
||||
const wxPoint& pos)
|
||||
: wxDialog(parent, -1, caption,
|
||||
pos, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL )
|
||||
pos, wxDefaultSize)
|
||||
{
|
||||
m_value = value;
|
||||
m_max = max;
|
||||
|
@@ -107,7 +107,6 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
|
||||
: wxDialog(parent, -1, _("Print"),
|
||||
wxPoint(0, 0), wxSize(600, 600),
|
||||
wxDEFAULT_DIALOG_STYLE |
|
||||
wxDIALOG_MODAL |
|
||||
wxTAB_TRAVERSAL)
|
||||
{
|
||||
if ( data )
|
||||
@@ -121,7 +120,6 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
|
||||
: wxDialog(parent, -1, _("Print"),
|
||||
wxPoint(0, 0), wxSize(600, 600),
|
||||
wxDEFAULT_DIALOG_STYLE |
|
||||
wxDIALOG_MODAL |
|
||||
wxTAB_TRAVERSAL)
|
||||
{
|
||||
if ( data )
|
||||
@@ -133,7 +131,7 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
|
||||
void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
|
||||
{
|
||||
// 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 );
|
||||
|
||||
@@ -405,7 +403,7 @@ wxDC *wxGenericPrintDialog::GetPrintDC()
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -598,7 +596,7 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
|
||||
_("Page Setup"),
|
||||
wxPoint(0, 0),
|
||||
wxSize(600, 600),
|
||||
wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL )
|
||||
wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL )
|
||||
{
|
||||
if (data)
|
||||
m_pageData = *data;
|
||||
|
@@ -144,8 +144,8 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
||||
|
||||
if ( maximum > 0 )
|
||||
{
|
||||
// note that we can't use wxGA_SMOOTH because it happens to also mean
|
||||
// wxDIALOG_MODAL and will cause the dialog to be modal. Have an extra
|
||||
// note that we can't use wxGA_SMOOTH because it happens to
|
||||
// cause the dialog to be modal. Have an extra
|
||||
// style argument to wxProgressDialog, perhaps.
|
||||
m_gauge = new wxGauge(this, -1, m_maximum,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
|
@@ -177,12 +177,6 @@ bool wxDialog::IsModal() const
|
||||
|
||||
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") );
|
||||
}
|
||||
|
||||
|
@@ -133,7 +133,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
|
||||
m_needParent = FALSE;
|
||||
|
||||
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") );
|
||||
return;
|
||||
|
@@ -177,12 +177,6 @@ bool wxDialog::IsModal() const
|
||||
|
||||
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") );
|
||||
}
|
||||
|
||||
|
@@ -133,7 +133,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
|
||||
m_needParent = FALSE;
|
||||
|
||||
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") );
|
||||
return;
|
||||
|
Reference in New Issue
Block a user