corrections for theme brush alignments
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,6 +22,13 @@
|
|||||||
|
|
||||||
class WXDLLEXPORT wxBrush;
|
class WXDLLEXPORT wxBrush;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kwxMacBrushColour ,
|
||||||
|
kwxMacBrushTheme ,
|
||||||
|
kwxMacBrushThemeBackground
|
||||||
|
} wxMacBrushKind ;
|
||||||
|
|
||||||
class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
|
class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
|
||||||
{
|
{
|
||||||
friend class WXDLLEXPORT wxBrush;
|
friend class WXDLLEXPORT wxBrush;
|
||||||
@@ -31,13 +38,15 @@ public:
|
|||||||
~wxBrushRefData();
|
~wxBrushRefData();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
wxMacBrushKind m_macBrushKind ;
|
||||||
int m_style;
|
int m_style;
|
||||||
wxBitmap m_stipple ;
|
wxBitmap m_stipple ;
|
||||||
wxColour m_colour;
|
wxColour m_colour;
|
||||||
bool m_isMacTheme ;
|
|
||||||
ThemeBrush m_macThemeBrush ;
|
ThemeBrush m_macThemeBrush ;
|
||||||
bool m_isMacThemeBackground ;
|
|
||||||
ThemeBackgroundKind m_macThemeBackground ;
|
ThemeBackgroundKind m_macThemeBackground ;
|
||||||
|
Rect m_macThemeBackgroundExtent ;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
||||||
@@ -60,16 +69,16 @@ public:
|
|||||||
virtual void SetStyle(int style) ;
|
virtual void SetStyle(int style) ;
|
||||||
virtual void SetStipple(const wxBitmap& stipple) ;
|
virtual void SetStipple(const wxBitmap& stipple) ;
|
||||||
virtual void SetMacTheme(ThemeBrush macThemeBrush) ;
|
virtual void SetMacTheme(ThemeBrush macThemeBrush) ;
|
||||||
virtual void SetMacThemeBackground(ThemeBackgroundKind macThemeBackground ) ;
|
virtual void SetMacThemeBackground(ThemeBackgroundKind macThemeBackground , const Rect &extent) ;
|
||||||
|
|
||||||
inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
|
inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
|
||||||
inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; }
|
inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; }
|
||||||
inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; }
|
inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; }
|
||||||
|
|
||||||
inline bool IsMacTheme() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_isMacTheme : false); };
|
inline wxMacBrushKind MacGetBrushKind() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour); };
|
||||||
inline bool IsMacThemeBackground() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_isMacThemeBackground : false); };
|
|
||||||
inline ThemeBackgroundKind GetMacThemeBackground() const { return (M_BRUSHDATA ? ( M_BRUSHDATA->m_isMacThemeBackground ? M_BRUSHDATA->m_macThemeBackground : 0) : 0); };
|
ThemeBackgroundKind GetMacThemeBackground(Rect *extent) const ;
|
||||||
inline ThemeBrush GetMacTheme() const { return (M_BRUSHDATA ? ( M_BRUSHDATA->m_isMacTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); };
|
inline ThemeBrush GetMacTheme() const { return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); };
|
||||||
inline wxColour& GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
|
inline wxColour& GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
|
||||||
inline int GetStyle() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
|
inline int GetStyle() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
|
||||||
inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
|
inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
|
||||||
|
@@ -176,9 +176,25 @@ class WXDLLEXPORT wxDC: public wxDCBase
|
|||||||
else
|
else
|
||||||
return (wxCoord)((double)(y) * m_scaleY - 0.5);
|
return (wxCoord)((double)(y) * m_scaleY - 0.5);
|
||||||
}
|
}
|
||||||
|
wxCoord XLOG2DEVMAC(wxCoord x) const
|
||||||
|
{
|
||||||
|
long new_x = x - m_logicalOriginX;
|
||||||
|
if (new_x > 0)
|
||||||
|
return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.h ;
|
||||||
|
else
|
||||||
|
return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.h ;
|
||||||
|
}
|
||||||
|
wxCoord YLOG2DEVMAC(wxCoord y) const
|
||||||
|
{
|
||||||
|
long new_y = y - m_logicalOriginY ;
|
||||||
|
if (new_y > 0)
|
||||||
|
return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.v ;
|
||||||
|
else
|
||||||
|
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.v ;
|
||||||
|
}
|
||||||
|
|
||||||
RgnHandle MacGetCurrentClipRgn() { return m_macCurrentClipRgn ; }
|
RgnHandle MacGetCurrentClipRgn() { return m_macCurrentClipRgn ; }
|
||||||
static MacSetupBackgroundForCurrentPort(const wxBrush& background ) ;
|
static void MacSetupBackgroundForCurrentPort(const wxBrush& background ) ;
|
||||||
//
|
//
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -70,7 +70,6 @@ public:
|
|||||||
const wxString& name ) ;
|
const wxString& name ) ;
|
||||||
static WindowRef MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
|
static WindowRef MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
|
||||||
virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ;
|
virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ;
|
||||||
virtual void MacDoGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ;
|
|
||||||
virtual void Clear() ;
|
virtual void Clear() ;
|
||||||
virtual ControlHandle MacGetContainerForEmbedding() ;
|
virtual ControlHandle MacGetContainerForEmbedding() ;
|
||||||
WindowRef MacGetWindowRef() { return m_macWindow ; }
|
WindowRef MacGetWindowRef() { return m_macWindow ; }
|
||||||
|
@@ -219,7 +219,7 @@ public :
|
|||||||
|
|
||||||
virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ;
|
virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ;
|
||||||
|
|
||||||
virtual void MacPaintBorders() ;
|
virtual void MacPaintBorders( int left , int top ) ;
|
||||||
WindowRef MacGetRootWindow() const ;
|
WindowRef MacGetRootWindow() const ;
|
||||||
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
|
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
|
||||||
|
|
||||||
@@ -240,18 +240,10 @@ public :
|
|||||||
// for compatibility
|
// for compatibility
|
||||||
void MacUpdateImmediately() { Update() ; }
|
void MacUpdateImmediately() { Update() ; }
|
||||||
|
|
||||||
/*
|
|
||||||
bool MacSetupFocusPort() ;
|
|
||||||
bool MacSetupDrawingPort() ;
|
|
||||||
bool MacSetupFocusClientPort() ;
|
|
||||||
bool MacSetupDrawingClientPort() ;
|
|
||||||
*/
|
|
||||||
virtual bool MacSetPortFocusParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* rootwin ) ;
|
|
||||||
virtual bool MacSetPortDrawingParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* rootwin ) ;
|
virtual bool MacSetPortDrawingParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* rootwin ) ;
|
||||||
|
|
||||||
virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ;
|
virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ;
|
||||||
virtual void MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ;
|
virtual void MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ;
|
||||||
virtual void MacDoGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ;
|
|
||||||
const wxBrush& MacGetBackgroundBrush() ;
|
const wxBrush& MacGetBackgroundBrush() ;
|
||||||
const wxRegion& MacGetVisibleRegion() ;
|
const wxRegion& MacGetVisibleRegion() ;
|
||||||
bool MacIsWindowScrollbar( const wxScrollBar* sb ) { return (m_hScrollBar == sb || m_vScrollBar == sb) ; }
|
bool MacIsWindowScrollbar( const wxScrollBar* sb ) { return (m_hScrollBar == sb || m_vScrollBar == sb) ; }
|
||||||
@@ -317,56 +309,18 @@ private:
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
class wxMacFocusHelper
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
wxMacFocusHelper( wxWindowMac * theWindow ) ;
|
|
||||||
~wxMacFocusHelper() ;
|
|
||||||
bool Ok() { return m_ok ; }
|
|
||||||
|
|
||||||
private :
|
|
||||||
GrafPtr m_formerPort ;
|
|
||||||
GrafPtr m_currentPort ;
|
|
||||||
bool m_ok ;
|
|
||||||
} ;
|
|
||||||
*/
|
|
||||||
|
|
||||||
class wxMacDrawingHelper
|
class wxMacDrawingHelper
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
wxMacDrawingHelper( wxWindowMac * theWindow ) ;
|
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
|
||||||
~wxMacDrawingHelper() ;
|
~wxMacDrawingHelper() ;
|
||||||
bool Ok() { return m_ok ; }
|
bool Ok() { return m_ok ; }
|
||||||
|
void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
|
||||||
private :
|
void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
|
||||||
GrafPtr m_formerPort ;
|
void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
|
||||||
GrafPtr m_currentPort ;
|
const Point& GetOrigin() { return m_origin ; }
|
||||||
PenState m_savedPenState ;
|
|
||||||
bool m_ok ;
|
|
||||||
} ;
|
|
||||||
/*
|
|
||||||
class wxMacFocusClientHelper
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
wxMacFocusClientHelper( wxWindowMac * theWindow ) ;
|
|
||||||
~wxMacFocusClientHelper() ;
|
|
||||||
bool Ok() { return m_ok ; }
|
|
||||||
|
|
||||||
private :
|
|
||||||
GrafPtr m_formerPort ;
|
|
||||||
GrafPtr m_currentPort ;
|
|
||||||
bool m_ok ;
|
|
||||||
} ;
|
|
||||||
*/
|
|
||||||
class wxMacDrawingClientHelper
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
wxMacDrawingClientHelper( wxWindowMac * theWindow ) ;
|
|
||||||
~wxMacDrawingClientHelper() ;
|
|
||||||
bool Ok() { return m_ok ; }
|
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
Point m_origin ;
|
||||||
GrafPtr m_formerPort ;
|
GrafPtr m_formerPort ;
|
||||||
GrafPtr m_currentPort ;
|
GrafPtr m_currentPort ;
|
||||||
PenState m_savedPenState ;
|
PenState m_savedPenState ;
|
||||||
|
Reference in New Issue
Block a user