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
bool PageUp() { return ScrollPages(-1); }
bool PageDown() { return ScrollPages(1); }
+ // call this to always show one or both scrollbars, even if the window
+ // is big enough to not require them
+ virtual void AlwaysShowScrollbars(bool WXUNUSED(horz) = true,
+ bool WXUNUSED(vert) = true)
+ {
+ }
+
+ // return true if AlwaysShowScrollbars() had been called before for the
+ // corresponding orientation
+ virtual bool IsScrollbarAlwaysShown(int WXUNUSED(orient)) const
+ {
+ return false;
+ }
+
// context-sensitive help
// ----------------------
// area (normal windows can't, but e.g. menubar or statusbar can):
virtual bool CanBeOutsideClientArea() const { return false; }
+ // returns true if the platform should explicitly apply a theme border
+ virtual bool CanApplyThemeBorder() const { return true; }
+
protected:
// event handling specific to wxWindow
virtual bool TryValidator(wxEvent& event);
// implementation of Navigate() and NavigateIn()
virtual bool DoNavigateIn(int flags);
-
#if wxUSE_CONSTRAINTS
// satisfy the constraints for the windows but don't set the window sizes
void SatisfyConstraints();
// specified) border for the window class
virtual wxBorder GetDefaultBorder() const;
+ // 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 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.
static int WidthDefault(int w) { return w == wxDefaultCoord ? 20 : w; }
// 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;