Debian Codegraph @

wxcrafter/controls/info_bar_wrapper.cpp

raw
1 #include "info_bar_wrapper.h"
2
3 #include "allocator_mgr.h"
4 #include "choice_property.h"
5 #include "wxgui_helpers.h"
6
7 InfoBarWrapper::InfoBarWrapper()
8 : wxcWidget(ID_WXINFOBAR)
9 {
10 SetPropertyString(_("Common Settings"), "wxInfoBar");
11 m_styles.Clear();
12 m_namePattern = "m_infobar";
13 SetName(GenerateName());
14 }
15
16 InfoBarWrapper::~InfoBarWrapper() {}
17
18 wxcWidget* InfoBarWrapper::Clone() const { return new InfoBarWrapper(); }
19
20 wxString InfoBarWrapper::CppCtorCode() const
21 {
22 wxString cppCode;
23 cppCode << GetName() << " = new " << GetRealClassName() << "(" << GetWindowParent() << ", " << GetId() << ");\n";
24 cppCode << GetName() << "->SetSize(" << SizeAsString() << ");\n";
25 cppCode << CPPCommonAttributes();
26 return cppCode;
27 }
28
29 void InfoBarWrapper::GetIncludeFile(wxArrayString& headers) const { headers.Add("#include <wx/infobar.h>"); }
30
31 wxString InfoBarWrapper::GetWxClassName() const { return "wxInfoBar"; }
32
33 void InfoBarWrapper::ToXRC(wxString& text, XRC_TYPE type) const
34 {
35 if(type == XRC_LIVE) {
36 text << XRCUnknown();
37 } else {
38
39 text << XRCPrefix() << XRCSize() << XRCStyle() << XRCCommonAttributes()
40 << "<message> Something happened...</message>"
41 << "<icon-id>wxICON_INFORMATION</icon-id>";
42
43 ChildrenXRC(text, type);
44
45 text << XRCSuffix();
46 }
47 }