| 1 |
#include "simple_book_wrapper.h" |
| 2 |
#include "allocator_mgr.h" |
| 3 |
#include "choice_property.h" |
| 4 |
#include "wxgui_defs.h" |
| 5 |
|
| 6 |
SimpleBookWrapper::SimpleBookWrapper() |
| 7 |
: NotebookBaseWrapper(ID_WXSIMPLEBOOK) |
| 8 |
{ |
| 9 |
// Remove styles added by NotebookBaseWrapper |
| 10 |
REMOVE_STYLE(wxBK_DEFAULT); |
| 11 |
REMOVE_STYLE(wxBK_LEFT); |
| 12 |
REMOVE_STYLE(wxBK_RIGHT); |
| 13 |
REMOVE_STYLE(wxBK_TOP); |
| 14 |
REMOVE_STYLE(wxBK_BOTTOM); |
| 15 |
|
| 16 |
RegisterEvent(wxT("wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED"), wxT("wxNotebookEvent"), |
| 17 |
_("The page selection was changed")); |
| 18 |
RegisterEvent(wxT("wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING"), wxT("wxNotebookEvent"), |
| 19 |
_("The page selection is about to be changed. This event can be vetoed")); |
| 20 |
|
| 21 |
wxArrayString effects; |
| 22 |
effects.Add("wxSHOW_EFFECT_NONE"); |
| 23 |
effects.Add("wxSHOW_EFFECT_ROLL_TO_LEFT"); |
| 24 |
effects.Add("wxSHOW_EFFECT_ROLL_TO_RIGHT"); |
| 25 |
effects.Add("wxSHOW_EFFECT_ROLL_TO_TOP"); |
| 26 |
effects.Add("wxSHOW_EFFECT_ROLL_TO_BOTTOM"); |
| 27 |
effects.Add("wxSHOW_EFFECT_SLIDE_TO_LEFT"); |
| 28 |
effects.Add("wxSHOW_EFFECT_SLIDE_TO_RIGHT"); |
| 29 |
effects.Add("wxSHOW_EFFECT_SLIDE_TO_TOP"); |
| 30 |
effects.Add("wxSHOW_EFFECT_SLIDE_TO_BOTTOM"); |
| 31 |
effects.Add("wxSHOW_EFFECT_BLEND"); |
| 32 |
effects.Add("wxSHOW_EFFECT_EXPAND"); |
| 33 |
|
| 34 |
SetPropertyString(_("Common Settings"), "wxSimplebook"); |
| 35 |
AddProperty(new ChoiceProperty(PROP_EFFECT, effects, 0, |
| 36 |
_("Set the same effect to use for both showing and hiding the pages"))); |
| 37 |
m_namePattern = wxT("m_simpleBook"); |
| 38 |
SetName(GenerateName()); |
| 39 |
} |
| 40 |
|
| 41 |
SimpleBookWrapper::~SimpleBookWrapper() {} |
| 42 |
|
| 43 |
wxString SimpleBookWrapper::GetXRCPageClass() const { return wxT("simplebookpage"); } |
| 44 |
|
| 45 |
wxcWidget* SimpleBookWrapper::Clone() const { return new SimpleBookWrapper(); } |
| 46 |
|
| 47 |
void SimpleBookWrapper::GetIncludeFile(wxArrayString& headers) const { headers.Add("#include <wx/simplebook.h>"); } |
| 48 |
|
| 49 |
wxString SimpleBookWrapper::GetWxClassName() const { return "wxSimplebook"; } |
| 50 |
|
| 51 |
void SimpleBookWrapper::ToXRC(wxString& text, XRC_TYPE type) const |
| 52 |
{ |
| 53 |
text << XRCPrefix() << XRCSize() << XRCStyle() << "<effect>" << PropertyString(PROP_EFFECT) << "</effect>" |
| 54 |
<< XRCCommonAttributes(); |
| 55 |
|
| 56 |
ChildrenXRC(text, type); |
| 57 |
text << XRCSuffix(); |
| 58 |
} |
| 59 |
|
| 60 |
wxString SimpleBookWrapper::CppCtorCode() const |
| 61 |
{ |
| 62 |
wxString code = NotebookBaseWrapper::CppCtorCode(); |
| 63 |
code << GetName() << "->SetEffect(" << PropertyString(PROP_EFFECT) << ");\n"; |
| 64 |
return code; |
| 65 |
} |