Changeset 65


Ignore:
Timestamp:
28/03/07 11:36:14 (7 years ago)
Author:
guyru
Message:

clicking on the dice now ticks the "keep" checkbox

Location:
trunk/OpenYahtzee
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/OpenYahtzee/openyahtzee.kdevelop

    r62 r65  
    223223    <custom>false</custom> 
    224224    <bzip>false</bzip> 
    225     <archname></archname> 
     225    <archname/> 
    226226    <appname>OpenYahtzee</appname> 
    227227    <version>1.7</version> 
    228     <release></release> 
     228    <release/> 
    229229    <vendor>Guy Rutenberg</vendor> 
    230230    <licence>GPL</licence> 
    231     <summary></summary> 
    232     <group></group> 
    233     <packager></packager> 
    234     <description></description> 
    235     <changelog></changelog> 
     231    <summary/> 
     232    <group/> 
     233    <packager/> 
     234    <description/> 
     235    <changelog/> 
    236236    <devpackage>false</devpackage> 
    237237    <docspackage>false</docspackage> 
     
    242242    <ftpkde>false</ftpkde> 
    243243    <appskde>false</appskde> 
    244     <url></url> 
     244    <url/> 
    245245  </dist> 
    246246</kdevelop> 
  • trunk/OpenYahtzee/openyahtzee.kdevses

    r62 r65  
    22<!DOCTYPE KDevPrjSession> 
    33<KDevPrjSession> 
    4  <DocsAndViews NumberOfDocuments="16" > 
     4 <DocsAndViews NumberOfDocuments="7" > 
    55  <Doc0 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDB.h" > 
    66   <View0 Type="Source" /> 
     
    1010  </Doc1> 
    1111  <Doc2 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/MainFrame.cpp" > 
    12    <View0 Type="Source" /> 
     12   <View0 line="641" Type="Source" /> 
    1313  </Doc2> 
    1414  <Doc3 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/ObjectsID.h" > 
    15    <View0 Type="Source" /> 
     15   <View0 line="74" Type="Source" /> 
    1616  </Doc3> 
    1717  <Doc4 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/MainFrame.h" > 
    18    <View0 Type="Source" /> 
     18   <View0 line="63" Type="Source" /> 
    1919  </Doc4> 
    20   <Doc5 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/DBwrapper.h" > 
    21    <View0 Type="Source" /> 
     20  <Doc5 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/wxDynamicBitmap.cpp" > 
     21   <View0 line="80" Type="Source" /> 
    2222  </Doc5> 
    23   <Doc6 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreTableDB.cpp" > 
    24    <View0 Type="Source" /> 
     23  <Doc6 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/wxDynamicBitmap.h" > 
     24   <View0 line="52" Type="Source" /> 
    2525  </Doc6> 
    26   <Doc7 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDialog.cpp" > 
    27    <View0 Type="Source" /> 
    28   </Doc7> 
    29   <Doc8 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDB.cpp" > 
    30    <View0 Type="Source" /> 
    31   </Doc8> 
    32   <Doc9 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreTableDB.h" > 
    33    <View0 Type="Source" /> 
    34   </Doc9> 
    35   <Doc10 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreDialog.cpp" > 
    36    <View0 Type="Source" /> 
    37   </Doc10> 
    38   <Doc11 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDialog.h" > 
    39    <View0 Type="Source" /> 
    40   </Doc11> 
    41   <Doc12 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/wxDynamicBitmap.cpp" > 
    42    <View0 Type="Source" /> 
    43   </Doc12> 
    44   <Doc13 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/DBwrapper.cpp" > 
    45    <View0 Type="Source" /> 
    46   </Doc13> 
    47   <Doc14 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/wxDynamicBitmap.h" > 
    48    <View0 Type="Source" /> 
    49   </Doc14> 
    50   <Doc15 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/openyahtzee.rc" > 
    51    <View0 line="0" Type="Source" /> 
    52   </Doc15> 
    5326 </DocsAndViews> 
    5427 <pluginList> 
     
    5730  </kdevdebugger> 
    5831  <kdevbookmarks> 
    59    <bookmarks> 
    60     <bookmark url="/home/guy/workspace/OpenYahtzee/src/MainFrame.cpp" > 
    61      <mark line="108" /> 
    62     </bookmark> 
    63    </bookmarks> 
     32   <bookmarks/> 
    6433  </kdevbookmarks> 
    6534  <kdevvalgrind> 
    6635   <executable path="" params="" /> 
    67    <valgrind path="" params="" /> 
    68    <calltree path="" params="" /> 
    69    <kcachegrind path="" /> 
     36   <valgrind path="/usr/bin/valgrind" params="--tool=memcheck --tool=memcheck --leak-check=yes" /> 
     37   <calltree path="calltree" params="" /> 
     38   <kcachegrind path="kcachegrind" /> 
    7039  </kdevvalgrind> 
    7140 </pluginList> 
  • trunk/OpenYahtzee/src/MainFrame.cpp

    r59 r65  
    3434#include "HighScoreDialog.h" 
    3535#include "SettingsDialog.h" 
     36#include "About.h" 
    3637#include <iostream> 
    3738#include <sstream> 
     
    260261        Connect(ID_YAHTZEE, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MainFrame::OnYahtzeeButton)); 
    261262        Connect(ID_CHANCE, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MainFrame::OnChanceButton)); 
     263        Connect(ID_DICE1,ID_DICE5, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MainFrame::OnDiceClick)); 
    262264         
    263265        /*** End of Event Table ***/ 
     
    276278void MainFrame::OnAbout(wxCommandEvent& event) 
    277279{ 
    278         wxString msg; 
    279         wxString sqliteversion = wxString(sqlite3_version,wxConvUTF8); 
    280         msg.Printf(wxT("Open Yahtzee %s\nCopyright (C) 2006 by Guy Rutenberg.\nDice design by Seamus McGill\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nOpen Yahtzee was built against:\nwxWidgets %i.%i\n"),wxT(OY_VERSION),wxMAJOR_VERSION,wxMINOR_VERSION); 
    281         msg += wxT("SQLite ") + sqliteversion; 
    282                  
    283         wxMessageBox(msg, wxT("About Open Yahtzee"), wxOK | wxICON_INFORMATION, this); 
     280        AboutDialog *about = new AboutDialog(this,wxID_ANY,wxT("About Open Yahtzee")); 
     281        about->ShowModal(); 
    284282} 
    285283 
     
    639637                wxMessageBox(wxT("First you need to roll, and after you roll you may score"), wxT("OpenYahtzee"), wxOK | wxICON_INFORMATION, this); 
    640638 
     639} 
     640 
     641void MainFrame::OnDiceClick (wxCommandEvent& event) 
     642{ 
     643        if (((wxCheckBox*) FindWindow(event.GetId()-ID_DICE1 + ID_DICE1KEEP))->IsEnabled()){ 
     644                bool newvalue = (((wxCheckBox*) FindWindow(event.GetId()-ID_DICE1 + ID_DICE1KEEP))->GetValue())?false:true; 
     645                ((wxCheckBox*) FindWindow(event.GetId()-ID_DICE1 + ID_DICE1KEEP)) -> SetValue(newvalue); 
     646        } 
    641647} 
    642648 
  • trunk/OpenYahtzee/src/MainFrame.h

    r58 r65  
    6262        void OnYahtzeeButton (wxCommandEvent& event); 
    6363        void OnChanceButton (wxCommandEvent& event); 
     64        void OnDiceClick (wxCommandEvent& event); 
    6465 
    6566         
  • trunk/OpenYahtzee/src/Makefile.am

    r47 r65  
    11bin_PROGRAMS = openyahtzee 
    22openyahtzee_SOURCES = openyahtzee.cpp MainFrame.cpp five.xpm four.xpm one.xpm \ 
    3                                         six.xpm three.xpm two.xpm DBwrapper.cpp DBwrapper.h SettingsDB.cpp \ 
    4                                         HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm icon32.xpm \ 
    5                 openyahtzee.rc wxDynamicBitmap.cpp 
     3                                                six.xpm three.xpm two.xpm DBwrapper.cpp DBwrapper.h SettingsDB.cpp \ 
     4                                                HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm icon32.xpm \ 
     5                        openyahtzee.rc wxDynamicBitmap.cpp About.cpp 
    66 
    77# set the include path found by configure 
  • trunk/OpenYahtzee/src/Makefile.in

    r47 r65  
    5555        DBwrapper.$(OBJEXT) SettingsDB.$(OBJEXT) \ 
    5656        HighScoreTableDB.$(OBJEXT) HighScoreDialog.$(OBJEXT) \ 
    57         SettingsDialog.$(OBJEXT) wxDynamicBitmap.$(OBJEXT) 
     57        SettingsDialog.$(OBJEXT) wxDynamicBitmap.$(OBJEXT) \ 
     58        About.$(OBJEXT) 
    5859openyahtzee_OBJECTS = $(am_openyahtzee_OBJECTS) 
    5960openyahtzee_LDADD = $(LDADD) 
     
    185186target_alias = @target_alias@ 
    186187openyahtzee_SOURCES = openyahtzee.cpp MainFrame.cpp five.xpm four.xpm one.xpm \ 
    187                                         six.xpm three.xpm two.xpm DBwrapper.cpp DBwrapper.h SettingsDB.cpp \ 
    188                                         HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm icon32.xpm \ 
    189                 openyahtzee.rc wxDynamicBitmap.cpp 
     188                                                six.xpm three.xpm two.xpm DBwrapper.cpp DBwrapper.h SettingsDB.cpp \ 
     189                                                HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm icon32.xpm \ 
     190                        openyahtzee.rc wxDynamicBitmap.cpp About.cpp 
    190191 
    191192 
     
    270271        -rm -f *.tab.c 
    271272 
     273@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/About.Po@am__quote@ 
    272274@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DBwrapper.Po@am__quote@ 
    273275@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HighScoreDialog.Po@am__quote@ 
  • trunk/OpenYahtzee/src/wxDynamicBitmap.cpp

    r48 r65  
    2222#include "wxDynamicBitmap.h" 
    2323#include <wx/wx.h> 
     24#include "ObjectsID.h" 
    2425 
    2526#include <iostream> 
     
    3233        Connect(id, wxEVT_PAINT, wxPaintEventHandler(wxDynamicBitmap::OnPaint)); 
    3334        SetBitmap( bitmap); 
     35        Connect(id, wxEVT_LEFT_UP,wxMouseEventHandler(wxDynamicBitmap::OnClick)); 
    3436} 
    3537 
     
    7173        return wxSize(m_bitmap.GetHeight(),m_bitmap.GetWidth()); 
    7274} 
     75 
     76void wxDynamicBitmap::OnClick(wxMouseEvent& event) 
     77{ 
     78        //A hack that makes propogates wxEVT_COMMAND_BUTTON_CLICKED events to the parent of this control 
     79        wxCommandEvent newevent( wxEVT_COMMAND_BUTTON_CLICKED, GetId() ); 
     80        newevent.SetEventObject( this ); 
     81        GetEventHandler()->ProcessEvent( newevent ); 
     82} 
  • trunk/OpenYahtzee/src/wxDynamicBitmap.h

    r51 r65  
    4545        wxBitmap GetBitmap(); 
    4646        void OnPaint(wxPaintEvent& event); 
     47        void OnClick(wxMouseEvent& event); 
    4748        wxSize DoGetBestSize() const; 
    4849private: 
Note: See TracChangeset for help on using the changeset viewer.