void Move(const wxPoint& pt, int flags = wxSIZE_USE_EXISTING)
{ Move(pt.x, pt.y, flags); }
+ // A 'Smart' SetSize that will fill in default size values with 'best' size
+ void SetBestFittingSize(const wxSize& size=wxDefaultSize);
+
// Z-order
virtual void Raise() = 0;
virtual void Lower() = 0;
virtual wxSize GetMaxSize() const { return wxSize( m_maxWidth, m_maxHeight ); }
virtual wxSize GetMinSize() const { return wxSize( m_minWidth, m_minHeight ); }
+ void SetMinSize(const wxSize& minSize) { SetSizeHints(minSize); }
+ void SetMaxSize(const wxSize& maxSize) { SetSizeHints(GetMinSize(), maxSize); }
+
// Methods for accessing the virtual size of a window. For most
// windows this is just the client area of the window, but for
// some like scrolled windows it is more or less independent of
// set this child as temporary default
virtual void SetTmpDefaultItem(wxWindow * WXUNUSED(win)) { }
+ // Navigates in the specified direction by sending a wxNavigationKeyEvent
+ virtual bool Navigate(int flags = wxNavigationKeyEvent::IsForward);
+
// parent/children relations
// -------------------------
if ( SetFont(font) )
m_hasFont = false;
}
- const wxFont& GetFont() const { return DoGetFont(); }
- wxFont& GetFont() { return DoGetFont(); }
+ wxFont GetFont() const;
// set/retrieve the cursor for this window (SetCursor() returns true
// if the cursor was really changed)
virtual bool SetCursor( const wxCursor &cursor );
const wxCursor& GetCursor() const { return m_cursor; }
- wxCursor& GetCursor() { return m_cursor; }
#if wxUSE_CARET
// associate a caret with the window
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ;
#if wxUSE_MENUS
- bool PopupMenu( wxMenu *menu, const wxPoint& pos )
+ bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition)
{ return DoPopupMenu(menu, pos.x, pos.y); }
- bool PopupMenu( wxMenu *menu, int x, int y )
+ bool PopupMenu(wxMenu *menu, int x, int y)
{ return DoPopupMenu(menu, x, y); }
#endif // wxUSE_MENUS
static int WidthDefault(int w) { return w == -1 ? 20 : w; }
static int HeightDefault(int h) { return h == -1 ? 20 : h; }
- // set the best size for the control if the default size was given:
- // replaces the fields of size == -1 with the best values for them and
- // calls SetSize() if needed
- //
- // This function is rather unfortunately named.. it's really just a
- // smarter SetSize / convenience function for expanding wxDefaultSize.
- // Note that it does not influence the value returned by GetBestSize
- // at all.
- void SetBestSize(const wxSize& size);
+ // keep the old name for compatibility, at least until all the internal
+ // usages of it are changed to SetBestFittingSize
+ void SetBestSize(const wxSize& size) { SetBestFittingSize(size); }
+
// set the initial window size if none is given (i.e. at least one of the
// components of the size passed to ctor/Create() is -1)
#endif // wxUSE_TOOLTIPS
#if wxUSE_MENUS
- virtual bool DoPopupMenu( wxMenu *menu, int x, int y ) = 0;
+ virtual bool DoPopupMenu(wxMenu *menu, int x, int y) = 0;
#endif // wxUSE_MENUS
// Makes an adjustment to the window position to make it relative to the
// the stack of windows which have captured the mouse
static struct WXDLLEXPORT wxWindowNext *ms_winCaptureNext;
- // implementation of both const and non-const versions of GetFont()
- wxFont& DoGetFont() const;
-
-
DECLARE_ABSTRACT_CLASS(wxWindowBase)
DECLARE_NO_COPY_CLASS(wxWindowBase)
DECLARE_EVENT_TABLE()