Added context menu

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-03-12 20:54:13 +00:00
parent 7d90194ccb
commit 107ff6689a
2 changed files with 53 additions and 4 deletions

View File

@@ -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
@@ -60,6 +71,9 @@ public:
void OnCacheHint(wxListEvent& event);
void OnChar(wxKeyEvent& event);
#if USE_CONTEXT_MENU
void OnContextMenu(wxContextMenuEvent& event);
#endif
private:
void SetColumnImage(int col, int image);
@@ -81,7 +95,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();