+MyDialog::MyDialog(const wxString& title)
+ : wxDialog(NULL, wxID_ANY, title)
+{
+ wxSizer * const sizerTop = new wxBoxSizer(wxVERTICAL);
+
+ wxSizerFlags flags;
+ flags.Border(wxALL, 10);
+
+ sizerTop->Add(new wxStaticText
+ (
+ this,
+ wxID_ANY,
+ wxT("Press 'Hide me' to hide this window, Exit to quit.")
+ ), flags);
+
+ sizerTop->Add(new wxStaticText
+ (
+ this,
+ wxID_ANY,
+ wxT("Double-click on the taskbar icon to show me again.")
+ ), flags);
+
+ sizerTop->AddStretchSpacer()->SetMinSize(200, 50);
+
+ wxSizer * const sizerBtns = new wxBoxSizer(wxHORIZONTAL);
+ sizerBtns->Add(new wxButton(this, wxID_ABOUT, wxT("&About")), flags);
+ sizerBtns->Add(new wxButton(this, wxID_OK, wxT("&Hide")), flags);
+ sizerBtns->Add(new wxButton(this, wxID_EXIT, wxT("E&xit")), flags);
+
+ sizerTop->Add(sizerBtns, flags.Align(wxALIGN_CENTER_HORIZONTAL));
+ SetSizerAndFit(sizerTop);
+ Centre();
+
+ m_taskBarIcon = new MyTaskBarIcon();
+
+ // we should be able to show up to 128 characters on recent Windows versions
+ // (and 64 on Win9x)
+ if ( !m_taskBarIcon->SetIcon(wxICON(sample),
+ "wxTaskBarIcon Sample\n"
+ "With a very, very, very, very\n"
+ "long tooltip whose length is\n"
+ "greater than 64 characters.") )
+ {
+ wxLogError(wxT("Could not set icon."));
+ }
+
+#if defined(__WXOSX__) && wxOSX_USE_COCOA
+ m_dockIcon = new MyTaskBarIcon(wxTBI_DOCK);
+ if ( !m_dockIcon->SetIcon(wxICON(sample)) )
+ {
+ wxLogError(wxT("Could not set icon."));
+ }
+#endif
+}