Changeset 182 for trunk


Ignore:
Timestamp:
10/23/2008 07:58:28 AM (4 years ago)
Author:
guyru
Message:

about dialog rewrite - part 1

Location:
trunk/src
Files:
2 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/MainFrame.cpp

    r180 r182  
    3131#include "wxDynamicBitmap.h" 
    3232#include "highscores_dialog.h" 
    33 #include "About.h" 
     33#include "about.h" 
    3434#include "configuration.h" 
    3535#include "settings_dialog.h" 
     
    4141#include <wx/filename.h> 
    4242#include <wx/stdpaths.h> 
     43#include <wx/aboutdlg.h> 
     44#include <wx/mstream.h> 
    4345 
    4446 //include the images for the dice        
     
    5355 
    5456#include "icon32.xpm" 
     57#include "openyahtzee_logo.png.h" 
    5558 
    5659//default values - design 
     
    384387void MainFrame::OnAbout(wxCommandEvent& event) 
    385388{ 
     389        wxAboutDialogInfo info; 
     390        info.SetName(wxT(PACKAGE_NAME)); 
     391        info.SetVersion(wxT(PACKAGE_VERSION)); 
     392        info.SetDescription(wxT("A cross-platform Yahtzee game.")); 
     393        info.SetCopyright(wxT("(C) 2006-2008 Guy Rutenberg")); 
     394        info.SetWebSite(wxT("http://www.openyahtzee.org/")); 
     395 
     396        wxMemoryInputStream istream(openyahtzee_logo_png, sizeof openyahtzee_logo_png); 
     397        wxImage myimage_img(istream, wxBITMAP_TYPE_PNG); 
     398 
     399        wxIcon logo; 
     400        logo.CopyFromBitmap(wxBitmap(myimage_img)); 
     401        info.SetIcon(logo); 
     402 
     403        info.AddDeveloper(wxT("Guy Rutenberg <guyrutenberg@gmail.com>")); 
     404        info.AddArtist(wxT("Seamous Mc\nGill <johndoe@gmail.com>")); 
     405 
     406        //wxAboutBox(info); 
    386407#ifdef PORTABLE 
    387         AboutDialog *about = new AboutDialog(this,wxID_ANY,wxT("About Open Yahtzee PE")); 
     408        about::AboutDialog *about = new about::AboutDialog(this); 
    388409#else 
    389         AboutDialog *about = new AboutDialog(this,wxID_ANY,wxT("About Open Yahtzee")); 
     410        about::AboutDialog *about = new about::AboutDialog(this); 
    390411#endif 
    391412        about->ShowModal(); 
  • trunk/src/Makefile.am

    r180 r182  
    11bin_PROGRAMS = openyahtzee 
    22openyahtzee_SOURCES = \ 
    3         About.cpp \ 
     3        about.cpp \ 
     4        about.h \ 
    45        ../config.h \ 
    56        configuration.cpp \ 
     
    3132 
    3233noinst_HEADERS = \ 
    33         About.h \ 
    3434        DBwrapper.h \ 
    3535        openyahtzee.ico \ 
  • trunk/src/about.cpp

    r175 r182  
    11// $Header: $ 
    22/*************************************************************************** 
    3  *   Copyright (C) 2006-2007 by Guy Rutenberg   * 
     3 *   Copyright (C) 2006-2008 by Guy Rutenberg   * 
    44 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
     
    1919 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             * 
    2020 ***************************************************************************/ 
    21 // -*- C++ -*- generated by wxGlade 0.4.1cvs on Tue Feb 27 17:58:29 2007 from /home/guy/about.wgt 
    2221 
    23 #include "About.h" 
     22#include "about.h" 
     23#include <wx/hyperlink.h> 
    2424#include "icon64.xpm" 
     25#include "../config.h" 
    2526 
    26  
    27 AboutDialog::AboutDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): 
    28     wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX) 
     27using namespace about; 
     28AboutDialog::AboutDialog(wxWindow* parent): 
     29    wxDialog(parent, wxID_ANY, wxT("About " PACKAGE_NAME), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE) 
    2930{ 
    30         //wxString temp= wxT(DATA_DIR); 
    31         //temp += wxT("/OpenYahtzee/icon.gif"); 
    32  
    33         //wxBitmap *logo = new wxBitmap(temp, wxBITMAP_TYPE_GIF);  
    34  
    35         //scale logo 
    36         //wxImage tempimage = logo->ConvertToImage(); 
    3731        wxBitmap *logo = new wxBitmap;  
    3832        *logo = wxBitmap(icon64_xpm); 
     
    5044        bitmap_1 = new wxDynamicBitmap((wxWindow*)this, (wxWindowID)wxID_ANY,logo); 
    5145#ifdef PORTABLE 
    52         app_label = new wxStaticText(this, -1, wxT("Open Yahtzee Portable Edition 1.8.0")); 
     46        app_label = new wxStaticText(this, -1, wxT("Open Yahtzee Portable Edition " VERSION)); 
    5347#else    
    54         app_label = new wxStaticText(this, -1, wxT("Open Yahtzee 1.8.0")); 
     48        app_label = new wxStaticText(this, -1, wxT("Open Yahtzee " VERSION)); 
    5549#endif 
    5650        label_desc = new wxStaticText(notebook_main_pane_about, -1, wxT("A full-featured wxWidgets version of\nthe classic dice game Yahtzee.")); 
    57         label_copyright = new wxStaticText(notebook_main_pane_about, -1, wxT("(c) 2006-2007 Guy Rutenberg")); 
    58         label_1 = new wxStaticText(notebook_main_pane_about, -1, wxT("http://openyahtzee.sourceforge.net/")); 
     51        label_copyright = new wxStaticText(notebook_main_pane_about, -1, wxT("(C) 2006-2008 Guy Rutenberg")); 
     52        //label_1 = new wxStaticText(notebook_main_pane_about, -1, wxT("http://openyahtzee.sourceforge.net/")); 
    5953        label_7 = new wxStaticText(notebook_main_pane_authors, -1, wxT("Please report bugs to openyahtzee-users@lists.sourceforge.net.\n\nGuy Rutenberg\n\tguyrutenberg@gmail.com\n\tAuthor, maintainer")); 
    6054        label_6 = new wxStaticText(notebook_main_pane_thanks, -1, wxT("Seamous McGill\n\tjohndoe@gmail.com\n\tLogo and dice design\n\nNeil Gierman\n\tngierman@roadrunn.com\n\tRPM packages")); 
     
    9185    sizer_3->Add(label_desc, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10); 
    9286    sizer_3->Add(label_copyright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10); 
    93     sizer_3->Add(label_1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10); 
     87    //sizer_3->Add(label_1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10); 
     88    sizer_3->Add(new wxHyperlinkCtrl(notebook_main_pane_about,wxID_ANY,OY_URL,OY_URL),0,wxALL|wxALIGN_CENTER_HORIZONTAL,10); 
    9489    notebook_main_pane_about->SetSizer(sizer_3); 
    9590    sizer_4->Add(label_7, 0, wxALL, 10); 
  • trunk/src/about.h

    r84 r182  
    1 // $Header: $ 
    21/*************************************************************************** 
    3  *   Copyright (C) 2006 by Guy Rutenberg   * 
     2 *   Copyright (C) 2006-2008 by Guy Rutenberg   * 
    43 *   guyrutenberg@gmail.com   * 
    54 *                                                                         * 
     
    1918 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             * 
    2019 ***************************************************************************/ 
    21 // -*- C++ -*- generated by wxGlade 0.4.1cvs on Tue Feb 27 17:58:29 2007 from /home/guy/about.wgt 
     20 
     21#ifndef OPENYAHTZEE_ABOUT_INC 
     22#define OPENYAHTZEE_ABOUT_INC 
    2223 
    2324#include <wx/wx.h> 
     
    2526#include "wxDynamicBitmap.h" 
    2627 
    27 // begin wxGlade: ::dependencies 
    2828#include <wx/notebook.h> 
    29 // end wxGlade 
    3029 
    31  
    32 #ifndef ABOUT_H 
    33 #define ABOUT_H 
    34  
     30namespace about { 
    3531 
    3632class AboutDialog: public wxDialog { 
    3733public: 
    38     // begin wxGlade: AboutDialog::ids 
    39     // end wxGlade 
    40  
    41     AboutDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE); 
     34    AboutDialog(wxWindow* parent); 
    4235 
    4336private: 
    44     // begin wxGlade: AboutDialog::methods 
    4537    void set_properties(); 
    4638    void do_layout(); 
    47     // end wxGlade 
    4839 
    4940protected: 
    50     // begin wxGlade: AboutDialog::attributes 
    5141    wxDynamicBitmap* bitmap_1; 
    5242    wxStaticText* app_label; 
     
    6353    wxNotebook* notebook_main; 
    6454    wxButton* close_button; 
    65     // end wxGlade 
    66 }; // wxGlade: end class 
     55}; 
     56 
     57static const wxString OY_URL = wxT("http://www.openyahtzee.org/"); 
     58 
     59} 
    6760 
    6861 
Note: See TracChangeset for help on using the changeset viewer.