]> git.saurik.com Git - wxWidgets.git/blame - contrib/samples/gizmos/editlbox/test.cpp
Fix for MGL link error
[wxWidgets.git] / contrib / samples / gizmos / editlbox / test.cpp
CommitLineData
f55d21eb
VS
1// For compilers that support precompilation, includes "wx/wx.h".
2#include "wx/wxprec.h"
3
4#ifdef __BORLANDC__
5 #pragma hdrstop
6#endif
7
8// for all others, include the necessary headers (this file is usually all you
be5a51fb 9// need because it includes almost all "standard" wxWidgets headers)
f55d21eb
VS
10#ifndef WX_PRECOMP
11 #include "wx/wx.h"
12#endif
13
14#include "wx/gizmos/editlbox.h"
15#include "wx/sizer.h"
16
17class MyApp : public wxApp
18{
19public:
20 virtual bool OnInit();
21};
22
23IMPLEMENT_APP(MyApp)
24
25
26bool MyApp::OnInit()
27{
a2d49353 28 wxDialog dlg(NULL, wxID_ANY, _("Test dialog"), wxDefaultPosition, wxDefaultSize,
f55d21eb
VS
29 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
30
31 wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
dabbc6a5 32 sizer->Add(new wxEditableListBox(&dlg, wxID_ANY, _("Match these wildcards:"),
f55d21eb
VS
33 wxDefaultPosition,wxSize(300,200)),
34 1, wxEXPAND|wxALL, 10);
dabbc6a5 35
f55d21eb
VS
36 sizer->Add(5,5);
37
dabbc6a5 38 wxEditableListBox *lb = new wxEditableListBox(&dlg, wxID_ANY, _("Except:"),
f55d21eb
VS
39 wxDefaultPosition,wxSize(300,200));
40 wxArrayString ar;
41 ar.Add(_T("*.cpp"));
42 ar.Add(_T("*.h"));
43 ar.Add(_T("*.c"));
44 lb->SetStrings(ar);
45
46 sizer->Add(lb, 1, wxEXPAND|wxALL, 10);
47
48 sizer->Add(5,5);
dabbc6a5 49
f55d21eb 50 sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10);
f55d21eb
VS
51 dlg.SetSizer(sizer);
52 sizer->Fit(&dlg);
a2d49353 53 dlg.Centre();
dabbc6a5 54
f55d21eb
VS
55 dlg.ShowModal();
56
57 wxString res = _("'Except' contains these strings:\n\n");
58 lb->GetStrings(ar);
59 for (size_t i = 0; i < ar.GetCount(); i++)
60 res << ar[i] << _T("\n");
61 wxMessageBox(res);
dabbc6a5 62
a2d49353 63 return false;
f55d21eb 64}