| 1 |
#include "data_view_tree_ctrl_wrapper.h" |
| 2 |
|
| 3 |
#include "allocator_mgr.h" |
| 4 |
|
| 5 |
#include <wx/dataview.h> |
| 6 |
|
| 7 |
DataViewTreeCtrlWrapper::DataViewTreeCtrlWrapper() |
| 8 |
: wxcWidget(ID_WXDATAVIEWTREECTRL) |
| 9 |
{ |
| 10 |
|
| 11 |
PREPEND_STYLE(wxDV_SINGLE, true); |
| 12 |
PREPEND_STYLE(wxDV_MULTIPLE, false); |
| 13 |
PREPEND_STYLE(wxDV_ROW_LINES, true); |
| 14 |
PREPEND_STYLE(wxDV_HORIZ_RULES, false); |
| 15 |
PREPEND_STYLE(wxDV_VERT_RULES, false); |
| 16 |
PREPEND_STYLE(wxDV_VARIABLE_LINE_HEIGHT, false); |
| 17 |
PREPEND_STYLE(wxDV_NO_HEADER, false); |
| 18 |
|
| 19 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED", "wxDataViewEvent", |
| 20 |
_("Process a wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event")); |
| 21 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED", "wxDataViewEvent", |
| 22 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.\nThis event is triggered by double " |
| 23 |
"clicking an item or pressing some special key (usually \"Enter\") when it is focused")); |
| 24 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING", "wxDataViewEvent", |
| 25 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING event.\nThis event can be vetoed in order to " |
| 26 |
"prevent editing on an item by item basis")); |
| 27 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED", "wxDataViewEvent", |
| 28 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event")); |
| 29 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE", "wxDataViewEvent", |
| 30 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event")); |
| 31 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING", "wxDataViewEvent", |
| 32 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event")); |
| 33 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED", "wxDataViewEvent", |
| 34 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event")); |
| 35 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING", "wxDataViewEvent", |
| 36 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event")); |
| 37 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED", "wxDataViewEvent", |
| 38 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event")); |
| 39 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED", "wxDataViewEvent", |
| 40 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event")); |
| 41 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU", "wxDataViewEvent", |
| 42 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event generated when the user right clicks " |
| 43 |
"inside the control.\nNotice that this menu is generated even if the click didn't occur on any " |
| 44 |
"valid item, in this case wxDataViewEvent::GetItem() simply returns an invalid item.")); |
| 45 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK", "wxDataViewEvent", |
| 46 |
_("Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK event")); |
| 47 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK", "wxDataViewEvent", |
| 48 |
_("Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK event")); |
| 49 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED", "wxDataViewEvent", |
| 50 |
_("Process a wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event")); |
| 51 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED", "wxDataViewEvent", |
| 52 |
_("Process a wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event")); |
| 53 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG", "wxDataViewEvent", |
| 54 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event")); |
| 55 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE", "wxDataViewEvent", |
| 56 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event")); |
| 57 |
RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_DROP", "wxDataViewEvent", |
| 58 |
_("Process a wxEVT_COMMAND_DATAVIEW_ITEM_DROP event")); |
| 59 |
|
| 60 |
SetPropertyString(_("Common Settings"), "wxDataViewTreeCtrl"); |
| 61 |
DelProperty(_("Control Specific Settings")); |
| 62 |
m_namePattern = "m_dvTreeCtrl"; |
| 63 |
SetName(GenerateName()); |
| 64 |
} |
| 65 |
|
| 66 |
DataViewTreeCtrlWrapper::~DataViewTreeCtrlWrapper() {} |
| 67 |
|
| 68 |
wxcWidget* DataViewTreeCtrlWrapper::Clone() const { return new DataViewTreeCtrlWrapper(); } |
| 69 |
|
| 70 |
wxString DataViewTreeCtrlWrapper::CppCtorCode() const |
| 71 |
{ |
| 72 |
wxString cppCode; |
| 73 |
cppCode << CPPStandardWxCtor("wxDV_SINGLE|wxDV_ROW_LINES"); |
| 74 |
return cppCode; |
| 75 |
} |
| 76 |
|
| 77 |
void DataViewTreeCtrlWrapper::GetIncludeFile(wxArrayString& headers) const { headers.Add("#include <wx/dataview.h>"); } |
| 78 |
|
| 79 |
wxString DataViewTreeCtrlWrapper::GetWxClassName() const { return "wxDataViewTreeCtrl"; } |
| 80 |
|
| 81 |
void DataViewTreeCtrlWrapper::ToXRC(wxString& text, XRC_TYPE type) const |
| 82 |
{ |
| 83 |
if(type == XRC_LIVE) { |
| 84 |
text << XRCUnknown(); |
| 85 |
|
| 86 |
} else { |
| 87 |
text << XRCPrefix() << XRCSize() << XRCStyle() << XRCCommonAttributes() << XRCSuffix(); |
| 88 |
} |
| 89 |
} |