- Timestamp:
- 01/10/08 06:37:24 (5 years ago)
- Location:
- trunk/src
- Files:
-
- 2 deleted
- 4 edited
-
HighScoreTableDB.cpp (deleted)
-
HighScoreTableDB.h (deleted)
-
MainFrame.cpp (modified) (6 diffs)
-
MainFrame.h (modified) (3 diffs)
-
Makefile.am (modified) (2 diffs)
-
highscores_dialog.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MainFrame.cpp
r165 r166 41 41 #include <cstdlib> 42 42 #include <wx/version.h> 43 #include <wx/filename.h> 43 44 44 45 //include the icon file … … 91 92 m_config = new configuration::Configuration(config_file); 92 93 93 m_highscoredb = new HighScoreTableDB();94 95 94 m_evt_handler = new MainFrameEvtHandler(this); 96 95 97 InitializeDatabase();//this must come _after_ m_settingsdb and m_highscoredb are created98 99 96 //bitmap_dices[0] = new wxBitmap(one_xpm); 100 97 //bitmap_dices[1] = new wxBitmap(two_xpm); … … 1001 998 wxCommandEvent newevent; 1002 999 1003 1004 place = m_highscoredb->IsHighScore(score); 1005 1006 if(!place) //if the score didn't make it to the highscore table do nothing 1007 return; 1000 1001 if(!m_config->isHighscore(score)) { 1002 return; 1003 } 1008 1004 1009 1005 wxString msg; 1010 msg.Printf(wxT("Your score made it to the high score table. Your place is number %i.\nPlease enter your name below:"),place); 1011 1012 wxTextEntryDialog infodialog(this,msg,wxT("Please enter your name"),wxT(""),wxOK | wxCENTRE); 1006 msg.Printf(wxT("Your score made it to the high score table.\nPlease enter your name below:"),place); 1007 1008 wxString last_name = wxString::FromUTF8(m_config->get("last-name").c_str()); 1009 1010 wxTextEntryDialog infodialog(this,msg,wxT("Please enter your name"),last_name ,wxOK | wxCENTRE); 1013 1011 infodialog.ShowModal(); 1014 1012 … … 1017 1015 //get the date 1018 1016 wxDateTime now = wxDateTime::Now(); 1019 date = now.Format ISOTime().mb_str();1020 date += " ";1021 date += now.Format Date().mb_str();1022 1023 m_highscoredb->SendHighScore(name,date,score);1017 date = now.FormatDate().mb_str(); 1018 date += " "; 1019 date += now.FormatISOTime().SubString(0,5).mb_str(); 1020 1021 int rank = m_config->submitHighscore(score, name, date); 1024 1022 1025 1023 //now show the high score table 1026 newevent.SetId(ID_SHOWHIGHSCORE); 1027 newevent.SetEventType(wxEVT_COMMAND_MENU_SELECTED); 1028 ProcessEvent(newevent); 1024 highscores_dialog::HighscoresDialog *dialog = new highscores_dialog::HighscoresDialog(this,m_config,rank); 1025 1026 dialog->ShowModal(); 1027 1028 delete dialog; 1029 1029 1030 1030 } … … 1091 1091 } 1092 1092 1093 1094 ///TODO: delete this function1095 /**1096 * Initializes the database and stores default settings if needed.1097 * @return 0 if some error1098 */1099 int MainFrame::InitializeDatabase()1100 {1101 1102 int highscoresize = atoi((m_config->get("highscore-list-size")).c_str());1103 m_highscoredb->SetSize(highscoresize);1104 1105 return 1;1106 }1107 1093 1108 1094 void MainFrame::Relayout() … … 1350 1336 // free pointers 1351 1337 delete m_config; 1352 delete m_highscoredb;1353 1338 delete m_evt_handler; 1354 1339 } -
trunk/src/MainFrame.h
r164 r166 25 25 */ 26 26 27 #include "HighScoreTableDB.h"28 27 #include "ScoreDice.h" 29 28 #include "dice_graphics.h" … … 88 87 void PostScore(int id); 89 88 void CalculateSubTotal(); 90 int InitializeDatabase();91 89 void Relayout(); 92 90 void AddMenus(); … … 109 107 short int m_rollsundo; //holds the number of remaining rolls for use with the undo option 110 108 111 HighScoreTableDB *m_highscoredb; //handles the highscore database managment112 113 109 bool m_skiproll; ///used to prevent the user from accidently rolling the dice twice 114 110 -
trunk/src/Makefile.am
r165 r166 10 10 highscores_dialog.cpp \ 11 11 highscores_dialog.h \ 12 HighScoreTableDB.cpp \13 12 icon.xpm \ 14 13 icon32.xpm \ … … 50 49 dice_graphics.h \ 51 50 dice_theme_dialog.h \ 52 HighScoreTableDB.h \53 51 Icon.h \ 54 52 icon32.ico \ -
trunk/src/highscores_dialog.cpp
r165 r166 45 45 void HighscoresDialog::createControls() 46 46 { 47 highscoreslist = new wxListCtrl(this,wxID_ANY,wxDefaultPosition,wxSize(400,400),wxLC_REPORT );47 highscoreslist = new wxListCtrl(this,wxID_ANY,wxDefaultPosition,wxSize(400,400),wxLC_REPORT | wxBORDER_SUNKEN ); 48 48 49 49 wxListItem itemCol;
Note: See TracChangeset
for help on using the changeset viewer.
