Legend:
- Unmodified
- Added
- Removed
-
trunk/src/about.cpp
r182 r183 27 27 using namespace about; 28 28 AboutDialog::AboutDialog(wxWindow* parent): 29 wxDialog(parent, wxID_ANY, wxT("About " PACKAGE_NAME), wxDefaultPosition, wx DefaultSize, wxDEFAULT_DIALOG_STYLE)29 wxDialog(parent, wxID_ANY, wxT("About " PACKAGE_NAME), wxDefaultPosition, wxSize(-1,300), wxDEFAULT_DIALOG_STYLE) 30 30 { 31 wxBitmap *logo = new wxBitmap; 32 *logo = wxBitmap(icon64_xpm); 33 34 notebook_main = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, 0); 35 36 notebook_main_pane_license = new wxScrolledWindow(notebook_main, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); 37 38 notebook_main_pane_thanks = new wxScrolledWindow(notebook_main, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); 39 40 notebook_main_pane_authors = new wxScrolledWindow(notebook_main, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); 41 42 notebook_main_pane_about = new wxPanel(notebook_main, -1); 43 44 bitmap_1 = new wxDynamicBitmap((wxWindow*)this, (wxWindowID)wxID_ANY,logo); 45 #ifdef PORTABLE 46 app_label = new wxStaticText(this, -1, wxT("Open Yahtzee Portable Edition " VERSION)); 47 #else 48 app_label = new wxStaticText(this, -1, wxT("Open Yahtzee " VERSION)); 49 #endif 50 label_desc = new wxStaticText(notebook_main_pane_about, -1, wxT("A full-featured wxWidgets version of\nthe classic dice game Yahtzee.")); 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/")); 53 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")); 54 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")); 55 label_15 = new wxStaticText(notebook_main_pane_license, -1, wxT("This program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by \nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of \nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details. \n\nYou should have received a copy of the GNU General Public License \nalong with this program; if not, write to the\nFree Software Foundation, Inc.,\n59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.")); 56 close_button = new wxButton(this, wxID_OK, wxT("Close")); 57 58 set_properties(); 59 do_layout(); 31 addControlsAndLayout(); 32 SetEscapeId(wxID_CLOSE); 60 33 } 61 34 35 void AboutDialog::addControlsAndLayout() 36 { 37 wxBoxSizer* title_sizer = new wxBoxSizer(wxHORIZONTAL); 38 wxStaticBitmap* logo = new wxStaticBitmap(this, wxID_ANY,wxBitmap(icon64_xpm)); 39 title_sizer->Add(logo, 0, wxALL|wxALIGN_CENTER_VERTICAL, 10); 62 40 63 void AboutDialog::set_properties() 64 { 65 SetSize(wxSize(400, 300)); 66 app_label->SetFont(wxFont(14, wxDEFAULT, wxNORMAL, wxBOLD, 0, wxT(""))); 67 notebook_main_pane_authors->SetScrollRate(10, 10); 68 notebook_main_pane_thanks->SetScrollRate(10, 10); 69 notebook_main_pane_license->SetScrollRate(10, 10); 41 wxStaticText* app_label = new wxStaticText(this,wxID_ANY,wxT("Open Yahtzee " VERSION)); 42 app_label->SetFont(wxFont(14, wxDEFAULT, wxNORMAL, wxBOLD, false)); 43 title_sizer->Add(app_label, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxADJUST_MINSIZE, 10); 44 45 wxNotebook* notebook_main = new wxNotebook(this, wxID_ANY); 46 notebookAboutTab(notebook_main); 47 notebookAuthorTab(notebook_main); 48 notebookThanksTab(notebook_main); 49 notebookLicenseTab(notebook_main); 50 51 wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL); 52 top_sizer->Add(title_sizer); 53 top_sizer->Add(notebook_main, 1, wxEXPAND, 0); 54 top_sizer->Add(new wxButton(this,wxID_CLOSE), 0, wxALL|wxALIGN_RIGHT, 10); 55 56 SetSizer(top_sizer); 57 Layout(); 70 58 } 71 59 60 void AboutDialog::notebookAboutTab(wxNotebook *notebook) 61 { 62 wxPanel* panel = new wxPanel(notebook, wxID_ANY); 63 wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); 72 64 73 void AboutDialog::do_layout() 74 { 75 // begin wxGlade: AboutDialog::do_layout 76 wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL); 77 wxBoxSizer* sizer_6 = new wxBoxSizer(wxVERTICAL); 78 wxBoxSizer* sizer_5 = new wxBoxSizer(wxHORIZONTAL); 79 wxBoxSizer* sizer_4 = new wxBoxSizer(wxVERTICAL); 80 wxBoxSizer* sizer_3 = new wxBoxSizer(wxVERTICAL); 81 wxBoxSizer* sizer_2 = new wxBoxSizer(wxHORIZONTAL); 82 sizer_2->Add(bitmap_1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 10); 83 sizer_2->Add(app_label, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxADJUST_MINSIZE, 10); 84 sizer_1->Add(sizer_2, 0, 0, 0); 85 sizer_3->Add(label_desc, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10); 86 sizer_3->Add(label_copyright, 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); 89 notebook_main_pane_about->SetSizer(sizer_3); 90 sizer_4->Add(label_7, 0, wxALL, 10); 91 notebook_main_pane_authors->SetSizer(sizer_4); 92 sizer_5->Add(label_6, 0, wxALL, 10); 93 notebook_main_pane_thanks->SetSizer(sizer_5); 94 sizer_6->Add(label_15, 0, wxADJUST_MINSIZE, 0); 95 notebook_main_pane_license->SetSizer(sizer_6); 96 notebook_main->AddPage(notebook_main_pane_about, wxT("About")); 97 notebook_main->AddPage(notebook_main_pane_authors, wxT("Authors")); 98 notebook_main->AddPage(notebook_main_pane_thanks, wxT("Thanks To")); 99 notebook_main->AddPage(notebook_main_pane_license, wxT("License Agreement")); 100 sizer_1->Add(notebook_main, 1, wxEXPAND, 0); 101 sizer_1->Add(close_button, 0, wxALL|wxALIGN_RIGHT, 10); 102 SetSizer(sizer_1); 103 Layout(); 104 // end wxGlade 65 wxStaticText* label_desc = new wxStaticText(panel, wxID_ANY, wxT("A full-featured wxWidgets version of\nthe classic dice game Yahtzee.")); 66 sizer->Add(label_desc, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10); 67 68 wxStaticText* label_copyright = new wxStaticText(panel, wxID_ANY, wxT("(C) 2006-2008 Guy Rutenberg")); 69 sizer->Add(label_copyright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10); 70 71 sizer->Add(new wxHyperlinkCtrl(panel,wxID_ANY,OY_URL,OY_URL),0,wxALL|wxALIGN_CENTER_HORIZONTAL,10); 72 73 panel->SetSizer(sizer); 74 75 notebook->AddPage(panel, wxT("About")); 105 76 } 106 77 78 void AboutDialog::notebookAuthorTab(wxNotebook *notebook) 79 { 80 wxTextCtrl* text = new wxTextCtrl(notebook, wxID_ANY,wxT(""),wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE|wxTE_READONLY); 81 *text << wxT("Guy Rutenberg <guyrutenberg@gmail.com>\n"); 82 83 notebook->AddPage(text, wxT("Author")); 84 } 85 86 void AboutDialog::notebookThanksTab(wxNotebook *notebook) 87 { 88 wxTextCtrl* text = new wxTextCtrl(notebook, wxID_ANY,wxT(""),wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE|wxTE_READONLY); 89 *text << wxT("Seamous McGill <johndoe@ggmail.com>\n"); 90 *text << wxT(" Logo and dice design\n\n"); 91 92 *text << wxT("Neil Gierman <ngierman@roadrunn.com>\n"); 93 *text << wxT(" Help with RPM packages\n\n"); 94 95 notebook->AddPage(text, wxT("Thanks To")); 96 } 97 98 void AboutDialog::notebookLicenseTab(wxNotebook *notebook) 99 { 100 wxTextCtrl* text = new wxTextCtrl(notebook, wxID_ANY,wxT(""),wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE|wxTE_READONLY); 101 *text << wxT("This program is free software; you can redistribute " 102 "it and/or modify it under the terms of the GNU General " 103 "Public License as published by the Free Software " 104 "Foundation; either version 2 of the License, or (at your " 105 "option) any later version.\n\n" 106 107 "This program is distributed in the hope that it will be " 108 "useful, but WITHOUT ANY WARRANTY; without even the " 109 "implied warranty of MERCHANTABILITY or FITNESS FOR A " 110 "PARTICULAR PURPOSE. See the GNU General Public License " 111 "for more details. \n\n" 112 113 "You should have received a copy of the GNU General " 114 "Public License along with this program; if not, write to " 115 "the\n" 116 "Free Software Foundation, Inc.,\n" 117 "59 Temple Place - Suite 330, Boston, MA 02111-1307, USA."); 118 119 notebook->AddPage(text, wxT("License Agreement")); 120 } -
trunk/src/about.h
r182 r183 24 24 #include <wx/wx.h> 25 25 #include <wx/image.h> 26 #include "wxDynamicBitmap.h"27 26 28 27 #include <wx/notebook.h> … … 32 31 class AboutDialog: public wxDialog { 33 32 public: 34 AboutDialog(wxWindow* parent);33 AboutDialog(wxWindow* parent); 35 34 36 35 private: 37 void set_properties(); 38 void do_layout(); 39 40 protected: 41 wxDynamicBitmap* bitmap_1; 42 wxStaticText* app_label; 43 wxStaticText* label_desc; 44 wxStaticText* label_copyright; 45 wxStaticText* label_1; 46 wxPanel* notebook_main_pane_about; 47 wxStaticText* label_7; 48 wxScrolledWindow* notebook_main_pane_authors; 49 wxStaticText* label_6; 50 wxScrolledWindow* notebook_main_pane_thanks; 51 wxStaticText* label_15; 52 wxScrolledWindow* notebook_main_pane_license; 53 wxNotebook* notebook_main; 54 wxButton* close_button; 36 void addControlsAndLayout(); 37 void notebookAboutTab(wxNotebook *notebook); 38 void notebookAuthorTab(wxNotebook *notebook); 39 void notebookThanksTab(wxNotebook *notebook); 40 void notebookLicenseTab(wxNotebook *notebook); 55 41 }; 56 42
Note: See TracChangeset
for help on using the changeset viewer.
