Changeset 130
- Timestamp:
- 12/22/2007 06:34:13 AM (4 years ago)
- Location:
- trunk/OpenYahtzee/src
- Files:
-
- 2 added
- 6 edited
-
About.cpp (modified) (2 diffs)
-
MainFrame.cpp (modified) (6 diffs)
-
MainFrame.h (modified) (2 diffs)
-
Makefile.am (modified) (2 diffs)
-
dice_graphics.cpp (added)
-
dice_graphics.h (added)
-
wxDynamicBitmap.cpp (modified) (3 diffs)
-
wxDynamicBitmap.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/OpenYahtzee/src/About.cpp
r109 r130 1 1 // $Header: $ 2 2 /*************************************************************************** 3 * Copyright (C) 2006 by Guy Rutenberg *3 * Copyright (C) 2006-2007 by Guy Rutenberg * 4 4 * guyrutenberg@gmail.com * 5 5 * * … … 48 48 notebook_main_pane_about = new wxPanel(notebook_main, -1); 49 49 50 bitmap_1 = new wxDynamicBitmap((wxWindow*)this, (wxWindowID)wxID_ANY, *logo);50 bitmap_1 = new wxDynamicBitmap((wxWindow*)this, (wxWindowID)wxID_ANY,logo); 51 51 #ifdef PORTABLE 52 52 app_label = new wxStaticText(this, -1, wxT("Open Yahtzee Portable Edition 1.8.0")); -
trunk/OpenYahtzee/src/MainFrame.cpp
r128 r130 41 41 #include <wx/version.h> 42 42 43 //include the images for the dice44 #include "one.xpm"45 #include "two.xpm"46 #include "three.xpm"47 #include "four.xpm"48 #include "five.xpm"49 #include "six.xpm"50 51 43 //include the icon file 52 44 #include "Icon.h" … … 85 77 InitializeDatabase();//this must come _after_ m_settingsdb and m_highscoredb are created 86 78 87 bitmap_dices[0] = new wxBitmap(one_xpm);88 bitmap_dices[1] = new wxBitmap(two_xpm);89 bitmap_dices[2] = new wxBitmap(three_xpm);90 bitmap_dices[3] = new wxBitmap(four_xpm);91 bitmap_dices[4] = new wxBitmap(five_xpm);92 bitmap_dices[5] = new wxBitmap(six_xpm);79 //bitmap_dices[0] = new wxBitmap(one_xpm); 80 //bitmap_dices[1] = new wxBitmap(two_xpm); 81 //bitmap_dices[2] = new wxBitmap(three_xpm); 82 //bitmap_dices[3] = new wxBitmap(four_xpm); 83 //bitmap_dices[4] = new wxBitmap(five_xpm); 84 //bitmap_dices[5] = new wxBitmap(six_xpm); 93 85 94 86 //randomize the random-number generator based on the time … … 264 256 //BEGIN layout for the dice section of the score board 265 257 if (m_settings.horizontal_layout) { 258 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE1, 259 m_dice_graphics.GetDice(1)), 0, wxALL, DICE_SPACE); 266 260 diceSizer->Add(new wxDynamicBitmap(panel, 267 ID_DICE 1, *bitmap_dices[0]), 0, wxALL, DICE_SPACE);261 ID_DICE2, m_dice_graphics.GetDice(2)), 0, wxALL, DICE_SPACE); 268 262 diceSizer->Add(new wxDynamicBitmap(panel, 269 ID_DICE 2, *bitmap_dices[1]), 0, wxALL,DICE_SPACE);263 ID_DICE3, m_dice_graphics.GetDice(3)), 0, wxALL,DICE_SPACE); 270 264 diceSizer->Add(new wxDynamicBitmap(panel, 271 ID_DICE 3, *bitmap_dices[2]), 0, wxALL,DICE_SPACE);265 ID_DICE4, m_dice_graphics.GetDice(4)), 0, wxALL,DICE_SPACE); 272 266 diceSizer->Add(new wxDynamicBitmap(panel, 273 ID_DICE4, *bitmap_dices[3]), 0, wxALL,DICE_SPACE); 274 diceSizer->Add(new wxDynamicBitmap(panel, 275 ID_DICE5, *bitmap_dices[4]), 0, wxALL,DICE_SPACE); 267 ID_DICE5, m_dice_graphics.GetDice(5)), 0, wxALL,DICE_SPACE); 276 268 diceSizer->Add(new wxButton(panel, ID_ROLL, wxT("Roll!"), 277 269 wxDefaultPosition, wxSize(64,64)), 0, wxALL,DICE_SPACE); … … 288 280 } else { 289 281 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE1, 290 *bitmap_dices[0]), 0, wxALL, DICE_SPACE);282 m_dice_graphics.GetDice(1)), 0, wxALL, DICE_SPACE); 291 283 diceSizer->Add(new wxCheckBox(panel, ID_DICE1KEEP, 292 284 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 293 285 diceSizer->AddSpacer(VER_DICE_SPACER); 294 286 diceSizer->Add(new wxDynamicBitmap(panel,ID_DICE2, 295 *bitmap_dices[1]), 0, wxALL, DICE_SPACE);287 m_dice_graphics.GetDice(2)), 0, wxALL, DICE_SPACE); 296 288 diceSizer->Add(new wxCheckBox(panel, ID_DICE2KEEP, 297 289 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 298 290 diceSizer->AddSpacer(VER_DICE_SPACER); 299 291 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE3, 300 *bitmap_dices[2]), 0, wxALL, DICE_SPACE);292 m_dice_graphics.GetDice(3)), 0, wxALL, DICE_SPACE); 301 293 diceSizer->Add(new wxCheckBox(panel, ID_DICE3KEEP, 302 294 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 303 295 diceSizer->AddSpacer(VER_DICE_SPACER); 304 296 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE4, 305 *bitmap_dices[3]), 0, wxALL, DICE_SPACE);297 m_dice_graphics.GetDice(4)), 0, wxALL, DICE_SPACE); 306 298 diceSizer->Add(new wxCheckBox(panel, ID_DICE4KEEP, 307 299 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 308 300 diceSizer->AddSpacer(VER_DICE_SPACER); 309 301 diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE5, 310 *bitmap_dices[4]), 0, wxALL, DICE_SPACE);302 m_dice_graphics.GetDice(5)), 0, wxALL, DICE_SPACE); 311 303 diceSizer->Add(new wxCheckBox(panel, ID_DICE5KEEP, 312 304 wxT("Keep")), 0, wxLEFT, KEEP_SPACE); … … 628 620 ((wxDynamicBitmap*) FindWindow(i + 629 621 ID_DICE1)) -> SetBitmap( 630 *bitmap_dices[dice[i]-1]);622 m_dice_graphics.GetDice(dice[i])); 631 623 } 632 624 } … … 638 630 dice[i] = (int)(6.0*rand()/RAND_MAX)+1; 639 631 ((wxDynamicBitmap*) FindWindow(i + ID_DICE1))-> 640 SetBitmap( *bitmap_dices[dice[i]-1]);632 SetBitmap(m_dice_graphics.GetDice(dice[i])); 641 633 } 642 634 } -
trunk/OpenYahtzee/src/MainFrame.h
r127 r130 28 28 #include "HighScoreTableDB.h" 29 29 #include "ScoreDice.h" 30 #include "dice_graphics.h" 30 31 #ifndef MAINFRAME_INC 31 32 #define MAINFRAME_INC … … 101 102 //pointers to hold bitmap data for the dices 102 103 wxBitmap *bitmap_dices[6]; 104 DiceGraphics m_dice_graphics; 103 105 104 106 short int m_rolls; //holds how many rolls left -
trunk/OpenYahtzee/src/Makefile.am
r116 r130 4 4 HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm \ 5 5 icon32.xpm openyahtzee.rc wxDynamicBitmap.cpp About.cpp \ 6 UtilityFunctions.cpp ScoreDice.cpp 6 UtilityFunctions.cpp ScoreDice.cpp dice_graphics.cpp 7 7 8 8 # set the include path found by configure … … 13 13 noinst_HEADERS = MainFrame.h ObjectsID.h SettingsDB.h HighScoreTableDB.h \ 14 14 HighScoreDialog.h SettingsDialog.h Icon.h icon32.ico wxDynamicBitmap.h \ 15 UtilityFunctions.h ScoreDice.h 15 UtilityFunctions.h ScoreDice.h dice_graphics.cpp 16 16 17 17 AM_CXXFLAGS = `wx-config --cxxflags` -
trunk/OpenYahtzee/src/wxDynamicBitmap.cpp
r72 r130 1 1 // $Header$ 2 2 /*************************************************************************** 3 * Copyright (C) 2006 by Guy Rutenberg *3 * Copyright (C) 2006-2007 by Guy Rutenberg * 4 4 * guyrutenberg@gmail.com * 5 5 * * … … 26 26 #include <iostream> 27 27 28 wxDynamicBitmap::wxDynamicBitmap(wxWindow* parent, wxWindowID id, wxBitmap &bitmap,28 wxDynamicBitmap::wxDynamicBitmap(wxWindow* parent, wxWindowID id, wxBitmap *bitmap, 29 29 const wxPoint& pos, const wxSize& size, 30 30 long style, const wxString& name) … … 49 49 } 50 50 51 void wxDynamicBitmap::SetBitmap( wxBitmap &bitmap)51 void wxDynamicBitmap::SetBitmap( wxBitmap *bitmap) 52 52 { 53 m_bitmap = bitmap;53 m_bitmap = *bitmap; 54 54 SetGrayScale(m_grayscale); 55 55 wxWindow::Refresh(); -
trunk/OpenYahtzee/src/wxDynamicBitmap.h
r71 r130 1 1 // $Header$ 2 2 /*************************************************************************** 3 * Copyright (C) 2006 by Guy Rutenberg *3 * Copyright (C) 2006-2007 by Guy Rutenberg * 4 4 * guyrutenberg@gmail.com * 5 5 * * … … 39 39 class wxDynamicBitmap : public wxControl { 40 40 public: 41 wxDynamicBitmap (wxWindow* parent, wxWindowID id, wxBitmap &bitmap,41 wxDynamicBitmap (wxWindow* parent, wxWindowID id, wxBitmap *bitmap, 42 42 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, 43 43 long style = wxNO_BORDER, const wxString& name = wxPanelNameStr); 44 virtual void SetBitmap(wxBitmap &bitmap);44 virtual void SetBitmap(wxBitmap *bitmap); 45 45 wxBitmap GetBitmap(); 46 46 void OnPaint(wxPaintEvent& event);
Note: See TracChangeset
for help on using the changeset viewer.
