X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a047aff270905b377a81657a90f92eb3297157d0..0f1b6d7b589f19cd93f3a5500fedd66312a282ec:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index 53aad4df97..62396ddcac 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -988,10 +988,19 @@ public: virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; #if wxUSE_MENUS + // show popup menu at the given position, generate events for the items + // selected in it bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition) { return DoPopupMenu(menu, pos.x, pos.y); } bool PopupMenu(wxMenu *menu, int x, int y) { return DoPopupMenu(menu, x, y); } + + // simply return the id of the selected item or wxID_NONE without + // generating any events + int GetPopupMenuSelectionFromUser(wxMenu& menu, const wxPoint& pos) + { return DoGetPopupMenuSelectionFromUser(menu, pos.x, pos.y); } + int GetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y) + { return DoGetPopupMenuSelectionFromUser(menu, x, y); } #endif // wxUSE_MENUS // override this method to return true for controls having multiple pages @@ -1387,7 +1396,7 @@ protected: // this allows you to implement standard control borders without // repeating the code in different classes that are not derived from // wxControl - virtual wxBorder GetDefaultBorderForControl() const { return wxWindowBase::GetDefaultBorder(); } + virtual wxBorder GetDefaultBorderForControl() const { return wxBORDER_SUNKEN; } // Get the default size for the new window if no explicit size given. TLWs // have their own default size so this is just for non top-level windows. @@ -1497,6 +1506,13 @@ private: // enabled/disabled void NotifyWindowOnEnableChange(bool enabled); +#if wxUSE_MENUS + // temporary event handler used by GetPopupMenuSelectionFromUser() + void InternalOnPopupMenu(wxCommandEvent& event); + + // implementation of the public GetPopupMenuSelectionFromUser() method + int DoGetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y); +#endif // wxUSE_MENUS // contains the last id generated by NewControlId static int ms_lastControlId;