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