X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29a7b4d041fa15b6b45b70b7e4ce2151a9673820..2301cda0084278f8cde4dc08ac634b88836e699f:/include/wx/mac/carbon/window.h diff --git a/include/wx/mac/carbon/window.h b/include/wx/mac/carbon/window.h index 95e240d4db..2ea9b49990 100644 --- a/include/wx/mac/carbon/window.h +++ b/include/wx/mac/carbon/window.h @@ -15,9 +15,9 @@ #include "wx/brush.h" #include "wx/dc.h" -class WXDLLEXPORT wxButton; -class WXDLLEXPORT wxScrollBar; -class WXDLLEXPORT wxTopLevelWindowMac; +class WXDLLIMPEXP_FWD_CORE wxButton; +class WXDLLIMPEXP_FWD_CORE wxScrollBar; +class WXDLLIMPEXP_FWD_CORE wxTopLevelWindowMac; class wxMacControl ; @@ -55,7 +55,6 @@ public: virtual void Lower(); virtual bool Show( bool show = true ); - virtual bool Enable( bool enable = true ); virtual void SetFocus(); @@ -65,6 +64,7 @@ public: const wxRect *rect = NULL ); virtual void Freeze(); virtual void Thaw(); + virtual bool IsFrozen() const; virtual void Update() ; virtual void ClearBackground(); @@ -83,7 +83,10 @@ public: const wxFont *theFont = NULL ) const; protected: + virtual void DoEnable( bool enable ); + virtual void OnEnabled( bool enabled ); virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); + public: virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = true ); @@ -93,6 +96,13 @@ public: virtual int GetScrollRange( int orient ) const; virtual void ScrollWindow( int dx, int dy, const wxRect* rect = (wxRect *) NULL ); + virtual void AlwaysShowScrollbars(bool horz = true, bool vert = true); + virtual bool IsScrollbarAlwaysShown(int orient) const + { + return orient == wxHORIZONTAL ? m_hScrollBarAlwaysShown + : m_vScrollBarAlwaysShown; + } + virtual bool Reparent( wxWindowBase *newParent ); #if wxUSE_DRAG_AND_DROP @@ -124,11 +134,6 @@ public: virtual bool SetTransparent(wxByte alpha); virtual bool CanSetTransparent(); virtual wxByte GetTransparent() const ; - -#if WXWIN_COMPATIBILITY_2_4 - bool GetTransparentBackground() const { return m_backgroundTransparent; } - void SetTransparent(bool t = true) { m_backgroundTransparent = t; } -#endif // event handlers // -------------- @@ -140,7 +145,9 @@ public: void MacOnScroll( wxScrollEvent&event ); - bool AcceptsFocus() const; + virtual bool AcceptsFocus() const; + + virtual bool IsDoubleBuffered() const { return true; } public: static long MacRemoveBordersFromStyle( long style ) ; @@ -163,6 +170,7 @@ public: // because it is called from its destructor via DeleteChildren virtual void RemoveChild( wxWindowBase *child ); virtual void MacPaintBorders( int left , int top ) ; + void MacPaintGrowBox(); // invalidates the borders and focus area around the control; // must not be virtual as it will be called during destruction @@ -215,8 +223,13 @@ public: // returns true if the grandchildren need to be clipped to the children's content area // (e.g., splitter windows) virtual bool MacClipGrandChildren() const { return false ; } - bool MacIsWindowScrollbar( const wxScrollBar* sb ) - { return (m_hScrollBar == sb || m_vScrollBar == sb) ; } + bool MacIsWindowScrollbar( const wxWindow* sb ) const + { return ((wxWindow*)m_hScrollBar == sb || (wxWindow*)m_vScrollBar == sb) ; } + virtual bool IsClientAreaChild(const wxWindow *child) const + { + return !MacIsWindowScrollbar(child) && + wxWindowBase::IsClientAreaChild(child); + } virtual void MacInstallEventHandler(WXWidget native) ; void MacPostControlCreate(const wxPoint& pos, const wxSize& size) ; @@ -298,6 +311,8 @@ protected: wxScrollBar* m_hScrollBar ; wxScrollBar* m_vScrollBar ; + bool m_hScrollBarAlwaysShown; + bool m_vScrollBarAlwaysShown; wxString m_label ; // set to true if we do a sharp clip at the content area of this window @@ -307,6 +322,7 @@ protected: virtual bool MacIsChildOfClientArea( const wxWindow* child ) const ; + bool MacHasScrollBarCorner() const; void MacCreateScrollBars( long style ) ; void MacRepositionScrollBars() ; void MacUpdateControlFont() ; @@ -315,10 +331,6 @@ protected: void MacPropagateEnabledStateChanged() ; void MacPropagateHiliteChanged() ; -#if WXWIN_COMPATIBILITY_2_4 - bool m_backgroundTransparent ; -#endif - // implement the base class pure virtuals virtual wxSize DoGetBestSize() const; virtual wxSize DoGetSizeFromClientSize( const wxSize & size ) const; @@ -350,6 +362,11 @@ private: // common part of all ctors void Init(); + // show/hide scrollbars as needed, common part of SetScrollbar() and + // AlwaysShowScrollbars() + void DoUpdateScrollbarVisibility(); + + WXEVENTHANDLERREF m_macControlEventHandler ; DECLARE_NO_COPY_CLASS(wxWindowMac)