2007-09-07 23:17:30 +02:00
|
|
|
#include "aboutdialog.h"
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#include <wx/wxhtml.h>
|
|
|
|
|
2007-09-08 00:25:30 +02:00
|
|
|
BEGIN_EVENT_TABLE ( AboutDialog, wxDialog )
|
|
|
|
EVT_BUTTON ( wxID_CANCEL, AboutDialog::OnOk )
|
2007-09-07 23:17:30 +02:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2007-09-08 00:25:30 +02:00
|
|
|
AboutDialog::AboutDialog (
|
|
|
|
wxWindow *parent,
|
|
|
|
const wxString& title,
|
|
|
|
const wxString& path,
|
|
|
|
const wxString& hyperlink,
|
|
|
|
wxPoint positionParameter ) :
|
|
|
|
wxDialog ( parent, wxID_ANY, title, positionParameter )
|
2007-09-07 23:17:30 +02:00
|
|
|
{
|
2007-09-08 00:25:30 +02:00
|
|
|
wxBoxSizer *sizer = new wxBoxSizer ( wxVERTICAL );
|
|
|
|
|
|
|
|
html = new wxHtmlWindow ( this, wxID_ANY, wxDefaultPosition, wxSize ( 500, 300 ) );
|
|
|
|
|
2007-09-07 23:17:30 +02:00
|
|
|
#ifndef __WXMSW__
|
2007-09-08 00:25:30 +02:00
|
|
|
const int sizeArray[] =
|
|
|
|
{
|
|
|
|
8, 9, 10, 11, 12, 13, 14
|
|
|
|
};
|
|
|
|
html->SetFonts ( wxEmptyString, wxEmptyString, sizeArray );
|
2007-09-07 23:17:30 +02:00
|
|
|
#endif
|
|
|
|
|
2007-09-08 00:25:30 +02:00
|
|
|
html->SetBorders ( 0 );
|
|
|
|
html->LoadPage ( path );
|
|
|
|
// wxID_CANCEL req'd for 'Esc closes dialog' functionality
|
|
|
|
button = new wxButton ( this, wxID_CANCEL, _ ( "OK" ) );
|
|
|
|
button->SetDefault();
|
2007-09-07 23:17:30 +02:00
|
|
|
|
2007-09-08 00:25:30 +02:00
|
|
|
sizer->Add ( html, 1, wxALL, 10 );
|
|
|
|
sizer->Add ( button, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_RIGHT, 10 );
|
2007-09-07 23:17:30 +02:00
|
|
|
|
2007-09-08 00:25:30 +02:00
|
|
|
SetSizer ( sizer );
|
|
|
|
SetBackgroundColour ( *wxWHITE );
|
2007-09-07 23:17:30 +02:00
|
|
|
|
2007-09-08 00:25:30 +02:00
|
|
|
sizer->Fit ( this );
|
|
|
|
this->SetSizer ( sizer );
|
|
|
|
sizer->SetSizeHints ( this );
|
|
|
|
html->SetFocus();
|
2007-09-07 23:17:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
AboutDialog::~AboutDialog()
|
|
|
|
{ }
|
|
|
|
|
2007-09-08 00:25:30 +02:00
|
|
|
void AboutDialog::OnOk ( wxCommandEvent& e )
|
2007-09-07 23:17:30 +02:00
|
|
|
{
|
2007-09-08 00:25:30 +02:00
|
|
|
position = GetPosition();
|
|
|
|
e.Skip();
|
2007-09-07 23:17:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
wxPoint AboutDialog::getPosition()
|
|
|
|
{
|
2007-09-08 00:25:30 +02:00
|
|
|
return position;
|
2007-09-07 23:17:30 +02:00
|
|
|
}
|