- Timestamp:
- 18/10/08 11:53:18 (5 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
highscores_dialog.cpp (modified) (4 diffs)
-
highscores_dialog.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/highscores_dialog.cpp
r175 r181 29 29 using namespace highscores_dialog; 30 30 31 const int HIGHSCORELIST_BORDER = 10; 32 31 33 HighscoresDialog::HighscoresDialog(wxWindow* parent,configuration::Configuration* config, int highlight_rank) : 32 wxDialog(parent, wxID_ANY, wxT("Highscores Table"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )34 wxDialog(parent, wxID_ANY, wxT("Highscores Table"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) 33 35 { 34 36 this->highlight_rank = highlight_rank; … … 109 111 wxBoxSizer *top_sizer = new wxBoxSizer( wxVERTICAL ); 110 112 111 top_sizer->Add(highscoreslist, 1, wx ALL, 10);113 top_sizer->Add(highscoreslist, 1, wxEXPAND | wxALL, HIGHSCORELIST_BORDER); 112 114 113 115 wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL ); … … 133 135 Connect(wxID_CLEAR, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(HighscoresDialog::onClear)); 134 136 Connect(ID_CONFIGURE, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(HighscoresDialog::onConfigure)); 137 Connect(this->GetId(), wxEVT_SIZE, wxSizeEventHandler(HighscoresDialog::onResize)); 135 138 } 136 139 void HighscoresDialog::onClose(wxCommandEvent& event) … … 201 204 event.Skip(); 202 205 } 206 207 void HighscoresDialog::onResize(wxSizeEvent &event) { 208 209 const int width = event.GetSize().GetWidth(); 210 const int rank_width = highscoreslist->GetColumnWidth(0); 211 const int score_width = highscoreslist->GetColumnWidth(2); 212 const int date_width = highscoreslist->GetColumnWidth(3); 213 const int new_width = width - 2*HIGHSCORELIST_BORDER - rank_width - score_width - date_width; 214 215 highscoreslist->SetColumnWidth(1,new_width); 216 event.Skip(); 217 } -
trunk/src/highscores_dialog.h
r167 r181 37 37 void onClear(wxCommandEvent& event); 38 38 void onConfigure(wxCommandEvent& event); 39 void onResize(wxSizeEvent& event); 39 40 private: 40 41 void createControls();
Note: See TracChangeset
for help on using the changeset viewer.
