+
+void
+FortyFrame::ToggleCardSize(wxCommandEvent& event)
+{
+ bool checked = m_menuBar->IsChecked(event.GetId());
+ Card::SetScale(checked ? 1.3 : 1);
+ m_canvas->LayoutGame();
+ m_canvas->Refresh();
+}
+
+//----------------------------------------------------------------------------
+// stAboutDialog
+//----------------------------------------------------------------------------
+
+BEGIN_EVENT_TABLE(FortyAboutDialog,wxDialog)
+ EVT_BUTTON(wxID_CLOSE, wxDialog::OnOK)
+END_EVENT_TABLE()
+
+FortyAboutDialog::FortyAboutDialog( wxWindow *parent, wxWindowID id, const wxString &title,
+ const wxPoint &position, const wxSize& size, long style ) :
+ wxDialog( parent, id, title, position, size, style )
+{
+ AddControls(this);
+
+ Centre(wxBOTH);
+}
+
+bool FortyAboutDialog::AddControls(wxWindow* parent)
+{
+#if wxUSE_HTML
+ wxString htmlText;
+ wxString htmlFile = wxGetApp().GetHelpFile();
+
+ {
+ wxTextFile file(htmlFile);
+ if (file.Exists())
+ {
+ file.Open();
+ for ( htmlText = file.GetFirstLine();
+ !file.Eof();
+ htmlText << file.GetNextLine() << _T("\n") ) ;
+ }
+ }
+
+ if (htmlText.empty())
+ {
+ htmlText.Printf(wxT("<html><head><title>Warning</title></head><body><P>Sorry, could not find resource for About dialog<P></body></html>"));
+ }
+
+ // Customize the HTML
+ htmlText.Replace(wxT("$DATE$"), _T(__DATE__));
+
+ wxSize htmlSize(400, 290);
+
+ // Note: in later versions of wxWin this will be fixed so wxRAISED_BORDER
+ // does the right thing. Meanwhile, this is a workaround.
+#ifdef __WXMSW__
+ long borderStyle = wxDOUBLE_BORDER;
+#else
+ long borderStyle = wxRAISED_BORDER;
+#endif
+
+ wxHtmlWindow* html = new wxHtmlWindow(this, ID_ABOUT_HTML_WINDOW, wxDefaultPosition, htmlSize, borderStyle);
+ html -> SetBorders(10);
+ html -> SetPage(htmlText);
+
+ //// Start of sizer-based control creation
+
+ wxSizer *item0 = new wxBoxSizer( wxVERTICAL );
+
+ wxWindow *item1 = parent->FindWindow( ID_ABOUT_HTML_WINDOW );
+ wxASSERT( item1 );
+ item0->Add( item1, 0, wxALIGN_CENTRE|wxALL, 5 );
+
+ wxButton *item2 = new wxButton( parent, wxID_CLOSE );
+ item2->SetDefault();
+ item2->SetFocus();
+
+ item0->Add( item2, 0, wxALIGN_RIGHT|wxALL, 5 );
+
+ parent->SetSizer( item0 );
+ parent->Layout();
+ item0->Fit( parent );
+ item0->SetSizeHints( parent );
+#endif
+
+ return true;
+}
+