1 /***************************************************************
2 * Name: wxSmithDemoMain.cpp
3 * Purpose: Code for Application Frame
4 * Author: Gary Harris (garyjharris@sourceforge.net)
5 * Created: 2010-06-01
6 * Copyright: Gary Harris (http://cryogen.66ghz.com/)
7 * License:
8 **************************************************************/
9
10 #include "wxSmithDemoMain.h"
11 #include <wx/msgdlg.h>
12
13 //(*InternalHeaders(wxSmithDemoFrame)
14 #include <wx/font.h>
15 #include <wx/intl.h>
16 #include <wx/string.h>
17 //*)
18 #include <wx/paper.h> // wxPrintPaperDatabase.
19 #include <wx/aboutdlg.h>
20 #include <wx/log.h>
21 #include <wx/dcmemory.h>
22 #include "version.h"
23
24 #include "media/smiley.xpm"
25 #include "media/zebra.xpm"
26
27
28 //helper functions
29 enum wxbuildinfoformat {
30 short_f, long_f };
31
wxbuildinfo(wxbuildinfoformat format)32 wxString wxbuildinfo(wxbuildinfoformat format)
33 {
34 wxString wxbuild(wxVERSION_STRING);
35
36 if (format == long_f )
37 {
38 #if defined(__WXMSW__)
39 wxbuild << _T("-Windows");
40 #elif defined(__UNIX__)
41 wxbuild << _T("-Linux");
42 #endif
43
44 #if wxUSE_UNICODE
45 wxbuild << _T("-Unicode build");
46 #else
47 wxbuild << _T("-ANSI build");
48 #endif // wxUSE_UNICODE
49 }
50
51 return wxbuild;
52 }
53
54 // The application icon.
55 #if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
56 #include "media/wxsmith.xpm"
57 #endif
58
59 //(*IdInit(wxSmithDemoFrame)
60 const long wxSmithDemoFrame::ID_ANIMATIONCTRL1 = wxNewId();
61 const long wxSmithDemoFrame::ID_BUTTON1 = wxNewId();
62 const long wxSmithDemoFrame::ID_BUTTON2 = wxNewId();
63 const long wxSmithDemoFrame::ID_PANEL7 = wxNewId();
64 const long wxSmithDemoFrame::ID_SIMPLEHTMLLISTBOX1 = wxNewId();
65 const long wxSmithDemoFrame::ID_LISTVIEW1 = wxNewId();
66 const long wxSmithDemoFrame::ID_BITMAPCOMBOBOX1 = wxNewId();
67 const long wxSmithDemoFrame::ID_STATICBITMAP1 = wxNewId();
68 const long wxSmithDemoFrame::ID_SEARCHCTRL = wxNewId();
69 const long wxSmithDemoFrame::ID_PANEL4 = wxNewId();
70 const long wxSmithDemoFrame::ID_MEDIACTRL1 = wxNewId();
71 const long wxSmithDemoFrame::ID_PANEL8 = wxNewId();
72 const long wxSmithDemoFrame::ID_COLOURPICKERCTRL1 = wxNewId();
73 const long wxSmithDemoFrame::ID_COLOURPICKERCTRL2 = wxNewId();
74 const long wxSmithDemoFrame::ID_COLOURPICKERCTRL3 = wxNewId();
75 const long wxSmithDemoFrame::ID_FILEPICKERCTRL1 = wxNewId();
76 const long wxSmithDemoFrame::ID_DIRPICKERCTRL1 = wxNewId();
77 const long wxSmithDemoFrame::ID_FONTPICKERCTRL1 = wxNewId();
78 const long wxSmithDemoFrame::ID_PANEL2 = wxNewId();
79 const long wxSmithDemoFrame::ID_RICHTEXTCTRL1 = wxNewId();
80 const long wxSmithDemoFrame::ID_PANEL3 = wxNewId();
81 const long wxSmithDemoFrame::ID_STATICTEXT1 = wxNewId();
82 const long wxSmithDemoFrame::ID_PANEL12 = wxNewId();
83 const long wxSmithDemoFrame::ID_STATICTEXT5 = wxNewId();
84 const long wxSmithDemoFrame::ID_PANEL13 = wxNewId();
85 const long wxSmithDemoFrame::ID_STATICTEXT6 = wxNewId();
86 const long wxSmithDemoFrame::ID_PANEL14 = wxNewId();
87 const long wxSmithDemoFrame::ID_TREEBOOK1 = wxNewId();
88 const long wxSmithDemoFrame::ID_PANEL11 = wxNewId();
89 const long wxSmithDemoFrame::ID_RICHTEXTSTYLELISTCTRL1 = wxNewId();
90 const long wxSmithDemoFrame::ID_RICHTEXTSTYLECOMBOCTRL1 = wxNewId();
91 const long wxSmithDemoFrame::ID_RICHTEXTSTYLELISTBOX1 = wxNewId();
92 const long wxSmithDemoFrame::ID_PANEL5 = wxNewId();
93 const long wxSmithDemoFrame::ID_NOTEBOOK1 = wxNewId();
94 const long wxSmithDemoFrame::ID_LISTBOX1 = wxNewId();
95 const long wxSmithDemoFrame::ID_PANEL1 = wxNewId();
96 const long wxSmithDemoFrame::ID_DIALUPMANAGER1 = wxNewId();
97 const long wxSmithDemoFrame::ID_MESSAGEDIALOG1 = wxNewId();
98 const long wxSmithDemoFrame::ID_PASSWORDENTRYDIALOG1 = wxNewId();
99 const long wxSmithDemoFrame::ID_PROGRESSDIALOG1 = wxNewId();
100 const long wxSmithDemoFrame::ID_RICHTEXTFORMATTINGDIALOG1 = wxNewId();
101 const long wxSmithDemoFrame::ID_RICHTEXTSTYLEORGANISERDIALOG1 = wxNewId();
102 const long wxSmithDemoFrame::ID_TEXTENTRYDIALOG1 = wxNewId();
103 const long wxSmithDemoFrame::idMenuQuit = wxNewId();
104 const long wxSmithDemoFrame::idFindReplaceDlg = wxNewId();
105 const long wxSmithDemoFrame::idFontDlg = wxNewId();
106 const long wxSmithDemoFrame::idMessageDlg = wxNewId();
107 const long wxSmithDemoFrame::idPageSetupDlg = wxNewId();
108 const long wxSmithDemoFrame::idPasswordEntryDialog = wxNewId();
109 const long wxSmithDemoFrame::idPrintDlg = wxNewId();
110 const long wxSmithDemoFrame::idProgressDlg = wxNewId();
111 const long wxSmithDemoFrame::idRichTextFormattingDlg = wxNewId();
112 const long wxSmithDemoFrame::idRichTextStyleOrganiserDlg = wxNewId();
113 const long wxSmithDemoFrame::idTextEntryDlg = wxNewId();
114 const long wxSmithDemoFrame::idCheckNetworkStatus = wxNewId();
115 const long wxSmithDemoFrame::idHtmlEasyPrint = wxNewId();
116 const long wxSmithDemoFrame::idHtmlEasyPageSetup = wxNewId();
117 const long wxSmithDemoFrame::idMenuAbout = wxNewId();
118 const long wxSmithDemoFrame::ID_STATUSBAR1 = wxNewId();
119 //*)
120 const long wxSmithDemoFrame::ID_PANEL99 = wxNewId();
121
BEGIN_EVENT_TABLE(wxSmithDemoFrame,wxFrame)122 BEGIN_EVENT_TABLE(wxSmithDemoFrame,wxFrame)
123 //(*EventTable(wxSmithDemoFrame)
124 //*)
125 END_EVENT_TABLE()
126
127 wxSmithDemoFrame::wxSmithDemoFrame(wxWindow* parent,wxWindowID id)
128 {
129 // Set the frame icon
130 // SetIcon(wxICON(wxsmith));
131
132 // A help provider must be created before the wxContextHelpButton control and any controls that use context-sensitive help are declared.
133 wxHelpProvider::Set(new wxSimpleHelpProvider);
134
135 //(*Initialize(wxSmithDemoFrame)
136 wxBoxSizer* BoxSizer4;
137 wxBoxSizer* BoxSizer6;
138 wxBoxSizer* BoxSizer5;
139 wxBoxSizer* BoxSizer10;
140 wxBoxSizer* BoxSizer7;
141 wxBoxSizer* BoxSizer8;
142 wxMenuItem* MenuItem2;
143 wxStaticBoxSizer* StaticBoxSizer4;
144 wxMenuItem* MenuItem1;
145 wxBoxSizer* BoxSizer2;
146 wxBoxSizer* BoxSizer11;
147 wxMenu* Menu1;
148 wxStaticBoxSizer* StaticBoxSizer3;
149 wxGridSizer* GridSizer1;
150 wxStaticBoxSizer* StaticBoxSizer6;
151 wxBoxSizer* BoxSizer1;
152 wxBoxSizer* BoxSizer9;
153 wxMenuBar* MenuBar1;
154 wxBoxSizer* BoxSizer3;
155 wxMenu* Menu2;
156 wxStaticBoxSizer* StaticBoxSizer5;
157
158 Create(parent, wxID_ANY, _("wxSmith Demonstration Application"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
159 SetClientSize(wxSize(500,500));
160 SetMinSize(wxSize(500,500));
161 Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
162 BoxSizer1 = new wxBoxSizer(wxVERTICAL);
163 Notebook1 = new wxNotebook(Panel1, ID_NOTEBOOK1, wxDefaultPosition, wxDefaultSize, wxNB_MULTILINE, _T("ID_NOTEBOOK1"));
164 Panel7 = new wxPanel(Notebook1, ID_PANEL7, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL7"));
165 BoxSizer6 = new wxBoxSizer(wxVERTICAL);
166 wxAnimation anim_1(_T("media/bird_44.gif"));
167 AnimationCtrl1 = new wxAnimationCtrl(Panel7, ID_ANIMATIONCTRL1, anim_1, wxDefaultPosition, wxDefaultSize, wxAC_DEFAULT_STYLE, _T("ID_ANIMATIONCTRL1"));
168 BoxSizer6->Add(AnimationCtrl1, 1, wxALL|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL, 5);
169 BoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
170 ButtonPlayAnimation = new wxButton(Panel7, ID_BUTTON1, _("Play Animation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
171 BoxSizer8->Add(ButtonPlayAnimation, 1, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 5);
172 ButtonStopAnimation = new wxButton(Panel7, ID_BUTTON2, _("Stop Animation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
173 BoxSizer8->Add(ButtonStopAnimation, 1, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 5);
174 BoxSizer6->Add(BoxSizer8, 1, wxALL|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL, 5);
175 Panel7->SetSizer(BoxSizer6);
176 BoxSizer6->Fit(Panel7);
177 BoxSizer6->SetSizeHints(Panel7);
178 Panel4 = new wxPanel(Notebook1, ID_PANEL4, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL4"));
179 GridSizer1 = new wxGridSizer(3, 2, 0, 0);
180 SimpleHtmlListBox1 = new wxSimpleHtmlListBox(Panel4, ID_SIMPLEHTMLLISTBOX1, wxDefaultPosition, wxSize(331,220), 0, 0, wxHLB_DEFAULT_STYLE, wxDefaultValidator, _T("ID_SIMPLEHTMLLISTBOX1"));
181 SimpleHtmlListBox1->Append(_("<b>Bold text</b>"));
182 SimpleHtmlListBox1->Append(_("<u>Underlined text</u>"));
183 SimpleHtmlListBox1->Append(_("<h2>Heading 2 text</h2>"));
184 SimpleHtmlListBox1->Append(_("<font color=\"green\">Green text</font>"));
185 SimpleHtmlListBox1->Append(_("<font color=\"blue\"><i>Blue italic text</i></font>"));
186 SimpleHtmlListBox1->Append(_("A link: <a href=\"http://www.codeblocks.org/\">http://www.codeblocks.org/</a>"));
187 SimpleHtmlListBox1->Append(_("Some HTML entities: © < ® > £ ¢ \t² ¾ ¿"));
188 SimpleHtmlListBox1->Append(_("Nice, isn\'t it\?"));
189 SimpleHtmlListBox1->Append(_("<img src=\"media/smiley.xpm\">"));
190 SimpleHtmlListBox1->SetToolTip(_("wxSimpleHtmlListBox\n\nAn implementation of wxHtmlListBox which shows HTML content in\nthe listbox rows. The entries in this list are styled using HTML."));
191 SimpleHtmlListBox1->SetHelpText(_("This is sample context-sensitive help for the \nwxSimpleHtmlListBox in its simplest form."));
192 GridSizer1->Add(SimpleHtmlListBox1, 1, wxALL|wxEXPAND|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL, 5);
193 ListView1 = new wxListView(Panel4, ID_LISTVIEW1, wxDefaultPosition, wxSize(263,291), wxLC_LIST, wxDefaultValidator, _T("ID_LISTVIEW1"));
194 ListView1->SetToolTip(_("wxListView\n\nA facade for wxListCtrl in report mode."));
195 ListView1->SetHelpText(_("This is sample context-sensitive help\nfor the wxListView in its simplest form."));
196 GridSizer1->Add(ListView1, 1, wxALL|wxEXPAND|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL, 5);
197 BitmapComboBox1 = new wxBitmapComboBox(Panel4, ID_BITMAPCOMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_BITMAPCOMBOBOX1"));
198 BitmapComboBox1->SetSelection( BitmapComboBox1->Append(_("Item 1")) );
199 BitmapComboBox1->Append(_("Item 2"));
200 BitmapComboBox1->Append(_("Item 3"));
201 BitmapComboBox1->Append(_("Item 4"));
202 BitmapComboBox1->Append(_("Item 5"));
203 BitmapComboBox1->Append(_("Item 6"));
204 BitmapComboBox1->SetToolTip(_("wxBitmapComboBox\n\nAn enhanced ComboBox wich allows images to be associated with\nentries. This control is taking it\'s images from a wxImageList created\nin wxSmith."));
205 BitmapComboBox1->SetHelpText(_("This is sample context-sensitive help\nfor the wxBitmapComboBox in its simplest form."));
206 GridSizer1->Add(BitmapComboBox1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
207 StaticBitmap1 = new wxStaticBitmap(Panel4, ID_STATICBITMAP1, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER, _T("ID_STATICBITMAP1"));
208 StaticBitmap1->SetToolTip(_("wxImage\n\nThis wxStaticBitmap control is getting it\'s image from a wxImage\ncreated in wxSmith.\n\n"));
209 StaticBitmap1->SetHelpText(_("This is sample context-sensitive help\nfor the wxImage in its simplest form."));
210 GridSizer1->Add(StaticBitmap1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
211 ContextHelpButton1 = new wxContextHelpButton(Panel4, wxID_CONTEXT_HELP, wxDefaultPosition, wxSize(54,21), wxBU_AUTODRAW);
212 ContextHelpButton1->SetToolTip(_("wxContextHelpButton\n\nPuts the application into context-help mode. Click on the button\nand then click on the other controls on this page to see context help in\naction."));
213 GridSizer1->Add(ContextHelpButton1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
214 SearchCtrl1 = new wxSearchCtrl(Panel4, ID_SEARCHCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_SEARCHCTRL"));
215 SearchCtrl1->SetToolTip(_("wxSearchCtrl\n\nA composite control with a search button, a text control, and a cancel button. "));
216 SearchCtrl1->SetHelpText(_("This is sample context-sensitive help\nfor the wxSearchCtrl in its simplest form."));
217 GridSizer1->Add(SearchCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
218 Panel4->SetSizer(GridSizer1);
219 GridSizer1->Fit(Panel4);
220 GridSizer1->SetSizeHints(Panel4);
221 Panel8 = new wxPanel(Notebook1, ID_PANEL8, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL8"));
222 BoxSizer10 = new wxBoxSizer(wxVERTICAL);
223 BoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
224 MediaCtrl1 = new wxMediaCtrl(Panel8, ID_MEDIACTRL1, wxEmptyString, wxDefaultPosition, wxSize(326,101), 0);
225 MediaCtrl1->Load(_T("media/EarthImpactSml_512kb.mp4"));
226 MediaCtrl1->ShowPlayerControls(wxMEDIACTRLPLAYERCONTROLS_DEFAULT);
227 MediaCtrl1->SetVolume(0.5);
228 MediaCtrl1->SetToolTip(_("wxMediaCtrl\n\nA class for displaying types of media, such as videos, audio files,\nnatively through native codecs.wxMediaCtrl\n\nA class for displaying types of media, such as videos, audio files,\nnatively through native codecs."));
229 BoxSizer4->Add(MediaCtrl1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
230 BoxSizer10->Add(BoxSizer4, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
231 Panel8->SetSizer(BoxSizer10);
232 BoxSizer10->Fit(Panel8);
233 BoxSizer10->SetSizeHints(Panel8);
234 Panel2 = new wxPanel(Notebook1, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL2"));
235 BoxSizer2 = new wxBoxSizer(wxVERTICAL);
236 StaticBoxSizer3 = new wxStaticBoxSizer(wxHORIZONTAL, Panel2, _("wxColourPickerCtrl"));
237 ColourPickerCtrl1 = new wxColourPickerCtrl(Panel2, ID_COLOURPICKERCTRL1, wxColour(0,0,0), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_COLOURPICKERCTRL1"));
238 ColourPickerCtrl1->SetToolTip(_("wxColourPickerCtrl\n\nA button which brings up a wxColourDialog when clicked. This control\nis using the default style."));
239 StaticBoxSizer3->Add(ColourPickerCtrl1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
240 ColourPickerCtrl2 = new wxColourPickerCtrl(Panel2, ID_COLOURPICKERCTRL2, wxColour(0,0,0), wxDefaultPosition, wxDefaultSize, wxCLRP_SHOW_LABEL, wxDefaultValidator, _T("ID_COLOURPICKERCTRL2"));
241 ColourPickerCtrl2->SetToolTip(_("wxColourPickerCtrl\n\nA button which brings up a wxColourDialog when clicked. This control\nis using the wxCLRP_SHOW_LABEL style."));
242 StaticBoxSizer3->Add(ColourPickerCtrl2, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
243 ColourPickerCtrl3 = new wxColourPickerCtrl(Panel2, ID_COLOURPICKERCTRL3, wxColour(0,0,0), wxDefaultPosition, wxDefaultSize, wxCLRP_USE_TEXTCTRL, wxDefaultValidator, _T("ID_COLOURPICKERCTRL3"));
244 ColourPickerCtrl3->SetToolTip(_("wxColourPickerCtrl\n\nwxColourPickerCtrl\n\nA button which brings up a wxColourDialog when clicked. This control\nis using the wxCLRP_USE_TEXTCTRL style."));
245 StaticBoxSizer3->Add(ColourPickerCtrl3, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
246 BoxSizer2->Add(StaticBoxSizer3, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
247 StaticBoxSizer5 = new wxStaticBoxSizer(wxHORIZONTAL, Panel2, _("wxFilePickerCtrl"));
248 FilePickerCtrl1 = new wxFilePickerCtrl(Panel2, ID_FILEPICKERCTRL1, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxFLP_FILE_MUST_EXIST|wxFLP_SAVE|wxFLP_USE_TEXTCTRL, wxDefaultValidator, _T("ID_FILEPICKERCTRL1"));
249 FilePickerCtrl1->SetToolTip(_("wxFilePickerCtrl\n\nA button which brings up a wxFileDialog when clicked."));
250 StaticBoxSizer5->Add(FilePickerCtrl1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
251 BoxSizer2->Add(StaticBoxSizer5, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
252 StaticBoxSizer4 = new wxStaticBoxSizer(wxHORIZONTAL, Panel2, _("wxDirPickerCtrl"));
253 DirPickerCtrl1 = new wxDirPickerCtrl(Panel2, ID_DIRPICKERCTRL1, wxEmptyString, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST|wxDIRP_USE_TEXTCTRL, wxDefaultValidator, _T("ID_DIRPICKERCTRL1"));
254 DirPickerCtrl1->SetToolTip(_("wxDirPickerCtrl\n\nA button which brings up a wxDirDialog when clicked."));
255 StaticBoxSizer4->Add(DirPickerCtrl1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
256 BoxSizer2->Add(StaticBoxSizer4, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
257 StaticBoxSizer6 = new wxStaticBoxSizer(wxHORIZONTAL, Panel2, _("wxFontPickerCtrl"));
258 wxFont PickerFont_1(12,wxSWISS,wxFONTSTYLE_ITALIC,wxNORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT);
259 FontPickerCtrl1 = new wxFontPickerCtrl(Panel2, ID_FONTPICKERCTRL1, PickerFont_1, wxDefaultPosition, wxDefaultSize, wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL|wxFNTP_USE_TEXTCTRL, wxDefaultValidator, _T("ID_FONTPICKERCTRL1"));
260 FontPickerCtrl1->SetToolTip(_("wxFontPickerCtrl\n\nA button which brings up a wxFontDialog when clicked. This control\nis using the wxFNTP_FONTDESC_AS_LABEL, \nwxFNTP_USEFONT_FOR_LABEL and wxFNTP_USE_TEXTCTRL styles."));
261 StaticBoxSizer6->Add(FontPickerCtrl1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
262 BoxSizer2->Add(StaticBoxSizer6, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
263 BoxSizer2->Add(-1,-1,1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
264 BoxSizer2->Add(-1,-1,1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
265 Panel2->SetSizer(BoxSizer2);
266 BoxSizer2->Fit(Panel2);
267 BoxSizer2->SetSizeHints(Panel2);
268 Panel3 = new wxPanel(Notebook1, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3"));
269 BoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
270 RichTextCtrl1 = new wxRichTextCtrl(Panel3, ID_RICHTEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRE_MULTILINE|wxWANTS_CHARS, wxDefaultValidator, _T("ID_RICHTEXTCTRL1"));
271 wxRichTextAttr rchtxtAttr_1;
272 RichTextCtrl1->SetToolTip(_("wxRichTextCtrl\n\nProvides a generic, ground-up implementation of a text control\ncapable of showing multiple styles and images."));
273 BoxSizer7->Add(RichTextCtrl1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
274 Panel3->SetSizer(BoxSizer7);
275 BoxSizer7->Fit(Panel3);
276 BoxSizer7->SetSizeHints(Panel3);
277 Panel11 = new wxPanel(Notebook1, ID_PANEL11, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL11"));
278 BoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
279 Treebook1 = new wxTreebook(Panel11, ID_TREEBOOK1, wxDefaultPosition, wxSize(237,167), wxBK_DEFAULT, _T("ID_TREEBOOK1"));
280 Treebook1->SetToolTip(_("wxTreebook\n\nAn extension of the wxNotebook class that allows a tree structured\nset of pages to be shown in a control.\nwxSmith can currently only enter pages at the root level of the tree.\nPages at lower levels have been added manually."));
281 Panel12 = new wxPanel(Treebook1, ID_PANEL12, wxPoint(108,0), wxSize(218,224), wxSTATIC_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL12"));
282 StaticText1 = new wxStaticText(Panel12, ID_STATICTEXT1, _("wxTreebook\n\nAn extension of the wxNotebook\nclass that allows a tree structure\nset of pages to be shown in a control.\nwxSmith can currently only enter\npages at the root level of the tree.\nPages at lower levels have been\nadded manually."), wxPoint(88,80), wxDefaultSize, 0, _T("ID_STATICTEXT1"));
283 Panel13 = new wxPanel(Treebook1, ID_PANEL13, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL13"));
284 StaticText5 = new wxStaticText(Panel13, ID_STATICTEXT5, _("This is page 2."), wxPoint(88,96), wxDefaultSize, 0, _T("ID_STATICTEXT5"));
285 Panel14 = new wxPanel(Treebook1, ID_PANEL14, wxPoint(116,0), wxSize(305,224), wxSTATIC_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL14"));
286 StaticText6 = new wxStaticText(Panel14, ID_STATICTEXT6, _("This is page 3."), wxPoint(88,96), wxDefaultSize, 0, _T("ID_STATICTEXT6"));
287 Treebook1->AddPage(Panel12, _("Page Number 1"), false);
288 Treebook1->AddPage(Panel13, _("Page Number 2"), false);
289 Treebook1->AddPage(Panel14, _("Page Number 3"), false);
290 BoxSizer5->Add(Treebook1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
291 Panel11->SetSizer(BoxSizer5);
292 BoxSizer5->Fit(Panel11);
293 BoxSizer5->SetSizeHints(Panel11);
294 Panel5 = new wxPanel(Notebook1, ID_PANEL5, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL5"));
295 BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
296 BoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
297 RichTextStyleListCtrl1 = new wxRichTextStyleListCtrl(Panel5, ID_RICHTEXTSTYLELISTCTRL1, wxDefaultPosition, wxDefaultSize, 0);
298 RichTextStyleListCtrl1->SetToolTip(_("wxRichTextStyleListCtrl\n\nThis class incorporates a wxRichTextStyleListBox and a choice control\nthat allows the user to select the category of style to view. "));
299 BoxSizer11->Add(RichTextStyleListCtrl1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
300 BoxSizer3->Add(BoxSizer11, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
301 BoxSizer9 = new wxBoxSizer(wxVERTICAL);
302 RichTextStyleComboCtrl1 = new wxRichTextStyleComboCtrl(Panel5, ID_RICHTEXTSTYLECOMBOCTRL1, wxDefaultPosition, wxSize(221,25), 0);
303 RichTextStyleComboCtrl1->SetRichTextCtrl(RichTextCtrl1);
304 RichTextStyleComboCtrl1->SetToolTip(_("wxRichTextStyleComboCtrl\n\nA combo control that can display the styles in a wxRichTextStyleSheet,\nand apply the selection to an associated wxRichTextCtrl."));
305 BoxSizer9->Add(RichTextStyleComboCtrl1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
306 RichTextStyleListBox1 = new wxRichTextStyleListBox(Panel5, ID_RICHTEXTSTYLELISTBOX1, wxDefaultPosition, wxSize(221,184), wxSUNKEN_BORDER);
307 RichTextStyleListBox1->SetStyleType(wxRichTextStyleListBox::wxRICHTEXT_STYLE_ALL);
308 RichTextStyleListBox1->SetToolTip(_("wxRichTextStyleListBox\n\nA listbox that can display the styles in a wxRichTextStyleSheet, and\napply the selection to an associated wxRichTextCtrl."));
309 BoxSizer9->Add(RichTextStyleListBox1, 6, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
310 BoxSizer3->Add(BoxSizer9, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
311 Panel5->SetSizer(BoxSizer3);
312 BoxSizer3->Fit(Panel5);
313 BoxSizer3->SetSizeHints(Panel5);
314 Notebook1->AddPage(Panel7, _("wxAnimationCtrl"), false);
315 Notebook1->AddPage(Panel4, _("wxControls"), false);
316 Notebook1->AddPage(Panel8, _("wxMediaCtrl"), false);
317 Notebook1->AddPage(Panel2, _("wxPickers"), false);
318 Notebook1->AddPage(Panel3, _("wxRichTextCtrl"), false);
319 Notebook1->AddPage(Panel11, _("wxTreebook"), false);
320 Notebook1->AddPage(Panel5, _("Rich Text Controls"), false);
321 BoxSizer1->Add(Notebook1, 3, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
322 ListBoxLog = new wxListBox(Panel1, ID_LISTBOX1, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_LISTBOX1"));
323 BoxSizer1->Add(ListBoxLog, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
324 Panel1->SetSizer(BoxSizer1);
325 BoxSizer1->Fit(Panel1);
326 BoxSizer1->SetSizeHints(Panel1);
327 DialUpManager1 = wxDialUpManager::Create();
328 // NOTE: In order for events to connect properly you must set the ID of this wxFindReplaceDialog to -1 in wxSmith.
329 FindReplaceDialog1 = new wxFindReplaceDialog(this, &findReplaceData_1, _("wxFindReplaceDialog"), wxFR_REPLACEDIALOG);
330 wxFontData fontData_1;
331 fontData_1.SetInitialFont(*wxNORMAL_FONT);
332 fontData_1.SetAllowSymbols(true);
333 FontDialog1 = new wxFontDialog(this, fontData_1);
334 HtmlEasyPrinting1 = new wxHtmlEasyPrinting(_T("wxHtmlEasyPrinting"), this);
335 MessageDialog1 = new wxMessageDialog(this, _("Exciting, isn\'t it\? :-)"), _("wxMessageDialog"), wxOK, wxDefaultPosition);
336 pageSetupDialogData_1 = new wxPageSetupDialogData;
337 PageSetupDialog1 = new wxPageSetupDialog(this, pageSetupDialogData_1);
338 PasswordEntryDialog1 = new wxPasswordEntryDialog(this, _("Enter some text."), _("wxPasswordEntryDialog"), _("Password"), wxCANCEL|wxCENTRE|wxOK, wxDefaultPosition);
339 printDialogData_1 = new wxPrintDialogData;
340 PrintDialog1 = new wxPrintDialog(this, printDialogData_1);
341 RichTextFormattingDialog1 = new wxRichTextFormattingDialog(wxRICHTEXT_FORMAT_BULLETS|wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS, this, _("wxRichTextFormattingDialog"), ID_RICHTEXTFORMATTINGDIALOG1, wxDefaultPosition, wxDefaultSize);
342 richTextStyleSheet_1 = new wxRichTextStyleSheet;
343 RichTextStyleOrganiserDialog1 = new wxRichTextStyleOrganiserDialog(wxRICHTEXT_ORGANISER_APPLY_STYLES|wxRICHTEXT_ORGANISER_CREATE_STYLES|wxRICHTEXT_ORGANISER_DELETE_STYLES|wxRICHTEXT_ORGANISER_EDIT_STYLES|wxRICHTEXT_ORGANISER_RENAME_STYLES|wxRICHTEXT_ORGANISER_SHOW_ALL, richTextStyleSheet_1, NULL, this, ID_RICHTEXTSTYLEORGANISERDIALOG1, _("wxRichTextStyleOrganiserDialog"), SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION, SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE, SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE);
344 TextEntryDialog1 = new wxTextEntryDialog(this, _("Enter some text."), _("wxTextEntryDialog"), _("Text"), wxOK|wxCANCEL|wxCENTRE|wxWS_EX_VALIDATE_RECURSIVELY, wxDefaultPosition);
345 MenuBar1 = new wxMenuBar();
346 Menu1 = new wxMenu();
347 MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application."), wxITEM_NORMAL);
348 Menu1->Append(MenuItem1);
349 MenuBar1->Append(Menu1, _("&File"));
350 Menu5 = new wxMenu();
351 MenuItemFindReplaceDlg = new wxMenuItem(Menu5, idFindReplaceDlg, _("wxFindReplaceDialog"), _("Run the find/replace dialogue."), wxITEM_NORMAL);
352 Menu5->Append(MenuItemFindReplaceDlg);
353 MenuItemFontDlg = new wxMenuItem(Menu5, idFontDlg, _("wxFontDialog"), _("Run the font dialogue."), wxITEM_NORMAL);
354 Menu5->Append(MenuItemFontDlg);
355 MenuItemMessageDlg = new wxMenuItem(Menu5, idMessageDlg, _("wxMessageDialog"), _("Run the message dialogue."), wxITEM_NORMAL);
356 Menu5->Append(MenuItemMessageDlg);
357 MenuItemPageSetupDlg = new wxMenuItem(Menu5, idPageSetupDlg, _("wxPageSetupDialog"), _("Run the page setup dialogue."), wxITEM_NORMAL);
358 Menu5->Append(MenuItemPageSetupDlg);
359 MenuItemPasswordEntryDialog = new wxMenuItem(Menu5, idPasswordEntryDialog, _("wxPasswordEntryDialog"), _("Run the password entry dialogue."), wxITEM_NORMAL);
360 Menu5->Append(MenuItemPasswordEntryDialog);
361 MenuItemPrintDlg = new wxMenuItem(Menu5, idPrintDlg, _("wxPrintDialog"), _("Run the print dialogue."), wxITEM_NORMAL);
362 Menu5->Append(MenuItemPrintDlg);
363 MenuItemProgressDlg = new wxMenuItem(Menu5, idProgressDlg, _("wxProgressDialog"), _("Run the progress dialogue."), wxITEM_NORMAL);
364 Menu5->Append(MenuItemProgressDlg);
365 MenuItemRichTextFormattingDlg = new wxMenuItem(Menu5, idRichTextFormattingDlg, _("wxRichTextFormattingDialog"), _("Run the rich text formatting dialogue."), wxITEM_NORMAL);
366 Menu5->Append(MenuItemRichTextFormattingDlg);
367 MenuItemRichTextStyleOrganiserDlg = new wxMenuItem(Menu5, idRichTextStyleOrganiserDlg, _("wxRichTextStyleOrganiserDialog"), _("Run the rich text style organiser dialogue."), wxITEM_NORMAL);
368 Menu5->Append(MenuItemRichTextStyleOrganiserDlg);
369 MenuItemTextEntryDlg = new wxMenuItem(Menu5, idTextEntryDlg, _("wxTextEntryDialog"), _("Run the text entry dialogue."), wxITEM_NORMAL);
370 Menu5->Append(MenuItemTextEntryDlg);
371 MenuBar1->Append(Menu5, _("Dialogues"));
372 Menu3 = new wxMenu();
373 MenuItem3 = new wxMenuItem(Menu3, idCheckNetworkStatus, _("Check network status"), _("wxDialUpManager: Check network status."), wxITEM_NORMAL);
374 Menu3->Append(MenuItem3);
375 MenuBar1->Append(Menu3, _("wx&DialUpmanager"));
376 Menu4 = new wxMenu();
377 MenuItem4 = new wxMenuItem(Menu4, idHtmlEasyPrint, _("Print"), _("wxHtmlEasyPrinting: Run the print dialogue."), wxITEM_NORMAL);
378 Menu4->Append(MenuItem4);
379 MenuItem5 = new wxMenuItem(Menu4, idHtmlEasyPageSetup, _("Page &Setup..."), _("wxHtmlEasyPrinting: Run the page setup dialogue."), wxITEM_NORMAL);
380 Menu4->Append(MenuItem5);
381 MenuBar1->Append(Menu4, _("wx&HtmlEasyPrinting"));
382 Menu2 = new wxMenu();
383 MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application."), wxITEM_NORMAL);
384 Menu2->Append(MenuItem2);
385 MenuBar1->Append(Menu2, _("Help"));
386 SetMenuBar(MenuBar1);
387 StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
388 int __wxStatusBarWidths_1[3] = { -25, -10, -10 };
389 int __wxStatusBarStyles_1[3] = { wxSB_NORMAL, wxSB_NORMAL, wxSB_NORMAL };
390 StatusBar1->SetFieldsCount(3,__wxStatusBarWidths_1);
391 StatusBar1->SetStatusStyles(3,__wxStatusBarStyles_1);
392 SetStatusBar(StatusBar1);
393 ImageList1 = new wxImageList(32, 32, 7);
394 ImageList1->Add(wxBitmap(ImageList1_0_XPM));
395 ImageList1->Add(wxBitmap(ImageList1_1_XPM));
396 ImageList1->Add(wxBitmap(ImageList1_2_XPM));
397 ImageList1->Add(wxBitmap(ImageList1_3_XPM));
398 ImageList1->Add(wxBitmap(ImageList1_4_XPM));
399 ImageList1->Add(wxBitmap(ImageList1_5_XPM));
400 Image1 = new wxImage(Image1_XPM);
401 Image1_BMP = new wxBitmap(Image1_XPM);
402 Center();
403
404 Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&wxSmithDemoFrame::OnButtonPlayAnimationClick);
405 Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&wxSmithDemoFrame::OnButtonStopAnimationClick);
406 Connect(ID_SIMPLEHTMLLISTBOX1,wxEVT_COMMAND_LISTBOX_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnSimpleHtmlListBox1Select);
407 Connect(ID_SIMPLEHTMLLISTBOX1,wxEVT_COMMAND_HTML_CELL_CLICKED,(wxObjectEventFunction)&wxSmithDemoFrame::OnSimpleHtmlListBox1CellClicked);
408 Connect(ID_SIMPLEHTMLLISTBOX1,wxEVT_COMMAND_HTML_CELL_HOVER,(wxObjectEventFunction)&wxSmithDemoFrame::OnSimpleHtmlListBox1CellHover);
409 Connect(ID_SIMPLEHTMLLISTBOX1,wxEVT_COMMAND_HTML_LINK_CLICKED,(wxObjectEventFunction)&wxSmithDemoFrame::OnSimpleHtmlListBox1LinkClicked);
410 Connect(ID_LISTVIEW1,wxEVT_COMMAND_LIST_ITEM_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnListView1ItemSelect);
411 // Set the bitmaps for BitmapComboBox1.
412 BitmapComboBox1->SetItemBitmap(0, ImageList1->GetBitmap(0));
413 BitmapComboBox1->SetItemBitmap(1, ImageList1->GetBitmap(1));
414 BitmapComboBox1->SetItemBitmap(2, ImageList1->GetBitmap(2));
415 BitmapComboBox1->SetItemBitmap(3, ImageList1->GetBitmap(3));
416 BitmapComboBox1->SetItemBitmap(4, ImageList1->GetBitmap(4));
417 BitmapComboBox1->SetItemBitmap(5, ImageList1->GetBitmap(5));
418 Connect(ID_BITMAPCOMBOBOX1,wxEVT_COMMAND_COMBOBOX_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnBitmapComboBox1Selected);
419 Connect(ID_BITMAPCOMBOBOX1,wxEVT_COMMAND_TEXT_ENTER,(wxObjectEventFunction)&wxSmithDemoFrame::OnBitmapComboBox1TextEnter);
420 Connect(ID_MEDIACTRL1,wxEVT_MEDIA_PLAY,(wxObjectEventFunction)&wxSmithDemoFrame::OnMediaCtrl1Play);
421 Connect(ID_MEDIACTRL1,wxEVT_MEDIA_PAUSE,(wxObjectEventFunction)&wxSmithDemoFrame::OnMediaCtrl1Pause);
422 Connect(ID_MEDIACTRL1,wxEVT_MEDIA_STOP,(wxObjectEventFunction)&wxSmithDemoFrame::OnMediaCtrl1Stop);
423 Connect(ID_MEDIACTRL1,wxEVT_MEDIA_FINISHED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMediaCtrl1Finished);
424 Connect(ID_RICHTEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&wxSmithDemoFrame::OnRichTextCtrl1Text);
425 Connect(ID_RICHTEXTCTRL1,wxEVT_COMMAND_TEXT_ENTER,(wxObjectEventFunction)&wxSmithDemoFrame::OnRichTextCtrl1TextEnter);
426 Connect(ID_RICHTEXTCTRL1,wxEVT_COMMAND_TEXT_URL,(wxObjectEventFunction)&wxSmithDemoFrame::OnRichTextCtrl1TextUrl);
427 // Set the wxRichtTextCtrl for RichTextStyleListCtrl1.
428 RichTextStyleListCtrl1->SetRichTextCtrl(RichTextCtrl1);
429 // Set the wxRichTextStyleSheet for RichTextStyleListCtrl1.
430 RichTextStyleListCtrl1->SetStyleSheet(richTextStyleSheet_1);
431 RichTextStyleListCtrl1->UpdateStyles();
432 // Set the wxRichtTextCtrl for RichTextStyleListBox1.
433 RichTextStyleListBox1->SetRichTextCtrl(RichTextCtrl1);
434 // Set the wxRichTextStyleSheet for RichTextStyleListBox1.
435 RichTextStyleListBox1->SetStyleSheet(richTextStyleSheet_1);
436 RichTextStyleListBox1->UpdateStyles();
437 Connect(ID_NOTEBOOK1,wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,(wxObjectEventFunction)&wxSmithDemoFrame::OnNotebook1PageChanged);
438 Connect(-1,wxEVT_COMMAND_FIND,(wxObjectEventFunction)&wxSmithDemoFrame::OnFindReplaceDialog1Find);
439 Connect(-1,wxEVT_COMMAND_FIND_NEXT,(wxObjectEventFunction)&wxSmithDemoFrame::OnFindReplaceDialog1FindNext);
440 Connect(-1,wxEVT_COMMAND_FIND_CLOSE,(wxObjectEventFunction)&wxSmithDemoFrame::OnFindReplaceDialog1Close);
441 Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnQuit);
442 Connect(idFindReplaceDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemFindReplaceDlgSelected);
443 Connect(idFontDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemFontDlgSelected);
444 Connect(idMessageDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemMessageDlgSelected);
445 Connect(idPageSetupDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemPageSetupDlgSelected);
446 Connect(idPasswordEntryDialog,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemPasswordEntryDialogSelected);
447 Connect(idPrintDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemPrintDlgSelected);
448 Connect(idProgressDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemProgressDlgSelected);
449 Connect(idRichTextFormattingDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemRichTextFormattingDlgSelected);
450 Connect(idRichTextStyleOrganiserDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemRichTextStyleOrganiserDlgSelected);
451 Connect(idTextEntryDlg,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemTextEntryDlgSelected);
452 Connect(idCheckNetworkStatus,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnMenuItemCheckNetworkStatus);
453 Connect(idHtmlEasyPrint,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnHtmlEasyPrint);
454 Connect(idHtmlEasyPageSetup,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnHtmlEasyPageSetup);
455 Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxSmithDemoFrame::OnAbout);
456 //*)
457
458 Init();
459 }
460
~wxSmithDemoFrame()461 wxSmithDemoFrame::~wxSmithDemoFrame()
462 {
463 }
464
Init()465 void wxSmithDemoFrame::Init()
466 {
467 CreateStyles();
468 WriteInitialText();
469 InitWithListItems();
470 InitGridBag();
471 InitTreebook();
472
473 #if wxUSE_STATUSBAR
474 SetStatusText(wxT("wxDialUpManager:"), 1);
475 SetStatusText(DialUpManager1->IsAlwaysOnline() ? _("LAN") : _("No LAN"), 2);
476 #endif
477
478 // Let's use the new wxImage tool to obtain a bitmap for the static bitmap.
479 StaticBitmap1->SetBitmap(wxBitmap(*Image1));
480 }
481
OnQuit(wxCommandEvent & event)482 void wxSmithDemoFrame::OnQuit(wxCommandEvent& event)
483 {
484 Close();
485 }
486
OnAbout(wxCommandEvent & event)487 void wxSmithDemoFrame::OnAbout(wxCommandEvent& event)
488 {
489 wxAboutDialogInfo info;
490 info.SetName(wxT("wxSmithDemo"));
491 info.SetVersion(wxString::Format(wxT("%d.%d.%d.%d %s"), AutoVersion::MAJOR, AutoVersion::MINOR, AutoVersion::BUILD, AutoVersion::REVISION, wxString(AutoVersion::STATUS, wxConvUTF8).c_str()));
492 info.SetDescription(_("This program demonstrates controls\nrecently added to wxSmith, the GUI\neditor plug-in for Code::Blocks IDE."));
493 info.SetCopyright(_T("Copyright (C) 2010 Gary Harris"));
494 info.AddDeveloper(wxT("Gary Harris"));
495 // info.AddTranslator(wxT("Gary Harris"));
496 info.SetName(wxTheApp->GetAppName());
497 info.SetWebSite(wxT("http://wxsmithaddons.sourceforge.net/"));
498 wxString sLicence(_("wxDemoApp is released under the\nterms of the wxWidgets Licence.\n\n"));
499 sLicence.Append(_("Parts of the wxWidgets sample\napplications are used under\nthe terms of the\nwxWidgets licence.\n\n"));
500 sLicence.Append(_("EarthImpactSml_512kb.mp4 is used\nunder the terms of the Creative\nCommons licence."));
501 info.SetLicence(sLicence);
502
503 wxAboutBox(info);
504 }
505
506 // -- Utility functions.
LogString(wxString s)507 void wxSmithDemoFrame::LogString(wxString s)
508 {
509 ListBoxLog->Append(s);
510 ListBoxLog->SetFirstItem(ListBoxLog->GetCount() - 1);
511 }
512
513 // Create styles and add them to the pre-created wxRichTextStyleSheet and the wxRichTextCtrl.
CreateStyles()514 void wxSmithDemoFrame::CreateStyles()
515 {
516 // Paragraph styles
517 wxFont romanFont(12, wxROMAN, wxNORMAL, wxNORMAL);
518 wxFont swissFont(12, wxSWISS, wxNORMAL, wxNORMAL);
519
520 wxRichTextParagraphStyleDefinition* normalPara = new wxRichTextParagraphStyleDefinition(wxT("Normal"));
521 wxRichTextAttr normalAttr;
522 normalAttr.SetFontFaceName(romanFont.GetFaceName());
523 normalAttr.SetFontSize(12);
524 // Let's set all attributes for this style
525 normalAttr.SetFlags(wxTEXT_ATTR_FONT | wxTEXT_ATTR_BACKGROUND_COLOUR | wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|
526 wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|
527 wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER);
528 normalPara->SetStyle(normalAttr);
529
530 richTextStyleSheet_1->AddParagraphStyle(normalPara);
531
532 wxRichTextParagraphStyleDefinition* indentedPara = new wxRichTextParagraphStyleDefinition(wxT("Indented"));
533 wxRichTextAttr indentedAttr;
534 indentedAttr.SetFontFaceName(romanFont.GetFaceName());
535 indentedAttr.SetFontSize(12);
536 indentedAttr.SetLeftIndent(100, 0);
537 // We only want to affect indentation
538 indentedAttr.SetFlags(wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT);
539 indentedPara->SetStyle(indentedAttr);
540
541 richTextStyleSheet_1->AddParagraphStyle(indentedPara);
542
543 wxRichTextParagraphStyleDefinition* indentedPara2 = new wxRichTextParagraphStyleDefinition(wxT("Red Bold Indented"));
544 wxRichTextAttr indentedAttr2;
545 indentedAttr2.SetFontFaceName(romanFont.GetFaceName());
546 indentedAttr2.SetFontSize(12);
547 indentedAttr2.SetFontWeight(wxBOLD);
548 indentedAttr2.SetTextColour(*wxRED);
549 indentedAttr2.SetFontSize(12);
550 indentedAttr2.SetLeftIndent(100, 0);
551 // We want to affect indentation, font and text colour
552 indentedAttr2.SetFlags(wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_FONT|wxTEXT_ATTR_TEXT_COLOUR);
553 indentedPara2->SetStyle(indentedAttr2);
554
555 richTextStyleSheet_1->AddParagraphStyle(indentedPara2);
556
557 wxRichTextParagraphStyleDefinition* flIndentedPara = new wxRichTextParagraphStyleDefinition(wxT("First Line Indented"));
558 wxRichTextAttr flIndentedAttr;
559 flIndentedAttr.SetFontFaceName(swissFont.GetFaceName());
560 flIndentedAttr.SetFontSize(12);
561 flIndentedAttr.SetLeftIndent(100, -100);
562 // We only want to affect indentation
563 flIndentedAttr.SetFlags(wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT);
564 flIndentedPara->SetStyle(flIndentedAttr);
565
566 richTextStyleSheet_1->AddParagraphStyle(flIndentedPara);
567
568 // Character styles
569
570 wxRichTextCharacterStyleDefinition* boldDef = new wxRichTextCharacterStyleDefinition(wxT("Bold"));
571 wxRichTextAttr boldAttr;
572 boldAttr.SetFontFaceName(romanFont.GetFaceName());
573 boldAttr.SetFontSize(12);
574 boldAttr.SetFontWeight(wxBOLD);
575 // We only want to affect boldness
576 boldAttr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
577 boldDef->SetStyle(boldAttr);
578
579 richTextStyleSheet_1->AddCharacterStyle(boldDef);
580
581 wxRichTextCharacterStyleDefinition* italicDef = new wxRichTextCharacterStyleDefinition(wxT("Italic"));
582 wxRichTextAttr italicAttr;
583 italicAttr.SetFontFaceName(romanFont.GetFaceName());
584 italicAttr.SetFontSize(12);
585 italicAttr.SetFontStyle(wxITALIC);
586 // We only want to affect italics
587 italicAttr.SetFlags(wxTEXT_ATTR_FONT_ITALIC);
588 italicDef->SetStyle(italicAttr);
589
590 richTextStyleSheet_1->AddCharacterStyle(italicDef);
591
592 wxRichTextCharacterStyleDefinition* redDef = new wxRichTextCharacterStyleDefinition(wxT("Red Bold"));
593 wxRichTextAttr redAttr;
594 redAttr.SetFontFaceName(romanFont.GetFaceName());
595 redAttr.SetFontSize(12);
596 redAttr.SetFontWeight(wxBOLD);
597 redAttr.SetTextColour(*wxRED);
598 // We only want to affect colour, weight and face
599 redAttr.SetFlags(wxTEXT_ATTR_FONT_FACE|wxTEXT_ATTR_FONT_WEIGHT|wxTEXT_ATTR_TEXT_COLOUR);
600 redDef->SetStyle(redAttr);
601
602 richTextStyleSheet_1->AddCharacterStyle(redDef);
603
604 wxRichTextListStyleDefinition* bulletList = new wxRichTextListStyleDefinition(wxT("Bullet List 1"));
605 int i;
606 for (i = 0; i < 10; i++)
607 {
608 wxString bulletText;
609 if (i == 0)
610 bulletText = wxT("standard/circle");
611 else if (i == 1)
612 bulletText = wxT("standard/square");
613 else if (i == 2)
614 bulletText = wxT("standard/circle");
615 else if (i == 3)
616 bulletText = wxT("standard/square");
617 else
618 bulletText = wxT("standard/circle");
619
620 bulletList->SetAttributes(i, (i+1)*60, 60, wxTEXT_ATTR_BULLET_STYLE_STANDARD, bulletText);
621 }
622
623 richTextStyleSheet_1->AddListStyle(bulletList);
624
625 wxRichTextListStyleDefinition* numberedList = new wxRichTextListStyleDefinition(wxT("Numbered List 1"));
626 for (i = 0; i < 10; i++)
627 {
628 long numberStyle;
629 if (i == 0)
630 numberStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD;
631 else if (i == 1)
632 numberStyle = wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER|wxTEXT_ATTR_BULLET_STYLE_PARENTHESES;
633 else if (i == 2)
634 numberStyle = wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER|wxTEXT_ATTR_BULLET_STYLE_PARENTHESES;
635 else if (i == 3)
636 numberStyle = wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER|wxTEXT_ATTR_BULLET_STYLE_PARENTHESES;
637 else
638 numberStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD;
639
640 numberStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT;
641
642 numberedList->SetAttributes(i, (i+1)*60, 60, numberStyle);
643 }
644
645 richTextStyleSheet_1->AddListStyle(numberedList);
646
647 wxRichTextListStyleDefinition* outlineList = new wxRichTextListStyleDefinition(wxT("Outline List 1"));
648 for (i = 0; i < 10; i++)
649 {
650 long numberStyle;
651 if (i < 4)
652 numberStyle = wxTEXT_ATTR_BULLET_STYLE_OUTLINE|wxTEXT_ATTR_BULLET_STYLE_PERIOD;
653 else
654 numberStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD;
655
656 outlineList->SetAttributes(i, (i+1)*120, 120, numberStyle);
657 }
658
659 richTextStyleSheet_1->AddListStyle(outlineList);
660
661 RichTextCtrl1->SetStyleSheet(richTextStyleSheet_1);
662 //
663 RichTextStyleComboCtrl1->SetStyleSheet(richTextStyleSheet_1);
664 RichTextStyleComboCtrl1->UpdateStyles();
665 RichTextStyleListBox1->SetStyleSheet(richTextStyleSheet_1);
666 RichTextStyleListBox1->UpdateStyles();
667 }
668
669 // Initialise the wxRichTextCtrl.
WriteInitialText()670 void wxSmithDemoFrame::WriteInitialText()
671 {
672 wxRichTextCtrl& r = *RichTextCtrl1;
673
674 r.Newline();
675 r.WriteText(wxT("This is "));
676 r.WriteText(wxT("wxRichTextCtrl."));
677 r.Newline();
678 r.Newline();
679 r.WriteText(wxT("The styles you set in wxSmith are used to set the basic styles for the control. Other styles are layered on top of them."));
680 r.WriteText(wxT("You will still want to set and apply your detailed styles as per the wxWidgets Rich Text sample. The text below the line that follows is from Julian's wxWidgets sample application. "));
681 r.WriteText(wxT("You can play around with the settings in wxSmith to see how they affect the display."));
682 r.Newline();
683 r.Newline();
684 r.Newline();
685 r.WriteText(wxT("====================================================="));
686 r.Newline();
687 r.Newline();
688
689 r.SetDefaultStyle(wxRichTextAttr());
690
691 r.BeginSuppressUndo();
692
693 r.BeginParagraphSpacing(0, 20);
694
695 r.BeginAlignment(wxTEXT_ALIGNMENT_CENTRE);
696 r.BeginBold();
697
698 r.BeginFontSize(14);
699
700 wxString lineBreak = (wxChar) 29;
701
702 r.WriteText(wxString(wxT("Welcome to wxRichTextCtrl, a wxWidgets control")) + lineBreak + wxT("for editing and presenting styled text and images\n"));
703 r.EndFontSize();
704 //r.Newline();
705
706 r.BeginItalic();
707 r.WriteText(wxT("by Julian Smart"));
708 r.EndItalic();
709
710 r.EndBold();
711 r.Newline();
712
713 r.WriteImage(wxBitmap(zebra_xpm));
714
715 r.Newline();
716 r.Newline();
717
718 r.EndAlignment();
719
720 r.WriteText(wxT("What can you do with this thing? "));
721
722 r.WriteImage(wxBitmap(smiley_xpm));
723 r.WriteText(wxT(" Well, you can change text "));
724
725 r.BeginTextColour(wxColour(255, 0, 0));
726 r.WriteText(wxT("colour, like this red bit."));
727 r.EndTextColour();
728
729 wxRichTextAttr backgroundColourAttr;
730 backgroundColourAttr.SetBackgroundColour(*wxGREEN);
731 backgroundColourAttr.SetTextColour(wxColour(0, 0, 255));
732 r.BeginStyle(backgroundColourAttr);
733 r.WriteText(wxT(" And this blue on green bit."));
734 r.EndStyle();
735
736 r.WriteText(wxT(" Naturally you can make things "));
737 r.BeginBold();
738 r.WriteText(wxT("bold "));
739 r.EndBold();
740 r.BeginItalic();
741 r.WriteText(wxT("or italic "));
742 r.EndItalic();
743 r.BeginUnderline();
744 r.WriteText(wxT("or underlined."));
745 r.EndUnderline();
746
747 r.BeginFontSize(14);
748 r.WriteText(wxT(" Different font sizes on the same line is allowed, too."));
749 r.EndFontSize();
750
751 r.WriteText(wxT(" Next we'll show an indented paragraph."));
752
753 r.Newline();
754
755 r.BeginLeftIndent(60);
756 r.WriteText(wxT("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable."));
757 r.Newline();
758
759 r.EndLeftIndent();
760
761 r.WriteText(wxT("Next, we'll show a first-line indent, achieved using BeginLeftIndent(100, -40)."));
762
763 r.Newline();
764
765 r.BeginLeftIndent(100, -40);
766
767 r.WriteText(wxT("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable."));
768 r.Newline();
769
770 r.EndLeftIndent();
771
772 r.WriteText(wxT("Numbered bullets are possible, again using subindents:"));
773 r.Newline();
774
775 r.BeginNumberedBullet(1, 100, 60);
776 r.WriteText(wxT("This is my first item. Note that wxRichTextCtrl can apply numbering and bullets automatically based on list styles, but this list is formatted explicitly by setting indents."));
777 r.Newline();
778
779 r.EndNumberedBullet();
780
781 r.BeginNumberedBullet(2, 100, 60);
782 r.WriteText(wxT("This is my second item."));
783 r.Newline();
784
785 r.EndNumberedBullet();
786
787 r.WriteText(wxT("The following paragraph is right-indented:"));
788 r.Newline();
789
790 r.BeginRightIndent(200);
791
792 r.WriteText(wxT("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable."));
793 r.Newline();
794
795 r.EndRightIndent();
796
797 r.WriteText(wxT("The following paragraph is right-aligned with 1.5 line spacing:"));
798 r.Newline();
799
800 r.BeginAlignment(wxTEXT_ALIGNMENT_RIGHT);
801 r.BeginLineSpacing(wxTEXT_ATTR_LINE_SPACING_HALF);
802 r.WriteText(wxT("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable."));
803 r.Newline();
804 r.EndLineSpacing();
805 r.EndAlignment();
806
807 wxArrayInt tabs;
808 tabs.Add(400);
809 tabs.Add(600);
810 tabs.Add(800);
811 tabs.Add(1000);
812 wxTextAttrEx attr;
813 attr.SetFlags(wxTEXT_ATTR_TABS);
814 attr.SetTabs(tabs);
815 r.SetDefaultStyle(attr);
816
817 r.WriteText(wxT("This line contains tabs:\tFirst tab\tSecond tab\tThird tab"));
818 r.Newline();
819
820 r.WriteText(wxT("Other notable features of wxRichTextCtrl include:"));
821 r.Newline();
822
823 r.BeginSymbolBullet(wxT('*'), 100, 60);
824 r.WriteText(wxT("Compatibility with wxTextCtrl API"));
825 r.Newline();
826 r.EndSymbolBullet();
827
828 r.BeginSymbolBullet(wxT('*'), 100, 60);
829 r.WriteText(wxT("Easy stack-based BeginXXX()...EndXXX() style setting in addition to SetStyle()"));
830 r.Newline();
831 r.EndSymbolBullet();
832
833 r.BeginSymbolBullet(wxT('*'), 100, 60);
834 r.WriteText(wxT("XML loading and saving"));
835 r.Newline();
836 r.EndSymbolBullet();
837
838 r.BeginSymbolBullet(wxT('*'), 100, 60);
839 r.WriteText(wxT("Undo/Redo, with batching option and Undo suppressing"));
840 r.Newline();
841 r.EndSymbolBullet();
842
843 r.BeginSymbolBullet(wxT('*'), 100, 60);
844 r.WriteText(wxT("Clipboard copy and paste"));
845 r.Newline();
846 r.EndSymbolBullet();
847
848 r.BeginSymbolBullet(wxT('*'), 100, 60);
849 r.WriteText(wxT("wxRichTextStyleSheet with named character and paragraph styles, and control for applying named styles"));
850 r.Newline();
851 r.EndSymbolBullet();
852
853 r.BeginSymbolBullet(wxT('*'), 100, 60);
854 r.WriteText(wxT("A design that can easily be extended to other content types, ultimately with text boxes, tables, controls, and so on"));
855 r.Newline();
856 r.EndSymbolBullet();
857
858 // Make a style suitable for showing a URL
859 wxRichTextAttr urlStyle;
860 urlStyle.SetTextColour(*wxBLUE);
861 urlStyle.SetFontUnderlined(true);
862
863 r.WriteText(wxT("wxRichTextCtrl can also display URLs, such as this one: "));
864 r.BeginStyle(urlStyle);
865 r.BeginURL(wxT("http://www.wxwidgets.org"));
866 r.WriteText(wxT("The wxWidgets Web Site"));
867 r.EndURL();
868 r.EndStyle();
869 r.WriteText(wxT(". Click on the URL to generate an event."));
870
871 r.Newline();
872
873 r.WriteText(wxT("Note: this sample content was generated programmatically from within the MyFrame constructor in the demo. The images were loaded from inline XPMs. Enjoy wxRichTextCtrl!"));
874
875 r.Newline();
876
877 r.EndParagraphSpacing();
878
879 r.EndSuppressUndo();
880 }
881
882 // Initialise the wxListView control.
InitWithListItems()883 void wxSmithDemoFrame::InitWithListItems()
884 {
885 for(int i = 0; i < 30; i++ ){
886 ListView1->InsertItem(i, wxString::Format(_T("Item %d"), i));
887 }
888 }
889
890 // Initialise the wxTreebook.
InitTreebook()891 void wxSmithDemoFrame::InitTreebook()
892 {
893 wxPanel *Panel99 = new wxPanel(Treebook1 , ID_PANEL99, wxPoint(0, 0), wxDefaultSize, wxTAB_TRAVERSAL|wxSTATIC_BORDER, _T("ID_PANEL99"));
894 // wxStaticText *text = new wxStaticText(Panel99, wxNewId(), wxString(_("This is a sub-page.")), wxPoint(88, 96));
895 Treebook1->InsertSubPage(0, Panel99, wxT("1-1"));
896 Treebook1->InsertSubPage(0, Panel99, wxT("1-2"));
897 Treebook1->InsertSubPage(3, Panel99, wxT("2-1"));
898 Treebook1->InsertSubPage(4, Panel99, wxT("2-1-1"));
899 Treebook1->InsertSubPage(5, Panel99, wxT("2-1-1-1"));
900 }
901
902 // -- wxGridBagSizer
903 /*
904 // some simple macros to help make the sample code below more clear
905 #define TEXTCTRL(text) new wxTextCtrl(Panel6, wxID_ANY, _T(text))
906 #define MLTEXTCTRL(text) new wxTextCtrl(Panel6, wxID_ANY, _T(text), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE)
907 #define POS(r, c) wxGBPosition(r,c)
908 #define SPAN(r, c) wxGBSpan(r,c)
909
910 const wxChar gbsDescription[] =_T("\
911 The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\
912 in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\
913 static text is positioned at (0,0) and it spans 7 columns.");
914
915 // Some IDs
916 enum {
917 GBS_HIDE_BTN = 1212,
918 GBS_SHOW_BTN,
919 GBS_MOVE_BTN1,
920 GBS_MOVE_BTN2,
921
922 GBS_MAX
923 };
924 */
InitGridBag()925 void wxSmithDemoFrame::InitGridBag()
926 {
927 // GridBagSizer2->Add( new wxStaticText(Panel6, wxID_ANY, gbsDescription), POS(0,0), SPAN(1, 7), wxALIGN_CENTER | wxALL, 5);
928 //
929 // GridBagSizer2->Add( TEXTCTRL("pos(1,0)"), POS(1,0) );
930 // GridBagSizer2->Add( TEXTCTRL("pos(1,1)"), POS(1,1) );
931 // GridBagSizer2->Add( TEXTCTRL("pos(2,0)"), POS(2,0) );
932 // GridBagSizer2->Add( TEXTCTRL("pos(2,1)"), POS(2,1) );
933 // GridBagSizer2->Add( MLTEXTCTRL("pos(3,2), span(1,2)\nthis row and col are growable"), POS(3,2), SPAN(1,2), wxEXPAND );
934 // GridBagSizer2->Add( MLTEXTCTRL("pos(4,3)\nspan(3,1)"), POS(4,3), SPAN(3,1), wxEXPAND );
935 // GridBagSizer2->Add( TEXTCTRL("pos(5,4)"), POS(5,4), wxDefaultSpan, wxEXPAND );
936 // GridBagSizer2->Add( TEXTCTRL("pos(6,5)"), POS(6,5), wxDefaultSpan, wxEXPAND );
937 // GridBagSizer2->Add( TEXTCTRL("pos(7,6)"), POS(7,6) );
938 //
939 // //GridBagSizer2->Add( TEXTCTRL("bad position"), POS(4,3) ); // Test for assert
940 // //GridBagSizer2->Add( TEXTCTRL("bad position"), POS(5,3) ); // Test for assert
941 //
942 //
943 // wxButton *m_moveBtn1 = new wxButton(Panel6, GBS_MOVE_BTN1, _T("Move this to (3,6)"));
944 // wxButton *m_moveBtn2 = new wxButton(Panel6, GBS_MOVE_BTN2, _T("Move this to (3,6)"));
945 // GridBagSizer2->Add( m_moveBtn1, POS(10,2) );
946 // GridBagSizer2->Add( m_moveBtn2, POS(10,3) );
947 //
948 // wxButton *m_hideBtn = new wxButton(Panel6, GBS_HIDE_BTN, _T("Hide this item -->"));
949 // GridBagSizer2->Add(m_hideBtn, POS(12, 3));
950 //
951 // wxTextCtrl *m_hideTxt = new wxTextCtrl(Panel6, wxID_ANY, _T("pos(12,4), size(150, wxDefaultCoord)"), wxDefaultPosition, wxSize(150,wxDefaultCoord));
952 // GridBagSizer2->Add( m_hideTxt, POS(12,4) );
953 //
954 // wxButton *m_showBtn = new wxButton(Panel6, GBS_SHOW_BTN, _T("<-- Show it again"));
955 // GridBagSizer2->Add(m_showBtn, POS(12, 5));
956 // m_showBtn->Disable();
957 //
958 // GridBagSizer2->Add(10,10, POS(14,0));
959 //
960 // GridBagSizer2->AddGrowableRow(3);
961 // GridBagSizer2->AddGrowableCol(2);
962 //
963 // Panel6->SetSizerAndFit(GridBagSizer2);
964 //// SetClientSize(Panel6->GetSize());
965 }
966
967 // -- wxNotebook
968
OnNotebook1PageChanged(wxNotebookEvent & event)969 void wxSmithDemoFrame::OnNotebook1PageChanged(wxNotebookEvent& event)
970 {
971 if(event.GetSelection() == 6){
972 LogString(wxString::Format(_("Rich Text Controls: Styles will be applied to the wxRichTextCtrl tab.")));
973 }
974 }
975
976 // -- wxDialUpManager --
977
OnDialUpManager1Connected(wxDialUpEvent & event)978 void wxSmithDemoFrame::OnDialUpManager1Connected(wxDialUpEvent& event)
979 {
980 wxMessageBox(_("Network connected."));
981 }
982
OnDialUpManager1Disconnected(wxDialUpEvent & event)983 void wxSmithDemoFrame::OnDialUpManager1Disconnected(wxDialUpEvent& event)
984 {
985 wxMessageBox(_("Network disconnected."));
986 }
987
OnMenuItemCheckNetworkStatus(wxCommandEvent & event)988 void wxSmithDemoFrame::OnMenuItemCheckNetworkStatus(wxCommandEvent& event)
989 {
990 if(DialUpManager1->IsOnline())
991 wxLogMessage(_("Network is online."));
992 else
993 wxLogMessage(_("Network is offline."));
994 }
995
996 // -- wxBitmapComboBox --
997
OnBitmapComboBox1Selected(wxCommandEvent & event)998 void wxSmithDemoFrame::OnBitmapComboBox1Selected(wxCommandEvent& event)
999 {
1000 wxString s = BitmapComboBox1->GetString(event.GetSelection());
1001 LogString(wxString::Format(_("wxBitmapComboBox: You selected \"%s\"."), s.c_str()));
1002 }
1003
OnBitmapComboBox1TextEnter(wxCommandEvent & event)1004 void wxSmithDemoFrame::OnBitmapComboBox1TextEnter(wxCommandEvent& event)
1005 {
1006 LogString(wxString::Format(_("wxBitmapComboBox: You pressed \"Enter\". Value: %s"), event.GetString().c_str()));
1007 }
1008
1009 // -- wxSimpleHtmlListBox --
1010
OnSimpleHtmlListBox1Select(wxCommandEvent & event)1011 void wxSmithDemoFrame::OnSimpleHtmlListBox1Select(wxCommandEvent& event)
1012 {
1013 LogString(wxString::Format(_("wxSimpleHtmlListBox: Mouse clicked over item %d."), event.GetSelection()));
1014 }
1015
OnSimpleHtmlListBox1CellClicked(wxHtmlCellEvent & event)1016 void wxSmithDemoFrame::OnSimpleHtmlListBox1CellClicked(wxHtmlCellEvent& event)
1017 {
1018 LogString(wxString::Format(_("wxSimpleHtmlListBox: Click over cell %p at %d;%d."), event.GetCell(), event.GetPoint().x, event.GetPoint().y));
1019
1020 // if we don't skip the event, OnSimpleHtmlListBox1LinkClicked() won't be called!
1021 event.Skip();
1022 }
1023
OnSimpleHtmlListBox1CellHover(wxHtmlCellEvent & event)1024 void wxSmithDemoFrame::OnSimpleHtmlListBox1CellHover(wxHtmlCellEvent& event)
1025 {
1026 LogString(wxString::Format(_("wxSimpleHtmlListBox: The mouse moved over cell %p at %d;%d."), event.GetCell(), event.GetPoint().x, event.GetPoint().y));
1027 }
1028
OnSimpleHtmlListBox1LinkClicked(wxHtmlLinkEvent & event)1029 void wxSmithDemoFrame::OnSimpleHtmlListBox1LinkClicked(wxHtmlLinkEvent& event)
1030 {
1031 LogString(wxString::Format(_("wxSimpleHtmlListBox: The url '%s' was clicked."), event.GetLinkInfo().GetHref().c_str()));
1032 }
1033
1034 // -- wxSearchCtrl --
1035
OnSearchCtrl1SearchClicked(wxCommandEvent & event)1036 void wxSmithDemoFrame::OnSearchCtrl1SearchClicked(wxCommandEvent& event)
1037 {
1038 LogString(wxString::Format(_("wxSearchCtrl: You clicked the Search button.")));
1039 }
1040
OnSearchCtrl1CancelClicked(wxCommandEvent & event)1041 void wxSmithDemoFrame::OnSearchCtrl1CancelClicked(wxCommandEvent& event)
1042 {
1043 LogString(wxString::Format(_("wxSearchCtrl: You clicked the Cancel button.")));
1044 }
1045
OnSearchCtrl1TextEnter(wxCommandEvent & event)1046 void wxSmithDemoFrame::OnSearchCtrl1TextEnter(wxCommandEvent& event)
1047 {
1048 LogString(wxString::Format(_("wxSearchCtrl: You presses Enter.")));
1049 }
1050
OnSearchCtrl1Text(wxCommandEvent & event)1051 void wxSmithDemoFrame::OnSearchCtrl1Text(wxCommandEvent& event)
1052 {
1053 LogString(wxString::Format(_("wxSearchCtrl: You entered some text.")));
1054 }
1055
1056 // -- wxHtmlEasyPrinting --
1057
OnHtmlEasyPrint(wxCommandEvent & event)1058 void wxSmithDemoFrame::OnHtmlEasyPrint(wxCommandEvent& event)
1059 {
1060 LogString(wxString::Format(_("wxHtmlEasyPrinting: Printing output to a directory called 'help' in the application directory.")));
1061 HtmlEasyPrinting1->PrintFile(wxT("html/subsup.html"));
1062 }
1063
OnHtmlEasyPageSetup(wxCommandEvent & event)1064 void wxSmithDemoFrame::OnHtmlEasyPageSetup(wxCommandEvent& event)
1065 {
1066 LogString(wxString::Format(_("wxHtmlEasyPrinting: Running the page setup dialogue.")));
1067 HtmlEasyPrinting1->PageSetup();
1068 }
1069
1070 // -- wxRichTextCtrl
1071
OnRichTextCtrl1Text(wxCommandEvent & event)1072 void wxSmithDemoFrame::OnRichTextCtrl1Text(wxCommandEvent& event)
1073 {
1074 LogString(wxString::Format(_("wxRichTextCtrl: You entered some text.")));
1075 }
1076
OnRichTextCtrl1TextEnter(wxCommandEvent & event)1077 void wxSmithDemoFrame::OnRichTextCtrl1TextEnter(wxCommandEvent& event)
1078 {
1079 LogString(wxString::Format(_("wxRichTextCtrl: You pressed Enter.")));
1080 }
1081
OnRichTextCtrl1TextUrl(wxTextUrlEvent & event)1082 void wxSmithDemoFrame::OnRichTextCtrl1TextUrl(wxTextUrlEvent& event)
1083 {
1084 LogString(wxString::Format(_("wxRichTextCtrl: You clicked the URL.")));
1085 }
1086
1087 // -- Menus
1088 // - wxFindReplaceDialog
1089
OnMenuItemFindReplaceDlgSelected(wxCommandEvent & event)1090 void wxSmithDemoFrame::OnMenuItemFindReplaceDlgSelected(wxCommandEvent& event)
1091 {
1092 // You don't actually gain a lot by creating a wxFindReplaceDialog as it has to be recycled, anyway.
1093 // It does create the wxFindReplaceData object for you, though.
1094 // wxFindReplaceDialog is always, by design and implementation, modeless.
1095 LogString(wxString::Format(_("wxFindReplaceDialog: Running.")));
1096 if(!FindReplaceDialog1){
1097 FindReplaceDialog1 = new wxFindReplaceDialog(this, &findReplaceData_1, _("wxFindReplaceDialog"), wxFR_REPLACEDIALOG);
1098 }
1099 FindReplaceDialog1->Show();
1100 }
1101
1102 // ***** IMPORTANT ***** IMPORTANT***** IMPORTANT***** IMPORTANT ***** IMPORTANT *****
1103 //
1104 // For events to work the id of your wxFindReplaceDialog MUST be set to -1.
1105 //
1106 // ***** IMPORTANT ***** IMPORTANT***** IMPORTANT***** IMPORTANT ***** IMPORTANT *****
1107
OnFindReplaceDialog1Find(wxFindDialogEvent & event)1108 void wxSmithDemoFrame::OnFindReplaceDialog1Find(wxFindDialogEvent& event)
1109 {
1110 LogString(wxString::Format(_("wxFindReplaceDialog: You clicked Find.")));
1111 }
1112
OnFindReplaceDialog1FindNext(wxFindDialogEvent & event)1113 void wxSmithDemoFrame::OnFindReplaceDialog1FindNext(wxFindDialogEvent& event)
1114 {
1115 LogString(wxString::Format(_("wxFindReplaceDialog: You clicked Find Next.")));
1116 }
1117
OnFindReplaceDialog1Close(wxFindDialogEvent & event)1118 void wxSmithDemoFrame::OnFindReplaceDialog1Close(wxFindDialogEvent& event)
1119 {
1120 LogString(wxString::Format(_("wxFindReplaceDialog: You pressed Cancel.")));
1121 wxDELETE(FindReplaceDialog1);
1122 wxASSERT(!FindReplaceDialog1);
1123 }
1124
1125 // - wxFontDialog
1126
OnMenuItemFontDlgSelected(wxCommandEvent & event)1127 void wxSmithDemoFrame::OnMenuItemFontDlgSelected(wxCommandEvent& event)
1128 {
1129 LogString(wxString::Format(_("wxFontDialog: Running.")));
1130 FontDialog1->ShowModal();
1131 }
1132
1133 // - wxMessageDialog
1134
OnMenuItemMessageDlgSelected(wxCommandEvent & event)1135 void wxSmithDemoFrame::OnMenuItemMessageDlgSelected(wxCommandEvent& event)
1136 {
1137 LogString(wxString::Format(_("wxMessageDialog: Running.")));
1138 MessageDialog1->ShowModal();
1139 }
1140
1141 // - wxPageSetupDialog
1142
1143 // Note: wxPageSetupDialog prefs set in wxSmith are only valid for the first run. You need to
1144 // reconfigure the associated wxPageSetupDialogData object for subsequent runs.
OnMenuItemPageSetupDlgSelected(wxCommandEvent & event)1145 void wxSmithDemoFrame::OnMenuItemPageSetupDlgSelected(wxCommandEvent& event)
1146 {
1147 LogString(wxString::Format(_("wxPageSetupDialog: Running.")));
1148 if(PageSetupDialog1->ShowModal() == wxID_OK){
1149 wxPageSetupDialogData setupData = PageSetupDialog1->GetPageSetupData();
1150 if(!setupData.IsOk()){
1151 LogString(wxString::Format(_("wxPageSetupDialog: Error getting setup data.")));
1152 return;
1153 }
1154 wxPoint ptTL = setupData.GetMarginTopLeft();
1155 wxPoint ptBR = setupData.GetMarginBottomRight();
1156 LogString(wxString::Format(_("wxPageSetupDialog: Margins: Top %d Left %d Bottom %d Right %d."), ptTL.y, ptTL.x, ptBR.y, ptBR.x));
1157 wxPaperSize paperID = setupData.GetPaperId();
1158 wxPrintPaperDatabase *paperDB = new wxPrintPaperDatabase;
1159 paperDB->CreateDatabase();
1160 wxString sPaper = paperDB->ConvertIdToName(paperID);
1161 if(!sPaper.IsEmpty()){
1162 LogString(wxString::Format(_("wxPageSetupDialog: Paper size: %s."), sPaper.c_str()));
1163 }
1164 else{
1165 LogString(wxString::Format(_("wxPageSetupDialog: Paper size: Not found in wxPrintPaperDatabase.")));
1166 }
1167 wxPrintData printData = setupData.GetPrintData();
1168 wxString sOrientation = printData.GetOrientation() == wxPORTRAIT ? wxString(_("Portrait")) : wxString(_("Landscape"));
1169 LogString(wxString::Format(_("wxPageSetupDialog: Paper size: %s."), sOrientation.c_str() ));
1170
1171 wxDELETE(paperDB);
1172 }
1173 else{
1174 LogString(wxString::Format(_("wxPageSetupDialog: You pressed Cancel.")));
1175 }
1176 }
1177
1178 // - wxPasswordEntryDialog
1179
OnMenuItemPasswordEntryDialogSelected(wxCommandEvent & event)1180 void wxSmithDemoFrame::OnMenuItemPasswordEntryDialogSelected(wxCommandEvent& event)
1181 {
1182 LogString(wxString::Format(_("wxPasswordEntryDialog: Running.")));
1183 if(PasswordEntryDialog1->ShowModal() == wxID_OK){
1184 LogString(wxString::Format(_("wxPasswordEntryDialog: You entered '%s'."), PasswordEntryDialog1->GetValue().c_str()));
1185 }
1186 else{
1187 LogString(wxString::Format(_("wxPasswordEntryDialog: You pressed Cancel.")));
1188 }
1189 }
1190
1191 // - wxPrintDialog
1192
1193 // You use wxPageSetupDialog and wxPrintDialog in applications that print documents. If you use the printing framework
1194 // (including wxPrintout, wxPrinter, and other classes), you won't need to invoke these dialogues explicitly in your code.
OnMenuItemPrintDlgSelected(wxCommandEvent & event)1195 void wxSmithDemoFrame::OnMenuItemPrintDlgSelected(wxCommandEvent& event)
1196 {
1197 LogString(wxString::Format(_("wxPrintDialog: Running.")));
1198 if(PrintDialog1->ShowModal() == wxID_OK){
1199 wxDC *dc = PrintDialog1->GetPrintDC(); // Get DC data from Printer Dialog.
1200 wxMemoryDC *dcMem = new wxMemoryDC;
1201
1202 dc->SetDeviceOrigin(1000, 100); // Set the origin of the printed bitmap on the paper.
1203 dc->SetUserScale(10, 10); // Set printer scale: if (1, 1), each pixel will correspond to a dot on the printer; so,
1204 // if your printer prints at 300 DPI, a 300 pixel wide image will be printed 1 inch wide.
1205 dc->StartDoc(_("printing...")); // Begin new document to be printed.
1206 dc->StartPage(); // Begin new page to be printed.
1207
1208 dc->DrawText(wxString(_("wxSmithDemo Test Page")), 100, 20);
1209 dc->DrawLine(20, 30, 300, 30);
1210 wxBitmap bmp(*Image1);
1211 dcMem->SelectObject(bmp); // "Enable" bitmap for "blitting".
1212 dc->DrawText(wxString(_("This image was created in wxSmith using the new wxImage tool.")), 20, 50);
1213 dc->Blit(20, 70, 400, 400, dcMem, 0, 0); // Copy bitmap into printer DC.
1214 dc->DrawText(wxString(_("Lets boogie...")), 20, 120);
1215 wxPen pen(*wxRED, 2);
1216 dc->SetPen(pen);
1217 dc->DrawCircle(100, 300, 100);
1218 dc->SetPen(*wxCYAN_PEN);
1219 dc->SetBrush(*wxCYAN_BRUSH);
1220 dc->DrawRoundedRectangle(wxPoint(180, 200), wxSize(150, 80), 30);
1221 dc->SetPen(*wxLIGHT_GREY_PEN);
1222 dc->SetBrush(*wxLIGHT_GREY_BRUSH);
1223 dc->DrawEllipse(wxPoint(-40, 320), wxSize(180, 100));
1224 dc->SetTextForeground(*wxGREEN);
1225 dc->DrawRotatedText(wxString(_("Some text rotated to 57 degrees")), 100, 300, 57);
1226 dc->DrawBitmap(wxBitmap(wxT("media/zebra.xpm"), wxBITMAP_TYPE_XPM), 50, 450);
1227 dc->SetTextForeground(*wxBLACK);
1228 dc->DrawText(wxString(_("That's all folks.")), 20, 650);
1229
1230 dcMem->SelectObject(wxNullBitmap); // Free the bitmap.
1231 dc->EndPage();
1232 dc->EndDoc();
1233
1234 wxDELETE(dc);
1235 wxDELETE(dcMem);
1236 }
1237 else{
1238 LogString(wxString::Format(_("wxPrintDialog: You pressed Cancel.")));
1239 }
1240 }
1241
1242 // - wxProgressDialog
1243
OnMenuItemProgressDlgSelected(wxCommandEvent & event)1244 void wxSmithDemoFrame::OnMenuItemProgressDlgSelected(wxCommandEvent& event)
1245 {
1246 LogString(wxString::Format(_("wxProgressDialog: Running.")));
1247
1248 int iMax = 50;
1249
1250 // ***** IMPORTANT ***** IMPORTANT***** IMPORTANT***** IMPORTANT ***** IMPORTANT *****
1251 //
1252 // wxSmith either creates an uninitialised pointer or initialises and runs the dialogue at start-up,
1253 // depending on the state of m_bRunAtStartup.
1254 // There is no way to initialise the dialogue without having it run at the same time, by design.
1255 //
1256 // IN THIS EXAMPLE, THE DLG IS NOT SET TO RUN AT STARTUP SO IT MUST BE INITIALISED HERE.
1257 //
1258 // ***** IMPORTANT ***** IMPORTANT***** IMPORTANT***** IMPORTANT ***** IMPORTANT *****
1259 ProgressDialog1 = new wxProgressDialog(_T("wxProgressDialog"),
1260 _T("An informative message"),
1261 iMax,
1262 this,
1263 wxPD_AUTO_HIDE |
1264 wxPD_APP_MODAL |
1265 wxPD_ELAPSED_TIME |
1266 wxPD_ESTIMATED_TIME |
1267 wxPD_REMAINING_TIME);
1268
1269 for ( int i = 0; i <= iMax; i++ )
1270 {
1271 wxMilliSleep(200);
1272
1273 wxString sMsg;
1274
1275 // test both modes of wxProgressDialog behaviour: start in
1276 // indeterminate mode but switch to the determinate one later
1277 const bool bDeterminate = i > iMax/2;
1278
1279 if ( i == iMax )
1280 {
1281 sMsg = _T("That's all, folks!");
1282 }
1283 else if ( !bDeterminate )
1284 {
1285 sMsg = _T("Testing indeterminate mode");
1286 }
1287 else if ( bDeterminate )
1288 {
1289 sMsg = _T("Now in standard determinate mode");
1290 }
1291
1292 // will be set to true if "Skip" button was pressed
1293 bool bSkip = false;
1294 if ( bDeterminate )
1295 {
1296 ProgressDialog1->Update(i, sMsg, &bSkip);
1297 }
1298 else
1299 {
1300 ProgressDialog1->Pulse(sMsg, &bSkip);
1301 }
1302 }
1303
1304 delete ProgressDialog1;
1305 }
1306
1307 // - wxRichTextFormattingDialog
1308
OnMenuItemRichTextFormattingDlgSelected(wxCommandEvent & event)1309 void wxSmithDemoFrame::OnMenuItemRichTextFormattingDlgSelected(wxCommandEvent& event)
1310 {
1311 LogString(wxString::Format(_("wxRichTextFormattingDialog: Running. Styles will be applied to the wxRichTextCtrl tab.")));
1312
1313 wxRichTextRange range;
1314 if(RichTextCtrl1->HasSelection()){
1315 range = RichTextCtrl1->GetSelectionRange();
1316 }
1317 else{
1318 range = wxRichTextRange(0, RichTextCtrl1->GetLastPosition()+1);
1319 }
1320 RichTextFormattingDialog1->GetStyle(RichTextCtrl1, range);
1321
1322 if(RichTextFormattingDialog1->ShowModal() == wxID_OK){
1323 LogString(wxString::Format(_("wxRichTextFormattingDialog: Applying format.")));
1324 RichTextFormattingDialog1->ApplyStyle(RichTextCtrl1, range);
1325 }
1326 else{
1327 LogString(wxString::Format(_("wxRichTextFormattingDialog: You pressed Cancel.")));
1328 }
1329 }
1330
1331 // - wxRichTextStyleOrganiserDialog
1332
1333 // The required wxRichTextStyleSheet is declared for you by wxSmith as richTextStyleSheet_1.
1334 // Styles are created in CreateStyles() and added to the style list and the control there.
1335 // wxRichTextStyleOrganiserDialog seems to have some issues in wx2.8.10.
1336 // The list of styles doesn't display until you change the selection in the drop-down list at the bottom of the dlg
1337 // and I can't get SetStyleSheet() to work at all.
OnMenuItemRichTextStyleOrganiserDlgSelected(wxCommandEvent & event)1338 void wxSmithDemoFrame::OnMenuItemRichTextStyleOrganiserDlgSelected(wxCommandEvent& event)
1339 {
1340 LogString(wxString::Format(_("wxRichTextStyleOrganiserDialog: Running. Styles will be applied to the wxRichTextCtrl tab.")));
1341 RichTextStyleOrganiserDialog1->SetRichTextCtrl(RichTextCtrl1);
1342 RichTextStyleOrganiserDialog1->ShowModal();
1343 }
1344
1345 // - wxTextEntryDialog
1346
OnMenuItemTextEntryDlgSelected(wxCommandEvent & event)1347 void wxSmithDemoFrame::OnMenuItemTextEntryDlgSelected(wxCommandEvent& event)
1348 {
1349 LogString(wxString::Format(_("wxTextEntryDialog: Running.")));
1350 if(TextEntryDialog1->ShowModal() == wxID_OK){
1351 LogString(wxString::Format(_("wxTextEntryDialog: You entered '%s'."), TextEntryDialog1->GetValue().c_str()));
1352 }
1353 else{
1354 LogString(wxString::Format(_("wxTextEntryDialog: You pressed Cancel.")));
1355 }
1356 }
1357
1358 // -- wxAnimationCtrl
1359
OnButtonPlayAnimationClick(wxCommandEvent & event)1360 void wxSmithDemoFrame::OnButtonPlayAnimationClick(wxCommandEvent& event)
1361 {
1362 LogString(wxString::Format(_("wxAnimationCtrl: Playing animation.")));
1363 AnimationCtrl1->Play();
1364 }
1365
OnButtonStopAnimationClick(wxCommandEvent & event)1366 void wxSmithDemoFrame::OnButtonStopAnimationClick(wxCommandEvent& event)
1367 {
1368 LogString(wxString::Format(_("wxAnimationCtrl: Stopping animation.")));
1369 AnimationCtrl1->Stop();
1370 }
1371
1372 // -- wxListView
1373
OnListView1ItemSelect(wxListEvent & event)1374 void wxSmithDemoFrame::OnListView1ItemSelect(wxListEvent& event)
1375 {
1376 LogString(wxString::Format(_("wxListView: You clicked %s."), event.GetItem().GetText().c_str()));
1377 }
1378
1379 // -- wxMediaCtrl
1380
OnMediaCtrl1Play(wxMediaEvent & event)1381 void wxSmithDemoFrame::OnMediaCtrl1Play(wxMediaEvent& event)
1382 {
1383 LogString(wxString::Format(_("wxMediaCtrl: Starting playback.")));
1384 }
1385
OnMediaCtrl1Pause(wxMediaEvent & event)1386 void wxSmithDemoFrame::OnMediaCtrl1Pause(wxMediaEvent& event)
1387 {
1388 LogString(wxString::Format(_("wxMediaCtrl: Pausing playback.")));
1389 }
1390
OnMediaCtrl1Stop(wxMediaEvent & event)1391 void wxSmithDemoFrame::OnMediaCtrl1Stop(wxMediaEvent& event)
1392 {
1393 LogString(wxString::Format(_("wxMediaCtrl: Stopping playback.")));
1394 }
1395
OnMediaCtrl1Finished(wxMediaEvent & event)1396 void wxSmithDemoFrame::OnMediaCtrl1Finished(wxMediaEvent& event)
1397 {
1398 LogString(wxString::Format(_("wxMediaCtrl: Playback finished.")));
1399 }
1400