X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06db67bcb00b09ff12039bfa135068bb153ed806..b70362998b8f562923f6ed6708f06537ac056cd4:/samples/listctrl/listtest.h diff --git a/samples/listctrl/listtest.h b/samples/listctrl/listtest.h index 47942fa7ae..03ce8f19d0 100644 --- a/samples/listctrl/listtest.h +++ b/samples/listctrl/listtest.h @@ -9,6 +9,14 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +// not all ports have support for EVT_CONTEXT_MENU yet, don't define +// USE_CONTEXT_MENU for those which don't +#if defined(__WXMOTIF__) || defined(__WXPM__) || defined(__WXX11__) || defined(__WXMGL__) + #define USE_CONTEXT_MENU 0 +#else + #define USE_CONTEXT_MENU 1 +#endif + // Define a new application type class MyApp: public wxApp { @@ -32,6 +40,9 @@ public: : wxListCtrl(parent, id, pos, size, style), m_attr(*wxBLUE, *wxLIGHT_GREY, wxNullFont) { +#ifdef __POCKETPC__ + EnableContextMenu(); +#endif } // add one item to the listctrl in report mode @@ -61,7 +72,15 @@ public: void OnChar(wxKeyEvent& event); +#if USE_CONTEXT_MENU + void OnContextMenu(wxContextMenuEvent& event); +#endif + + void OnRightClick(wxMouseEvent& event); + private: + void ShowContextMenu(const wxPoint& pos); + wxLog *m_logOld; void SetColumnImage(int col, int image); void LogEvent(const wxListEvent& event, const wxChar *eventName); @@ -81,7 +100,7 @@ private: class MyFrame: public wxFrame { public: - MyFrame(const wxChar *title, int x, int y, int w, int h); + MyFrame(const wxChar *title); virtual ~MyFrame(); void DoSize(); @@ -117,6 +136,7 @@ protected: void OnFreeze(wxCommandEvent& event); void OnThaw(wxCommandEvent& event); void OnToggleLines(wxCommandEvent& event); + void OnToggleMacUseGeneric(wxCommandEvent& event); void OnUpdateShowColInfo(wxUpdateUIEvent& event); void OnUpdateToggleMultiSel(wxUpdateUIEvent& event); @@ -184,7 +204,7 @@ enum LIST_FREEZE, LIST_THAW, LIST_TOGGLE_LINES, + LIST_MAC_USE_GENERIC, LIST_CTRL = 1000 }; -