Debian Codegraph @

wxcrafter/controls/info_bar_button_wrapper.cpp

raw
1 #include "info_bar_button_wrapper.h"
2 #include "allocator_mgr.h"
3 #include "winid_property.h"
4 #include "wxgui_defs.h"
5
6 InfoBarButtonWrapper::InfoBarButtonWrapper()
7 : wxcWidget(ID_WXINFOBARBUTTON)
8 {
9 m_properties.DeleteValues();
10 m_styles.Clear();
11 m_sizerFlags.Clear();
12
13 SetPropertyString(_("Common Settings"), "wxInfoBarButton");
14 AddProperty(new CategoryProperty(_("Common Settings")));
15 AddProperty(new WinIdProperty());
16 AddProperty(new StringProperty(PROP_NAME, "", _("Name")));
17 AddProperty(
18 new StringProperty(PROP_LABEL, _("My Label"),
19 _("The label of the button. It may only be empty if the button ID is one of the stock ids "
20 "in which case the corresponding stock label (see wxGetStockLabel()) will be used")));
21
22 RegisterEvent(wxT("wxEVT_COMMAND_BUTTON_CLICKED"), wxT("wxCommandEvent"),
23 _("Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked."),
24 wxT("wxCommandEventHandler"));
25
26 m_namePattern = "m_infoBarButton";
27 SetName(GenerateName());
28 }
29
30 InfoBarButtonWrapper::~InfoBarButtonWrapper() {}
31
32 wxcWidget* InfoBarButtonWrapper::Clone() const { return new InfoBarButtonWrapper(); }
33
34 wxString InfoBarButtonWrapper::CppCtorCode() const
35 {
36 wxString cppCode;
37 cppCode << GetParent()->GetName() << "->AddButton(" << GetId() << ", " << Label() << ");\n";
38 return cppCode;
39 }
40
41 void InfoBarButtonWrapper::GetIncludeFile(wxArrayString& headers) const { wxUnusedVar(headers); }
42
43 wxString InfoBarButtonWrapper::GetWxClassName() const { return ""; }
44
45 void InfoBarButtonWrapper::ToXRC(wxString& text, XRC_TYPE type) const
46 {
47 wxUnusedVar(type);
48 text << "<object class=\"wxInfoBarButton\" name=\"" << GetId() << "\">" << XRCLabel() << XRCSuffix();
49 }