Changeset 169
- Timestamp:
- 03/10/08 19:55:50 (5 years ago)
- Location:
- trunk/src
- Files:
-
- 5 deleted
- 3 edited
- 6 copied
-
MainFrame.cpp (modified) (10 diffs)
-
MainFrame.h (modified) (3 diffs)
-
Makefile.am (modified) (4 diffs)
-
dice (deleted)
-
dice_graphics.cpp (deleted)
-
dice_graphics.h (deleted)
-
dice_theme_dialog.cpp (deleted)
-
dice_theme_dialog.h (deleted)
-
five.xpm (copied) (copied from trunk/src/dice/theme1/five.xpm)
-
four.xpm (copied) (copied from trunk/src/dice/theme1/four.xpm)
-
one.xpm (copied) (copied from trunk/src/dice/theme1/one.xpm)
-
six.xpm (copied) (copied from trunk/src/dice/theme1/six.xpm)
-
three.xpm (copied) (copied from trunk/src/dice/theme1/three.xpm)
-
two.xpm (copied) (copied from trunk/src/dice/theme1/two.xpm)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MainFrame.cpp
r168 r169 32 32 #include "ObjectsID.h" 33 33 #include "highscores_dialog.h" 34 #include "dice_theme_dialog.h"35 34 #include "About.h" 36 35 #include "UtilityFunctions.h" … … 42 41 #include <wx/version.h> 43 42 #include <wx/filename.h> 43 44 //include the images for the dice 45 namespace dice { 46 #include "one.xpm" 47 #include "two.xpm" 48 #include "three.xpm" 49 #include "four.xpm" 50 #include "five.xpm" 51 #include "six.xpm" 52 } // namespace dice 44 53 45 54 //include the icon file … … 94 103 m_evt_handler = new MainFrameEvtHandler(this); 95 104 96 //bitmap_dices[0] = new wxBitmap(one_xpm);97 //bitmap_dices[1] = new wxBitmap(two_xpm);98 //bitmap_dices[2] = new wxBitmap(three_xpm);99 //bitmap_dices[3] = new wxBitmap(four_xpm);100 //bitmap_dices[4] = new wxBitmap(five_xpm);101 //bitmap_dices[5] = new wxBitmap(six_xpm);105 bitmap_dice[0] = new wxBitmap(dice::one_xpm); 106 bitmap_dice[1] = new wxBitmap(dice::two_xpm); 107 bitmap_dice[2] = new wxBitmap(dice::three_xpm); 108 bitmap_dice[3] = new wxBitmap(dice::four_xpm); 109 bitmap_dice[4] = new wxBitmap(dice::five_xpm); 110 bitmap_dice[5] = new wxBitmap(dice::six_xpm); 102 111 103 112 //randomize the random-number generator based on the time … … 152 161 gameMenu->Append(ID_SHOWHIGHSCORE,wxT("High &Scores"),wxT("Show high-scores table")); 153 162 gameMenu->Append(ID_SETTINGS,wxT("Settings"),wxT("Show settings dialog")); 154 gameMenu->Append(ID_THEMES,wxT("Dice Theme..."),wxT("Select a dice theme"));155 163 gameMenu->Append(wxID_EXIT); 156 164 … … 273 281 if (m_config->get("horizontal-layout")=="True") { 274 282 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE1, 275 m_dice_graphics.GetDice(1)), 0, wxALL, DICE_SPACE);283 bitmap_dice[0]), 0, wxALL, DICE_SPACE); 276 284 diceSizer->Add(new wxDynamicBitmap(panel, 277 ID_DICE2, m_dice_graphics.GetDice(2)), 0, wxALL, DICE_SPACE);285 ID_DICE2, bitmap_dice[1]), 0, wxALL, DICE_SPACE); 278 286 diceSizer->Add(new wxDynamicBitmap(panel, 279 ID_DICE3, m_dice_graphics.GetDice(3)), 0, wxALL,DICE_SPACE);287 ID_DICE3, bitmap_dice[2]), 0, wxALL,DICE_SPACE); 280 288 diceSizer->Add(new wxDynamicBitmap(panel, 281 ID_DICE4, m_dice_graphics.GetDice(4)), 0, wxALL,DICE_SPACE);289 ID_DICE4, bitmap_dice[3]), 0, wxALL,DICE_SPACE); 282 290 diceSizer->Add(new wxDynamicBitmap(panel, 283 ID_DICE5, m_dice_graphics.GetDice(5)), 0, wxALL,DICE_SPACE);291 ID_DICE5, bitmap_dice[4]), 0, wxALL,DICE_SPACE); 284 292 diceSizer->Add(new wxButton(panel, ID_ROLL, wxT("Roll!"), 285 293 wxDefaultPosition, wxSize(64,64)), 0, wxALL,DICE_SPACE); … … 296 304 } else { 297 305 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE1, 298 m_dice_graphics.GetDice(1)), 0, wxALL, DICE_SPACE);306 bitmap_dice[0]), 0, wxALL, DICE_SPACE); 299 307 diceSizer->Add(new wxCheckBox(panel, ID_DICE1KEEP, 300 308 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 301 309 diceSizer->AddSpacer(VER_DICE_SPACER); 302 310 diceSizer->Add(new wxDynamicBitmap(panel,ID_DICE2, 303 m_dice_graphics.GetDice(2)), 0, wxALL, DICE_SPACE);311 bitmap_dice[1]), 0, wxALL, DICE_SPACE); 304 312 diceSizer->Add(new wxCheckBox(panel, ID_DICE2KEEP, 305 313 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 306 314 diceSizer->AddSpacer(VER_DICE_SPACER); 307 315 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE3, 308 m_dice_graphics.GetDice(3)), 0, wxALL, DICE_SPACE);316 bitmap_dice[2]), 0, wxALL, DICE_SPACE); 309 317 diceSizer->Add(new wxCheckBox(panel, ID_DICE3KEEP, 310 318 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 311 319 diceSizer->AddSpacer(VER_DICE_SPACER); 312 320 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE4, 313 m_dice_graphics.GetDice(4)), 0, wxALL, DICE_SPACE);321 bitmap_dice[3]), 0, wxALL, DICE_SPACE); 314 322 diceSizer->Add(new wxCheckBox(panel, ID_DICE4KEEP, 315 323 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 316 324 diceSizer->AddSpacer(VER_DICE_SPACER); 317 325 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE5, 318 m_dice_graphics.GetDice(5)), 0, wxALL, DICE_SPACE);326 bitmap_dice[4]), 0, wxALL, DICE_SPACE); 319 327 diceSizer->Add(new wxCheckBox(panel, ID_DICE5KEEP, 320 328 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); … … 349 357 Connect(ID_SHOWHIGHSCORE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnShowHighscore)); 350 358 Connect(ID_SETTINGS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnSettings)); 351 Connect(ID_THEMES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDiceTheme));352 359 //END connecting the menu items' events 353 360 … … 552 559 553 560 delete settings_dialog; 554 }555 556 /**557 * Shows the dice theme selection dialog. This event-handler is connected to558 * Game->Dice Theme menu item.559 * \param event560 */561 void MainFrame::OnDiceTheme( wxCommandEvent& event)562 {563 DiceThemeDialog *dialog = new DiceThemeDialog(this,wxID_ANY);564 565 if(dialog->ShowModal()!=wxID_OK)566 return;567 568 561 } 569 562 … … 609 602 ((wxDynamicBitmap*) FindWindow(i + 610 603 ID_DICE1)) -> SetBitmap( 611 m_dice_graphics.GetDice(dice[i]));604 bitmap_dice[dice[i]-1]); 612 605 } 613 606 } … … 619 612 dice[i] = (int)(6.0*rand()/RAND_MAX)+1; 620 613 ((wxDynamicBitmap*) FindWindow(i + ID_DICE1))-> 621 SetBitmap( m_dice_graphics.GetDice(dice[i]));614 SetBitmap(bitmap_dice[dice[i]-1]); 622 615 } 623 616 } -
trunk/src/MainFrame.h
r166 r169 26 26 27 27 #include "ScoreDice.h" 28 #include "dice_graphics.h"29 28 #include "configuration.h" 30 29 #ifndef MAINFRAME_INC … … 52 51 void OnShowHighscore (wxCommandEvent& event); 53 52 void OnSettings (wxCommandEvent& event); 54 void OnDiceTheme( wxCommandEvent& event);55 53 void OnCheckForUpdates (wxCommandEvent& event); 56 54 void OnSendComment (wxCommandEvent& event); … … 96 94 97 95 //pointers to hold bitmap data for the dices 98 wxBitmap *bitmap_dices[6]; 99 DiceGraphics m_dice_graphics; 96 wxBitmap *bitmap_dice[6]; 100 97 101 98 short int m_rolls; //holds how many rolls left -
trunk/src/Makefile.am
r166 r169 5 5 configuration.h \ 6 6 DBwrapper.cpp \ 7 dice_graphics.cpp \8 dice_theme_dialog.cpp \9 7 MainFrame.cpp \ 10 8 highscores_dialog.cpp \ … … 17 15 ScoreDice.cpp \ 18 16 UtilityFunctions.cpp \ 19 wxDynamicBitmap.cpp 17 wxDynamicBitmap.cpp \ 18 one.xpm \ 19 two.xpm \ 20 three.xpm \ 21 four.xpm \ 22 five.xpm \ 23 six.xpm 20 24 21 25 # set the include path found by configure … … 24 28 # the library search path. 25 29 26 dice_graphics = \27 dice/theme1/one.xpm \28 dice/theme1/two.xpm \29 dice/theme1/three.xpm \30 dice/theme1/four.xpm \31 dice/theme1/five.xpm \32 dice/theme1/six.xpm \33 dice/theme2/one.xpm \34 dice/theme2/two.xpm \35 dice/theme2/three.xpm \36 dice/theme2/four.xpm \37 dice/theme2/five.xpm \38 dice/theme2/six.xpm \39 dice/theme3/1.xpm \40 dice/theme3/2.xpm \41 dice/theme3/3.xpm \42 dice/theme3/4.xpm \43 dice/theme3/5.xpm \44 dice/theme3/6.xpm45 46 30 noinst_HEADERS = \ 47 31 About.h \ 48 32 DBwrapper.h \ 49 dice_graphics.h \50 dice_theme_dialog.h \51 33 Icon.h \ 52 34 icon32.ico \ … … 55 37 ScoreDice.h \ 56 38 UtilityFunctions.h \ 57 wxDynamicBitmap.h \ 58 $(dice_graphics) 39 wxDynamicBitmap.h 59 40 60 41 AM_CXXFLAGS = `wx-config --cxxflags`
Note: See TracChangeset
for help on using the changeset viewer.
