X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a21ac1590f2950cdbbe1b423d072f4226c37741..249e30415a58d8cad492f0b46ded8d7ac06fb535:/demos/forty/scoredg.cpp diff --git a/demos/forty/scoredg.cpp b/demos/forty/scoredg.cpp index 8c02afc433..d8344f3eb0 100644 --- a/demos/forty/scoredg.cpp +++ b/demos/forty/scoredg.cpp @@ -9,11 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma implementation -#pragma interface -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -28,7 +23,9 @@ #include "scorefil.h" #include "scoredg.h" -#define USE_GRID_FOR_SCORE 0 +// adjust USE_GRID_FOR_SCORE with O or 1 to your preferences +// by default it takes wxGrid component for score display if available in target port +#define USE_GRID_FOR_SCORE wxUSE_GRID #if USE_GRID_FOR_SCORE #include "wx/grid.h" @@ -177,14 +174,21 @@ ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) : list->EnableDragRowSize(false); list->EnableDragColSize(false); list->EnableDragGridSize(false); + list->ClearSelection(); + list->EnableEditing(false); + sz.x = wxDefaultCoord; #else ScoreCanvas* list = new ScoreCanvas(this, m_scoreFile, wxDefaultPosition, sz); #endif + list->SetBestFittingSize(sz); + // locate and resize with sizers wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); topsizer->Add( list, 1, wxALL|wxGROW, 10 ); - topsizer->Add( new wxButton(this, wxID_OK, _("OK")), 0, wxALIGN_CENTER_HORIZONTAL|wxALL , 10 ); + wxButton *button = new wxButton(this, wxID_OK); + topsizer->Add( button, 0, wxALIGN_CENTER_HORIZONTAL|wxALL , 10 ); + button->SetFocus(); SetSizer( topsizer ); @@ -194,13 +198,9 @@ ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) : CentreOnParent(); } -ScoreDialog::~ScoreDialog() -{ -} - void ScoreDialog::Display() { - Show(true); + ShowModal(); } void ScoreDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))