Changeset 175


Ignore:
Timestamp:
10/05/2008 08:03:25 PM (4 years ago)
Author:
guyru
Message:

add resource file, fix score hint shade under Windows

Location:
trunk
Files:
4 added
2 deleted
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/About.cpp

    r130 r175  
    2222 
    2323#include "About.h" 
    24 #include "icon.xpm" 
     24#include "icon64.xpm" 
    2525 
    2626 
     
    3636        //wxImage tempimage = logo->ConvertToImage(); 
    3737        wxBitmap *logo = new wxBitmap;  
    38         *logo = wxBitmap(icon_xpm); 
     38        *logo = wxBitmap(icon64_xpm); 
    3939         
    4040        notebook_main = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, 0); 
  • trunk/src/MainFrame.cpp

    r174 r175  
    5252 } // namespace dice 
    5353 
    54 //include the icon file 
    55 #include "Icon.h" 
     54#include "icon32.xpm" 
    5655 
    5756//default values - design 
     
    7574{ 
    7675        //give the frame an icon 
    77         SetIcon(wxIcon(ICON)); 
     76        SetIcon(wxIcon(icon32_xpm)); 
    7877 
    7978        /* Check if there is configuration file under old-name and 
     
    674673         
    675674                out.Printf(wxT("%i"),temp); 
    676                 ((wxTextCtrl*) FindWindow(event.GetId() - ID_ACES + ID_ACESTEXT))->SetValue(out); 
    677                 ((wxTextCtrl*) FindWindow(event.GetId() - ID_ACES + ID_ACESTEXT))->SetBackgroundColour(*wxWHITE); 
     675                wxTextCtrl *text_ctrl = dynamic_cast<wxTextCtrl*>(FindWindow(event.GetId() - ID_ACES + ID_ACESTEXT)); 
     676                text_ctrl->SetValue(out); 
     677                text_ctrl->SetBackgroundColour(*wxWHITE); 
     678                text_ctrl->Refresh(); 
    678679                 
    679680                PostScore(event.GetId()); 
     
    697698         
    698699        out.Printf(wxT("%i"),m_score_dice.ThreeOfAKind()); 
    699         ((wxTextCtrl*) FindWindow(ID_THREEOFAKINDTEXT))->SetValue(out); 
    700         ((wxTextCtrl*) FindWindow(ID_THREEOFAKINDTEXT))->SetBackgroundColour(*wxWHITE); 
     700        wxTextCtrl *text_ctrl = dynamic_cast<wxTextCtrl*>(FindWindow(ID_THREEOFAKINDTEXT)); 
     701        text_ctrl->SetValue(out); 
     702        text_ctrl->SetBackgroundColour(*wxWHITE); 
     703        text_ctrl->Refresh(); 
    701704         
    702705        PostScore(event.GetId()); 
     
    717720 
    718721        out.Printf(wxT("%i"),m_score_dice.FourOfAKind()); 
    719         ((wxTextCtrl*) FindWindow(ID_FOUROFAKINDTEXT))->SetValue(out); 
    720         ((wxTextCtrl*) FindWindow(ID_FOUROFAKINDTEXT))->SetBackgroundColour(*wxWHITE); 
     722        wxTextCtrl *text_ctrl = dynamic_cast<wxTextCtrl*>(FindWindow(ID_FOUROFAKINDTEXT)); 
     723        text_ctrl->SetValue(out); 
     724        text_ctrl->SetBackgroundColour(*wxWHITE); 
     725        text_ctrl->Refresh(); 
    721726         
    722727        PostScore(event.GetId()); 
     
    738743 
    739744        out.Printf(wxT("%i"), m_score_dice.FullHouse()); 
    740         ((wxTextCtrl*) FindWindow(ID_FULLHOUSETEXT))->SetValue(out); 
    741         ((wxTextCtrl*) FindWindow(ID_FULLHOUSETEXT))->SetBackgroundColour(*wxWHITE); 
     745        wxTextCtrl *text_ctrl = dynamic_cast<wxTextCtrl*>(FindWindow(ID_FULLHOUSETEXT)); 
     746        text_ctrl->SetValue(out); 
     747        text_ctrl->SetBackgroundColour(*wxWHITE); 
     748        text_ctrl->Refresh(); 
    742749         
    743750        PostScore(event.GetId()); 
     
    760767         
    761768        out.Printf(wxT("%i"), m_score_dice.SmallSequence()); 
    762         ((wxTextCtrl*) FindWindow(ID_SMALLSEQUENCETEXT))->SetValue(out); 
    763         ((wxTextCtrl*) FindWindow(ID_SMALLSEQUENCETEXT))->SetBackgroundColour(*wxWHITE); 
     769        wxTextCtrl *text_ctrl = dynamic_cast<wxTextCtrl*>(FindWindow(ID_SMALLSEQUENCETEXT)); 
     770        text_ctrl->SetValue(out); 
     771        text_ctrl->SetBackgroundColour(*wxWHITE); 
     772        text_ctrl->Refresh(); 
    764773         
    765774        PostScore(event.GetId()); 
     
    782791 
    783792        out.Printf(wxT("%i"), m_score_dice.LargeSequence()); 
    784         ((wxTextCtrl*) FindWindow(ID_LARGESEQUENCETEXT))->SetValue(out); 
    785         ((wxTextCtrl*) FindWindow(ID_LARGESEQUENCETEXT))->SetBackgroundColour(*wxWHITE); 
     793        wxTextCtrl *text_ctrl = dynamic_cast<wxTextCtrl*>(FindWindow(ID_LARGESEQUENCETEXT)); 
     794        text_ctrl->SetValue(out); 
     795        text_ctrl->SetBackgroundColour(*wxWHITE); 
     796        text_ctrl->Refresh(); 
     797 
    786798         
    787799        PostScore(event.GetId()); 
     
    803815        if (m_score_dice.IsYahtzee()) m_yahtzee = true; 
    804816        out.Printf(wxT("%i"), m_score_dice.Yahtzee()); 
    805         ((wxTextCtrl*) FindWindow(ID_YAHTZEETEXT))->SetValue(out); 
    806         ((wxTextCtrl*) FindWindow(ID_YAHTZEETEXT))->SetBackgroundColour(*wxWHITE); 
     817        wxTextCtrl *text_ctrl = dynamic_cast<wxTextCtrl*>(FindWindow(ID_YAHTZEETEXT)); 
     818        text_ctrl->SetValue(out); 
     819        text_ctrl->SetBackgroundColour(*wxWHITE); 
     820        text_ctrl->Refresh(); 
    807821 
    808822        PostScore(event.GetId()); 
     
    821835         
    822836                out.Printf(wxT("%i"),m_score_dice.Chance()); 
    823                 ((wxTextCtrl*) FindWindow(ID_CHANCETEXT))->SetValue(out); 
    824                 ((wxTextCtrl*) FindWindow(ID_CHANCETEXT))->SetBackgroundColour(*wxWHITE); 
    825                  
     837                wxTextCtrl *text_ctrl = dynamic_cast<wxTextCtrl*>(FindWindow(ID_CHANCETEXT)); 
     838                text_ctrl->SetValue(out); 
     839                text_ctrl->SetBackgroundColour(*wxWHITE); 
     840                text_ctrl->Refresh(); 
    826841                PostScore(event.GetId()); 
    827842        } 
     
    981996void MainFrame::HighScoreHandler(int score) 
    982997{ 
    983         int place; 
    984998        std::string name,date; 
    985999        wxCommandEvent newevent; 
     
    9901004        } 
    9911005         
    992         wxString msg; 
    993         msg.Printf(wxT("Your score made it to the high score table.\nPlease enter your name below:"),place); 
     1006        wxString msg = wxT("Your score made it to the high score table.\nPlease enter your name below:"); 
    9941007 
    9951008        wxString last_name = wxString::FromUTF8(m_config->get("last-name").c_str()); 
  • trunk/src/Makefile.am

    r174 r175  
    99        highscores_dialog.cpp \ 
    1010        highscores_dialog.h \ 
    11         icon.xpm \ 
    1211        icon32.xpm \ 
     12        icon64.xpm \ 
    1313        openyahtzee.cpp \ 
    1414        settings_dialog.cpp \ 
     
    3333        About.h \ 
    3434        DBwrapper.h \ 
    35         Icon.h \ 
    36         icon32.ico \ 
     35        openyahtzee.ico \ 
    3736        MainFrame.h \ 
    3837        ObjectsID.h \ 
     
    4039        wxDynamicBitmap.h \ 
    4140        ../openyahtzee.vcproj \ 
    42         ../openyahtzee.sln 
     41        ../openyahtzee.sln \ 
     42        openyahtzee.ico \ 
     43        openyahtzee.rc 
    4344 
    4445AM_CXXFLAGS = `wx-config --cxxflags` 
  • trunk/src/highscores_dialog.cpp

    r174 r175  
    2424#include "highscores_dialog.h" 
    2525 
    26 #include "Icon.h" 
     26#include "icon32.xpm" 
    2727 
    2828using namespace std; 
     
    3535        m_config = config; 
    3636 
    37         SetIcon(wxIcon(ICON)); 
     37        SetIcon(wxIcon(icon32_xpm)); 
    3838 
    3939        createControls(); 
  • trunk/src/icon64.xpm

    r60 r175  
    11/* XPM */ 
    2 static char *icon_xpm[] = { 
     2static char *icon64_xpm[] = { 
    33/* columns rows colors chars-per-pixel */ 
    44"64 64 256 2", 
  • trunk/src/settings_dialog.cpp

    r174 r175  
    2020 
    2121#include "settings_dialog.h" 
    22 #include "Icon.h" 
     22#include "icon32.xpm" 
    2323 
    2424using namespace settings_dialog; 
     
    2828{ 
    2929 
    30         SetIcon(wxIcon(ICON)); 
     30        SetIcon(wxIcon(icon32_xpm)); 
    3131 
    3232        m_config = config; 
Note: See TracChangeset for help on using the changeset viewer.