X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/971562cb51391676afccb9822e491d677f052c0d..adbf2d732fe5f254f45ab27530e4f9c044cb385f:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index 67e839fd66..97b35334c0 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -230,6 +230,9 @@ public: 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; @@ -366,6 +369,9 @@ public: 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 @@ -489,6 +495,9 @@ public: // 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 // ------------------------- @@ -724,14 +733,12 @@ public: 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 @@ -804,9 +811,7 @@ public: virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; #if wxUSE_MENUS - bool PopupMenu(wxMenu *menu) - { return DoPopupMenu(menu, -1, -1); } - 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) { return DoPopupMenu(menu, x, y); } @@ -1132,15 +1137,10 @@ protected: 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) @@ -1224,10 +1224,6 @@ private: // 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()