added wxTreeEvent::GetKeyEvent() to allow to retrieve the key event flags from EVT_TREE_KEY_DOWN event

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-09-24 16:39:49 +00:00
parent 82c9f85ce5
commit b09bda689c
7 changed files with 41 additions and 50 deletions

View File

@@ -222,11 +222,6 @@ private:
class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent
{
friend class WXDLLEXPORT wxTreeCtrl;
friend class WXDLLEXPORT wxGenericTreeCtrl;
DECLARE_DYNAMIC_CLASS(wxTreeEvent);
public:
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
@@ -243,19 +238,25 @@ public:
// wxEVT_COMMAND_TREE_BEGIN_(R)DRAG events only) or click position
wxPoint GetPoint() const { return m_pointDrag; }
// keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only)
int GetCode() const { return m_code; }
// keyboard data (for wxEVT_COMMAND_TREE_KEY_DOWN only)
const wxKeyEvent& GetKeyEvent() const { return m_evtKey; }
int GetCode() const { return m_evtKey.GetKeyCode(); }
// label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
const wxString& GetLabel() const { return m_label; }
private:
// we could probably save some space by using union here
int m_code;
// not all of the members are used (or initialized) for all events
wxKeyEvent m_evtKey;
wxTreeItemId m_item,
m_itemOld;
wxPoint m_pointDrag;
wxString m_label;
friend class WXDLLEXPORT wxTreeCtrl;
friend class WXDLLEXPORT wxGenericTreeCtrl;
DECLARE_DYNAMIC_CLASS(wxTreeEvent);
};
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);