#if WXWIN_COMPATIBILITY_2_4
// deprecated: only for compatibility, don't work on 64 bit archs
- wxTreeItemId(long item) { wxULongToPtr(m_pItem, item); }
+ wxTreeItemId(long item) { m_pItem = wxUIntToPtr(item); }
operator long() const { return (long)wxPtrToUInt(m_pItem); }
#else // !WXWIN_COMPATIBILITY_2_4
operator bool() const { return IsOk(); }
#define wxTR_FULL_ROW_HIGHLIGHT 0x2000 // highlight full horz space
+#ifdef __WXGTK20__
+#define wxTR_DEFAULT_STYLE (wxTR_HAS_BUTTONS | wxTR_NO_LINES)
+#else
#define wxTR_DEFAULT_STYLE (wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT)
+#endif
// deprecated, don't use
#define wxTR_MAC_BUTTONS 0
{
public:
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
+ wxTreeEvent(const wxTreeEvent & event);
+
+ virtual wxEvent *Clone() const { return new wxTreeEvent(*this); }
// accessors
// get the item on which the operation was performed or the newly
friend class WXDLLEXPORT wxTreeCtrl;
friend class WXDLLEXPORT wxGenericTreeCtrl;
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxTreeEvent)
+ DECLARE_DYNAMIC_CLASS(wxTreeEvent)
};
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_DRAG, 617)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, 618)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, 619)
+ DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MENU, 620)
END_DECLARE_EVENT_TYPES()
// GetItem() returns the item being dragged, GetPoint() the mouse coords
// GetItem() returns the item that was activated (double click, enter, space)
#define EVT_TREE_ITEM_ACTIVATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
+// GetItem() returns the item for which the context menu shall be shown
+#define EVT_TREE_ITEM_MENU(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_MENU, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
+
// GetItem() returns the item that was clicked on
#define EVT_TREE_ITEM_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
#define EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),