Main Page | Class List | File List | Class Members | Related Pages

dlgabout.cpp

00001 /***************************************************************************
00002                            dlgabout.cpp
00003                            -------------------
00004     begin                : 2004-05-29 18:29
00005     copyright            : (C) 2004-2005 by Michael Menne, Dominik Haumann
00006     email                : menne@users.sourceforge.net, dhaumann@...
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  This program is free software; you can redistribute it and/or
00011  modify it under the terms of the GNU General Public License
00012  as published by the Free Software Foundation; either version 2
00013  of the License, or (at your option) any later version.
00014 
00015  This program is distributed in the hope that it will be useful,
00016  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  GNU General Public License for more details.
00019 
00020  You should have received a copy of the GNU General Public License
00021  along with this program; if not, write to the Free Software
00022  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023  ***************************************************************************/
00024 
00025 #include "dlgabout.h"
00026 #include "hyperlink.h"
00027 
00028 #include <wx/notebook.h>
00029 #include <wx/panel.h>
00030 
00031 namespace WDS
00032 {
00033 
00034 BEGIN_EVENT_TABLE(CDlgAbout, wxDialog)
00035     EVT_BUTTON( wxID_OK, CDlgAbout::OnOK)
00036 END_EVENT_TABLE()
00037 
00038 /*----------------------------------------------------------------------------/
00039     Constructor / Destructor
00040 -----------------------------------------------------------------------------*/
00041 
00042 CDlgAbout::CDlgAbout( wxWindow *pParent )
00043     : wxDialog( pParent, -1, wxString("WDSMap - About"), wxDefaultPosition,
00044                 wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
00045 {
00046     wxBoxSizer* sTop      = new wxBoxSizer( wxVERTICAL );
00047     wxNotebook* sTabs     = new wxNotebook( this, -1 );
00048     wxBoxSizer* sAbout    = new wxBoxSizer( wxVERTICAL );
00049     wxBoxSizer* sAuthors  = new wxBoxSizer( wxVERTICAL );
00050     wxBoxSizer* sThanksTo = new wxBoxSizer( wxVERTICAL );
00051     wxBoxSizer* sJoinUs   = new wxBoxSizer( wxVERTICAL );
00052     wxBoxSizer* sLicense  = new wxBoxSizer( wxVERTICAL );
00053     wxPanel* pAbout   = new wxPanel( sTabs );
00054     wxPanel* pAuthors = new wxPanel( sTabs );
00055     wxPanel* pThanksTo= new wxPanel( sTabs );
00056     wxPanel* pJoinUs  = new wxPanel( sTabs );
00057     wxPanel* pLicense = new wxPanel( sTabs );
00058 
00059     // Controls
00060     wxButton*     pBtnClose= new wxButton( this, wxID_OK, "&Close" );
00061     wxImage splash("data/about.png", wxBITMAP_TYPE_PNG);
00062     wxBitmap bmp( splash );
00063     wxStaticBitmap* pBmpLogo = new wxStaticBitmap( pAbout, -1, bmp );
00064     wxStaticText* pCopyright = new wxStaticText( pAbout, -1, "(C) 2004-2005 The wdstools Team" );
00065 
00066     wxTextCtrl* pTxtAuthors  = new wxTextCtrl( pAuthors, -1,
00067         "Michael \"Isdir\" Menne\n"
00068         "\tmenne@users.sf.net\n"
00069         "\tCore Developer and Maintainer\n\n"
00070         "Dominik \"Accolon\" Haumann\n"
00071         "\tdhaumann@users.sf.net\n"
00072         "\tCore Developer and Maintainer\n\n"
00073         "Robert \"Smir\" Vock\n"
00074         "\trvock@users.sf.net\n"
00075         "\tCreator\n\n",
00076         wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY );
00077 
00078     wxTextCtrl* pTxtThanksTo = new wxTextCtrl( pThanksTo, -1,
00079         "phpmap-Team\n"
00080         "\tphpmap Server\n",
00081         wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY );
00082 
00083     wxTextCtrl* pTxtLicense = new wxTextCtrl( pLicense, -1, "",
00084         wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP );
00085     pTxtLicense->LoadFile("COPYING");
00086 
00087     wxTextCtrl* pTxtJoinUs = new wxTextCtrl( pJoinUs, -1,
00088         "You do not have to be a software developer to be a member of the "
00089         "wdstools team as we also need beta-testers, graphics and documentation.\n\n"
00090         "Visit http://wdstools.sf.net/ for further information about the project.\n"
00091         "Also join #wdstools in the wds irc chat.",
00092         wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_WORDWRAP );
00093 
00094     // Hyperlink zur WDSTools Homepage
00095     wxHyperLink*  pLink  = new wxHyperLink ( pJoinUs, -1, "WDSTools Homepage" );
00096     pLink->SetURL( "http://wdstools.sourceforge.net/" );
00097     // FIXME: die folgende Zeile fuktioniert nicht... einfach komplett rauslöschen?
00098     pLink->SetHoverCursor( wxStockCursor( wxCURSOR_HAND ) );
00099 
00100 
00101     // HACK: Versteckter Cancel Button, damit kann der Dialog mit Escape beendet werden
00102     (new wxButton( this, wxID_CANCEL, "Cancel" ))->Show( false );
00103 
00104     sAbout   ->Add( pBmpLogo, 0, wxALIGN_CENTER | wxALL, 10 );
00105     sAbout   ->Add( pCopyright, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT | wxBOTTOM, 10 );
00106     sAuthors ->Add( pTxtAuthors, 1, wxEXPAND | wxALL, 10 );
00107     sThanksTo->Add( pTxtThanksTo, 1, wxEXPAND | wxALL, 10 );
00108     sJoinUs  ->Add( pTxtJoinUs, 1, wxEXPAND | wxALL, 10 );
00109     sJoinUs  ->Add( pLink, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT | wxBOTTOM, 10 );
00110     sLicense ->Add( pTxtLicense, 1, wxEXPAND | wxALL, 10 );
00111 
00112     sTop->Add( sTabs, 1, wxEXPAND | wxALL, 10 );
00113     sTop->Add( pBtnClose, 0, wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10 );
00114 
00115     sTabs->AddPage( pAbout   , wxString("About") );
00116     sTabs->AddPage( pAuthors , wxString("Authors") );
00117     sTabs->AddPage( pThanksTo, wxString("Thanks To") );
00118     sTabs->AddPage( pJoinUs  , wxString("Join Us") );
00119     sTabs->AddPage( pLicense , wxString("License Agreement") );
00120 
00121     pAbout   ->SetSizer( sAbout );
00122     pAuthors ->SetSizer( sAuthors );
00123     pThanksTo->SetSizer( sThanksTo );
00124     pJoinUs  ->SetSizer( sJoinUs );
00125     pLicense ->SetSizer( sLicense );
00126 
00127     SetAutoLayout( true );
00128     SetSizer( sTop );
00129 
00130     sTop->SetSizeHints( this );
00131     SetClientSize( 400, 300 );
00132 
00133     pBtnClose->SetFocus( );
00134     pBtnClose->SetDefault( );
00135 }
00136 
00137 CDlgAbout::~CDlgAbout()
00138 {
00139     // all widgets are automatically deleted.
00140 }
00141 
00142 /*----------------------------------------------------------------------------/
00143     Member Functions
00144 -----------------------------------------------------------------------------*/
00145 
00146 void CDlgAbout::OnOK( wxCommandEvent &event )
00147 {
00148     event.Skip( );
00149 }
00150 
00151 }
00152 
00153 // kate: space-indent off; tab-width 4; replace-tabs off;

Generated on Sun Jan 16 18:20:26 2005 for WDSMap by  doxygen 1.3.9.1