~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmithContribItems/wxthings/wxthings/samples/things/thingsdemo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/////////////////////////////////////////////////////////////////////////////
2
 
// Name:        things.cpp
3
 
// Purpose:     wxThings control test program
4
 
// Author:      John Labenski
5
 
// Modified by:
6
 
// Created:     04/01/98
7
 
// RCS-ID:
8
 
// Copyright:   (c) John Labenski
9
 
// Licence:     wxWidgets licence
10
 
/////////////////////////////////////////////////////////////////////////////
11
 
 
12
 
// For compilers that support precompilation, includes "wx/wx.h".
13
 
#include "wx/wxprec.h"
14
 
 
15
 
#ifdef __BORLANDC__
16
 
    #pragma hdrstop
17
 
#endif
18
 
 
19
 
// for all others, include the necessary headers (this file is usually all you
20
 
// need because it includes almost all "standard" wxWidgets headers)
21
 
#ifndef WX_PRECOMP
22
 
    #include "wx/wx.h"
23
 
#endif
24
 
 
25
 
#include "wx/buffer.h"
26
 
#include "wx/image.h"
27
 
#include "wx/splitter.h"
28
 
#include "wx/tglbtn.h"
29
 
#include "wx/notebook.h"
30
 
#include "wx/things/toggle.h"
31
 
#include "wx/things/spinctld.h"
32
 
#include "wx/things/menubtn.h"
33
 
#include "wx/things/bmpcombo.h"
34
 
 
35
 
/* XPM */
36
 
static char *mondrian_xpm[] = {
37
 
/* columns rows colors chars-per-pixel */
38
 
"32 32 6 1",
39
 
"  c Black",
40
 
". c Blue",
41
 
"X c #00bf00",
42
 
"o c Red",
43
 
"O c Yellow",
44
 
"+ c Gray100",
45
 
/* pixels */
46
 
"                                ",
47
 
" oooooo +++++++++++++++++++++++ ",
48
 
" oooooo +++++++++++++++++++++++ ",
49
 
" oooooo +++++++++++++++++++++++ ",
50
 
" oooooo +++++++++++++++++++++++ ",
51
 
" oooooo +++++++++++++++++++++++ ",
52
 
" oooooo +++++++++++++++++++++++ ",
53
 
" oooooo +++++++++++++++++++++++ ",
54
 
"                                ",
55
 
" ++++++ ++++++++++++++++++ .... ",
56
 
" ++++++ ++++++++++++++++++ .... ",
57
 
" ++++++ ++++++++++++++++++ .... ",
58
 
" ++++++ ++++++++++++++++++ .... ",
59
 
" ++++++ ++++++++++++++++++ .... ",
60
 
" ++++++ ++++++++++++++++++      ",
61
 
" ++++++ ++++++++++++++++++ ++++ ",
62
 
" ++++++ ++++++++++++++++++ ++++ ",
63
 
" ++++++ ++++++++++++++++++ ++++ ",
64
 
" ++++++ ++++++++++++++++++ ++++ ",
65
 
" ++++++ ++++++++++++++++++ ++++ ",
66
 
" ++++++ ++++++++++++++++++ ++++ ",
67
 
" ++++++ ++++++++++++++++++ ++++ ",
68
 
" ++++++ ++++++++++++++++++ ++++ ",
69
 
" ++++++ ++++++++++++++++++ ++++ ",
70
 
" ++++++                    ++++ ",
71
 
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
72
 
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
73
 
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
74
 
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
75
 
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
76
 
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
77
 
"                                "};
78
 
 
79
 
// ----------------------------------------------------------------------------
80
 
// constants
81
 
// ----------------------------------------------------------------------------
82
 
 
83
 
enum
84
 
{
85
 
    Minimal_Quit,
86
 
    Minimal_About = wxID_ABOUT,
87
 
};
88
 
 
89
 
// ----------------------------------------------------------------------------
90
 
// MyFrame
91
 
// ----------------------------------------------------------------------------
92
 
 
93
 
class MyFrame : public wxFrame
94
 
{
95
 
public:
96
 
    MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
97
 
            long style = wxDEFAULT_FRAME_STYLE);
98
 
 
99
 
    virtual ~MyFrame() { }
100
 
 
101
 
    wxScrolledWindow *CreateButtonPage(wxWindow *parent);
102
 
 
103
 
    void OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(true); }
104
 
    void OnAbout(wxCommandEvent& event);
105
 
 
106
 
    void OnSpin(wxSpinEvent &event);
107
 
    void OnTextEnter(wxCommandEvent &event);
108
 
    void OnText(wxCommandEvent &event);
109
 
    void OnToggle(wxCommandEvent &event);
110
 
    void OnButton(wxCommandEvent &event);
111
 
    void OnMenu(wxCommandEvent &event);
112
 
    void OnComboBox(wxCommandEvent &event);
113
 
 
114
 
    wxTextCtrl *m_textCtrl;
115
 
 
116
 
    wxNotebook *m_notebook;
117
 
 
118
 
private:
119
 
    DECLARE_EVENT_TABLE()
120
 
};
121
 
 
122
 
// ----------------------------------------------------------------------------
123
 
// MyApp
124
 
// ----------------------------------------------------------------------------
125
 
 
126
 
class MyApp : public wxApp
127
 
{
128
 
public:
129
 
    virtual bool OnInit()
130
 
    {
131
 
        MyFrame *frame = new MyFrame(_T("Minimal wxWidgets App"),
132
 
                                 wxPoint(50, 50), wxSize(450, 400));
133
 
        frame->Show(true);
134
 
 
135
 
        return true;
136
 
    }
137
 
};
138
 
 
139
 
// ----------------------------------------------------------------------------
140
 
// event tables and other macros for wxWidgets
141
 
// ----------------------------------------------------------------------------
142
 
 
143
 
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
144
 
    EVT_MENU(Minimal_Quit,  MyFrame::OnQuit)
145
 
    EVT_MENU(Minimal_About, MyFrame::OnAbout)
146
 
 
147
 
    EVT_SPINCTRL    (wxID_ANY, MyFrame::OnSpin)
148
 
    EVT_TEXT_ENTER  (wxID_ANY, MyFrame::OnTextEnter)
149
 
    EVT_TEXT        (wxID_ANY, MyFrame::OnText)
150
 
    EVT_TOGGLEBUTTON(wxID_ANY, MyFrame::OnToggle)
151
 
    EVT_BUTTON      (wxID_ANY, MyFrame::OnButton)
152
 
    EVT_MENU        (wxID_ANY, MyFrame::OnMenu)
153
 
    EVT_COMBOBOX    (wxID_ANY, MyFrame::OnComboBox)
154
 
END_EVENT_TABLE()
155
 
 
156
 
IMPLEMENT_APP(MyApp)
157
 
 
158
 
// ----------------------------------------------------------------------------
159
 
// MyFrame
160
 
// ----------------------------------------------------------------------------
161
 
 
162
 
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
163
 
       : wxFrame(NULL, -1, title, pos, size, style)
164
 
{
165
 
#if wxUSE_MENUS
166
 
    wxMenu *menuFile = new wxMenu;
167
 
    menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
168
 
 
169
 
    wxMenu *helpMenu = new wxMenu;
170
 
    helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog"));
171
 
 
172
 
    wxMenuBar *menuBar = new wxMenuBar();
173
 
    menuBar->Append(menuFile, _T("&File"));
174
 
    menuBar->Append(helpMenu, _T("&Help"));
175
 
 
176
 
    SetMenuBar(menuBar);
177
 
#endif // wxUSE_MENUS
178
 
 
179
 
#if wxUSE_STATUSBAR
180
 
    // create a status bar just for fun (by default with 1 pane only)
181
 
    CreateStatusBar(2);
182
 
    SetStatusText(_T("Welcome to wxWidgets!"));
183
 
#endif // wxUSE_STATUSBAR
184
 
 
185
 
    wxInitAllImageHandlers();
186
 
 
187
 
    wxSplitterWindow *splitter = new wxSplitterWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D);
188
 
    splitter->SetMinimumPaneSize(20);
189
 
 
190
 
    m_textCtrl = new wxTextCtrl( splitter, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxVSCROLL|wxHSCROLL );
191
 
 
192
 
    m_notebook = new wxNotebook(splitter, -1);
193
 
 
194
 
    m_notebook->AddPage(CreateButtonPage(m_notebook), wxT("Controls"));
195
 
 
196
 
    splitter->SplitHorizontally(m_notebook, m_textCtrl, 300);
197
 
}
198
 
 
199
 
wxScrolledWindow *MyFrame::CreateButtonPage(wxWindow *parent)
200
 
{
201
 
    wxScrolledWindow *panel = new wxScrolledWindow(parent, -1);
202
 
    panel->SetScrollbars(1, 1, 2000, 2000);
203
 
 
204
 
    wxFlexGridSizer *item0 = new wxFlexGridSizer( 4, 0, 0 );
205
 
 
206
 
    wxBitmap mondrian(mondrian_xpm);
207
 
 
208
 
    int ID = 100;
209
 
 
210
 
    item0->Add(new wxStaticText(panel, -1, wxT("wxSpinCtrl constructor")), 0, wxALIGN_CENTRE|wxALL, 5 );
211
 
    item0->Add(new wxStaticText(panel, -1, wxT("Native constructor")), 0, wxALIGN_CENTRE|wxALL, 5 );
212
 
    item0->Add(new wxStaticText(panel, -1, wxT("Exponential")), 0, wxALIGN_CENTRE|wxALL, 5 );
213
 
    item0->Add(new wxStaticText(panel, -1, wxT("Default constructor")), 0, wxALIGN_CENTRE|wxALL, 5 );
214
 
 
215
 
    wxSpinCtrlDbl *item1 = new wxSpinCtrlDbl( panel, ID++, wxT("hello"), wxDefaultPosition, wxSize(100,-1), 0, 0, 100, 0 );
216
 
    item0->Add( item1, 0, wxALIGN_CENTRE|wxLEFT|wxRIGHT, 5 );
217
 
 
218
 
    wxSpinCtrlDbl *item2 = new wxSpinCtrlDbl( *panel, ID++, wxT("hello"), wxDefaultPosition, wxSize(100,-1), 0, 0, 100, .003, .001 );
219
 
    item0->Add( item2, 0, wxALIGN_CENTRE|wxALL, 5 );
220
 
 
221
 
    wxSpinCtrlDbl *item3 = new wxSpinCtrlDbl( *panel, ID++, wxT("hello"), wxDefaultPosition, wxSize(100,-1), 0, 0, 100, .003, .001 );
222
 
    item3->SetDigits(4, wxSpinCtrlDbl::lf_fmt);
223
 
    item0->Add( item3, 0, wxALIGN_CENTRE|wxALL, 5 );
224
 
 
225
 
    wxSpinCtrlDbl *item4 = new wxSpinCtrlDbl( panel, ID++, wxT("0"), wxDefaultPosition, wxSize(100,-1), 0, 0, 100, 0 );
226
 
    item0->Add( item4, 0, wxALIGN_CENTRE|wxALL, 5 );
227
 
 
228
 
    // next row
229
 
 
230
 
    item0->Add(new wxStaticText(panel, -1, wxT("wxButton")), 0, wxALIGN_CENTRE|wxALL, 5 );
231
 
    item0->Add(new wxStaticText(panel, -1, wxT("wxToggleButton")), 0, wxALIGN_CENTRE|wxALL, 5 );
232
 
    item0->Add(new wxStaticText(panel, -1, wxT("Button Dclick Toggle")), 0, wxALIGN_CENTRE|wxALL, 5 );
233
 
    item0->Add(new wxStaticText(panel, -1, wxT("Toggle Dclick Button")), 0, wxALIGN_CENTRE|wxALL, 5 );
234
 
 
235
 
    // next row
236
 
 
237
 
    wxCustomButton *cbutton;
238
 
 
239
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Left"), mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_BUTTON|wxCUSTBUT_LEFT );
240
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
241
 
 
242
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Right"), mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_TOGGLE|wxCUSTBUT_RIGHT );
243
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
244
 
 
245
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Top"), mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_BUT_DCLICK_TOG|wxCUSTBUT_TOP );
246
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
247
 
 
248
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Bottom"), mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_TOG_DCLICK_BUT|wxCUSTBUT_BOTTOM );
249
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
250
 
 
251
 
    // next row
252
 
 
253
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Left"), mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_BUTTON|wxCUSTBUT_LEFT );
254
 
    cbutton->SetMargins(wxSize(20,20), true);
255
 
    cbutton->Enable(false);
256
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
257
 
 
258
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Right"), mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_TOGGLE|wxCUSTBUT_RIGHT );
259
 
    cbutton->SetMargins(wxSize(20,20), true);
260
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
261
 
 
262
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Top"), mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_BUT_DCLICK_TOG|wxCUSTBUT_TOP );
263
 
    cbutton->SetMargins(wxSize(20,20), true);
264
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
265
 
 
266
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Bottom"), mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_TOG_DCLICK_BUT|wxCUSTBUT_BOTTOM );
267
 
    cbutton->SetMargins(wxSize(20,20), true);
268
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
269
 
 
270
 
    // next row
271
 
 
272
 
    cbutton = new wxCustomButton( panel, ID++, mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_BUTTON|wxCUSTBUT_LEFT );
273
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
274
 
 
275
 
    cbutton = new wxCustomButton( panel, ID++, mondrian, wxDefaultPosition, wxDefaultSize, wxCUSTBUT_TOGGLE|wxCUSTBUT_RIGHT );
276
 
    cbutton->SetMargins(wxSize(20,20), true);
277
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
278
 
 
279
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Top"), wxDefaultPosition, wxDefaultSize, wxCUSTBUT_BUT_DCLICK_TOG|wxCUSTBUT_TOP );
280
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
281
 
 
282
 
    cbutton = new wxCustomButton( panel, ID++, wxT("Bottom"), wxDefaultPosition, wxDefaultSize, wxCUSTBUT_TOG_DCLICK_BUT|wxCUSTBUT_BOTTOM );
283
 
    cbutton->SetMargins(wxSize(20,20), true);
284
 
    item0->Add( cbutton, 0, wxALIGN_CENTRE|wxALL, 5 );
285
 
 
286
 
    // next row
287
 
 
288
 
    item0->Add(new wxStaticText(panel, -1, wxT("wxButton")), 0, wxALIGN_CENTRE|wxALL, 5 );
289
 
    item0->Add(new wxStaticText(panel, -1, wxT("wxToggleButton")), 0, wxALIGN_CENTRE|wxALL, 5 );
290
 
    item0->Add(new wxStaticText(panel, -1, wxT("Button Dclick Toggle")), 0, wxALIGN_CENTRE|wxALL, 5 );
291
 
    item0->Add(new wxStaticText(panel, -1, wxT("Toggle Dclick Button")), 0, wxALIGN_CENTRE|wxALL, 5 );
292
 
 
293
 
    // next row
294
 
 
295
 
    wxMenuButton *menubtn;
296
 
 
297
 
    menubtn = new wxMenuButton(panel, ID++, mondrian);
298
 
    item0->Add( menubtn, 0, wxALIGN_CENTRE|wxALL, 5 );
299
 
    wxMenu *dmenu = new wxMenu();
300
 
    dmenu->AppendRadioItem(ID++, wxT("Tree view"));
301
 
    dmenu->AppendRadioItem(ID++, wxT("List view"));
302
 
    dmenu->AppendRadioItem(ID++, wxT("Details view"));
303
 
    dmenu->AppendRadioItem(ID++, wxT("Small icon view"));
304
 
    dmenu->AppendRadioItem(ID++, wxT("Large icon view"));
305
 
    dmenu->AppendRadioItem(ID++, wxT("Image preview view"));
306
 
    menubtn->AssignMenu(dmenu);
307
 
/*
308
 
    wxArrayBitmap bitmaps;
309
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(6,6)));
310
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(10,10)));
311
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(12,12)));
312
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(14,14)));
313
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(16,16)));
314
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(18,18)));
315
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(20,20)));
316
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(24,24)));
317
 
    bitmaps.Add(mondrian);
318
 
 
319
 
    wxArrayString labels;
320
 
    labels.Add(wxT("Hello"));
321
 
    labels.Add(wxT("Hello 1"));
322
 
    labels.Add(wxT("H"));
323
 
    labels.Add(wxT("Hello 3"));
324
 
    labels.Add(wxT("Hello 4 "));
325
 
    labels.Add(wxT("Hello 5"));
326
 
    labels.Add(wxT("Hello 7 "));
327
 
    labels.Add(wxT("Hello     9"));
328
 
    labels.Add(wxT("Hello 10asdasda"));
329
 
 
330
 
    wxBitmapComboBox *bmpcombo = new wxBitmapComboBox(panel, ID++, labels, bitmaps);
331
 
    item0->Add( bmpcombo, 0, wxALIGN_CENTRE|wxALL, 5 );
332
 
 
333
 
    bitmaps.Clear();
334
 
    bitmaps.Add(wxBitmap(wxImage(mondrian.ConvertToImage()).Scale(16,16)), 9);
335
 
    bmpcombo = new wxBitmapComboBox(panel, ID++, labels, bitmaps);
336
 
    item0->Add( bmpcombo, 0, wxALIGN_CENTRE|wxALL, 5 );
337
 
*/
338
 
 
339
 
    wxString labels[9] = { wxT("Hello"),
340
 
                           wxT("Hello 1"),
341
 
                           wxT("H"),
342
 
                           wxT("Hello 3"),
343
 
                           wxT("Hello 4 "),
344
 
                           wxT("Hello 5"),
345
 
                           wxT("Hello 7 "),
346
 
                           wxT("Hello     9"),
347
 
                           wxT("Hello 10asdasda") };
348
 
 
349
 
    wxBitmapComboBox *bmpcombo1 = new wxBitmapComboBox(panel, ID++, wxEmptyString,
350
 
                                 wxDefaultPosition, wxDefaultSize, 9, labels);
351
 
 
352
 
    wxBitmapComboBox *bmpcombo2 = new wxBitmapComboBox(panel, ID++, wxEmptyString,
353
 
                                 wxDefaultPosition, wxDefaultSize, 9, labels);
354
 
 
355
 
    // freeze while adding items
356
 
    bmpcombo1->Freeze();
357
 
    bmpcombo2->Freeze();
358
 
 
359
 
    wxImage mondrianImage(mondrian.ConvertToImage());
360
 
    for (int n=0; n<9; n++)
361
 
    {
362
 
        bmpcombo1->SetBitmap(n, wxBitmap(mondrianImage.Scale(n*3+8,n*3+8)));
363
 
        bmpcombo2->SetBitmap(n, wxBitmap(mondrianImage.Scale(16,16)));
364
 
    }
365
 
    // after adding items use Thaw to CalcLayout
366
 
    bmpcombo1->Thaw();
367
 
    bmpcombo2->Thaw();
368
 
    bmpcombo1->SetSize(bmpcombo1->GetBestSize());
369
 
    bmpcombo2->SetSize(bmpcombo2->GetBestSize());
370
 
 
371
 
    item0->Add( bmpcombo1, 0, wxALIGN_CENTRE|wxALL, 5 );
372
 
    item0->Add( bmpcombo2, 0, wxALIGN_CENTRE|wxALL, 5 );
373
 
 
374
 
    panel->SetAutoLayout(true);
375
 
    panel->SetSizer(item0);
376
 
    return panel;
377
 
}
378
 
 
379
 
void MyFrame::OnSpin(wxSpinEvent &event)
380
 
{
381
 
    m_textCtrl->AppendText(wxString::Format(wxT("%s Spin id %d, val %ld\n"), wxNow().c_str(), event.GetId(), event.GetInt()));
382
 
}
383
 
void MyFrame::OnTextEnter(wxCommandEvent& event)
384
 
{
385
 
    if (m_textCtrl->GetId() != event.GetId())
386
 
        m_textCtrl->AppendText(wxString::Format(wxT("%s TextEnter id %d, val '%s'\n"), wxNow().c_str(), event.GetId(), event.GetString().c_str()));
387
 
}
388
 
void MyFrame::OnText(wxCommandEvent& event)
389
 
{
390
 
    if (m_textCtrl->GetId() != event.GetId())
391
 
        m_textCtrl->AppendText(wxString::Format(wxT("%s TextUpdated id %d, val '%s'\n"), wxNow().c_str(), event.GetId(), event.GetString().c_str()));
392
 
}
393
 
void MyFrame::OnToggle(wxCommandEvent &event)
394
 
{
395
 
    m_textCtrl->AppendText(wxString::Format(wxT("%s Toggle id %d, val %ld\n"), wxNow().c_str(), event.GetId(), event.GetInt()));
396
 
}
397
 
void MyFrame::OnButton(wxCommandEvent &event)
398
 
{
399
 
    m_textCtrl->AppendText(wxString::Format(wxT("%s Button id %d, val %ld\n"), wxNow().c_str(), event.GetId(), event.GetInt()));
400
 
}
401
 
void MyFrame::OnMenu(wxCommandEvent &event)
402
 
{
403
 
    m_textCtrl->AppendText(wxString::Format(wxT("%s Menu id %d, val %ld\n"), wxNow().c_str(), event.GetId(), event.GetInt()));
404
 
}
405
 
void MyFrame::OnComboBox(wxCommandEvent &event)
406
 
{
407
 
    m_textCtrl->AppendText(wxString::Format(wxT("%s ComboBox id %d, val %ld\n"), wxNow().c_str(), event.GetId(), event.GetInt()));
408
 
}
409
 
 
410
 
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
411
 
{
412
 
    wxString msg;
413
 
    msg.Printf( _T("This is the About dialog of the thingsdemo sample.\n")
414
 
                _T("Welcome to %s"), wxVERSION_STRING);
415
 
 
416
 
    wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);
417
 
}
418