Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <<<<<mychoice.h>>>>
- #define MYCHOICE_H
- #include <wx/choice.h>
- class mychoice : wxChoice
- {
- public:
- mychoice(wxWindow *parent,
- wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxChoiceNameStr )
- : wxChoice(parent, id, pos, size, n, choices,
- style, validator, name) { }
- protected:
- void OnFocusGot(wxFocusEvent& event)
- {
- // wxLogMessage(_T("MyChoice::OnFocusGot"));
- event.Skip();
- }
- void OnFocusLost(wxFocusEvent& event)
- {
- // wxLogMessage(_T("MyChoice::OnFocusLost"));
- event.Skip();
- }
- private:
- DECLARE_EVENT_TABLE()
- };
- #endif // MYCHOICE_H
- <<<<file test.h>>>
- #ifndef TEST_H
- #define TEST_H
- #include "mychoice.h"
- //(*Headers(test)
- #include <wx/sizer.h>
- #include <wx/panel.h>
- #include <wx/dialog.h>
- //*)
- class test.: public wxDialog
- {
- public:
- test(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
- virtual ~test();
- //(*Declarations(test)
- wxPanel* Panel1;
- //*)
- mychoice * Choice1;
- protected:
- //(*Identifiers(test)
- static const long ID_PANEL1;
- //*)
- static const long ID_CHOICE1;
- private:
- //(*Handlers(test)
- //*)
- DECLARE_EVENT_TABLE()
- };
- #endif
- <<<<<<test.cpp>>>>>>>>
- #include "test.h"
- #include "mychoice.h"
- //(*InternalHeaders(test)
- #include <wx/intl.h>
- #include <wx/string.h>
- //*)
- //(*IdInit(test)
- const long test::ID_PANEL1 = wxNewId();
- //*)
- const long test::ID_CHOICE1 = wxNewId();
- BEGIN_EVENT_TABLE(test,wxDialog)
- //(*EventTable(test)
- //*)
- END_EVENT_TABLE()
- test::test(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
- {
- //(*Initialize(test)
- wxBoxSizer* BoxSizer1;
- Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
- SetClientSize(wxDefaultSize);
- Move(wxDefaultPosition);
- BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
- Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
- BoxSizer1->Add(Panel1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- SetSizer(BoxSizer1);
- BoxSizer1->Fit(this);
- BoxSizer1->SetSizeHints(this);
- //*)
- Choice1 = new mychoice(Panel1, ID_CHOICE1, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE1"));
- }
- test::~test()
- {
- //(*Destroy(test)
- //*)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement