X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/brush.h?ds=sidebyside diff --git a/interface/wx/brush.h b/interface/wx/brush.h index f98b98525f..fd56d5a108 100644 --- a/interface/wx/brush.h +++ b/interface/wx/brush.h @@ -2,8 +2,7 @@ // Name: brush.h // Purpose: interface of wxBrush // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -20,41 +19,45 @@ enum wxBrushStyle /**< Transparent (no fill). */ wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE, - /**< @todo WHAT's THIS?? */ + /**< Uses a bitmap as a stipple; the mask is used for blitting monochrome + using text foreground and background colors. */ wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK, - /**< @todo WHAT's THIS?? */ + /**< Uses a bitmap as a stipple; mask is used for masking areas in the + stipple bitmap. */ wxBRUSHSTYLE_STIPPLE = wxSTIPPLE, /**< Uses a bitmap as a stipple. */ - wxBRUSHSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH, + wxBRUSHSTYLE_BDIAGONAL_HATCH, /**< Backward diagonal hatch. */ - wxBRUSHSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH, + wxBRUSHSTYLE_CROSSDIAG_HATCH, /**< Cross-diagonal hatch. */ - wxBRUSHSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH, + wxBRUSHSTYLE_FDIAGONAL_HATCH, /**< Forward diagonal hatch. */ - wxBRUSHSTYLE_CROSS_HATCH = wxCROSS_HATCH, + wxBRUSHSTYLE_CROSS_HATCH, /**< Cross hatch. */ - wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH, + wxBRUSHSTYLE_HORIZONTAL_HATCH, /**< Horizontal hatch. */ - wxBRUSHSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH, + wxBRUSHSTYLE_VERTICAL_HATCH, /**< Vertical hatch. */ - wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH, - wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH, + wxBRUSHSTYLE_FIRST_HATCH, + /**< First of the hatch styles (inclusive). */ + + wxBRUSHSTYLE_LAST_HATCH + /**< Last of the hatch styles (inclusive). */ }; /** @class wxBrush - @wxheader{brush.h} A brush is a drawing tool for filling in areas. It is used for painting the background of rectangles, ellipses, etc. It has a colour and a style. @@ -83,9 +86,18 @@ enum wxBrushStyle @category{gdi} @stdobjects - ::wxNullBrush, ::wxBLUE_BRUSH, ::wxGREEN_BRUSH, ::wxWHITE_BRUSH, - ::wxBLACK_BRUSH, ::wxGREY_BRUSH, ::wxMEDIUM_GREY_BRUSH, ::wxLIGHT_GREY_BRUSH, - ::wxTRANSPARENT_BRUSH, ::wxCYAN_BRUSH, ::wxRED_BRUSH + @li ::wxNullBrush + @li ::wxBLACK_BRUSH + @li ::wxBLUE_BRUSH + @li ::wxCYAN_BRUSH + @li ::wxGREEN_BRUSH + @li ::wxYELLOW_BRUSH + @li ::wxGREY_BRUSH + @li ::wxLIGHT_GREY_BRUSH + @li ::wxMEDIUM_GREY_BRUSH + @li ::wxRED_BRUSH + @li ::wxTRANSPARENT_BRUSH + @li ::wxWHITE_BRUSH @see wxBrushList, wxDC, wxDC::SetBrush */ @@ -110,7 +122,7 @@ public: /** Constructs a stippled brush using a bitmap. - The brush style will be set to wxBRUSHSTYLE_STIPPLE. + The brush style will be set to @c wxBRUSHSTYLE_STIPPLE. */ wxBrush(const wxBitmap& stippleBitmap); @@ -140,7 +152,7 @@ public: virtual wxColour GetColour() const; /** - Gets a pointer to the stipple bitmap. If the brush does not have a wxBRUSHSTYLE_STIPPLE + Gets a pointer to the stipple bitmap. If the brush does not have a @c wxBRUSHSTYLE_STIPPLE style, this bitmap may be non-@NULL but uninitialised (i.e. wxBitmap:IsOk() returns @false). @see SetStipple() @@ -162,11 +174,46 @@ public: virtual bool IsHatch() const; /** - Returns @true if the brush is initialised. It will return @false if the default - constructor has been used (for example, the brush is a member of a class, or - @NULL has been assigned to it). + Returns @true if the brush is initialised. + + Notice that an uninitialized brush object can't be queried for any + brush properties and all calls to the accessor methods on it will + result in an assert failure. */ - bool IsOk() const; + virtual bool IsOk() const; + + /** + Returns @true if the brush is a valid non-transparent brush. + + This method returns @true if the brush object is initialized and has a + non-transparent style. Notice that this should be used instead of + simply testing whether GetStyle() returns a style different from + wxBRUSHSTYLE_TRANSPARENT if the brush may be invalid as GetStyle() + would assert in this case. + + @see IsTransparent() + + @since 2.9.2. + */ + bool IsNonTransparent() const; + + /** + Returns @true if the brush is transparent. + + A transparent brush is simply a brush with wxBRUSHSTYLE_TRANSPARENT + style. + + Notice that this function works even for non-initialized brushes (for + which it returns @false) unlike tests of the form GetStyle() == + wxBRUSHSTYLE_TRANSPARENT which would assert if the brush is + invalid. + + @see IsNonTransparent() + + @since 2.9.2. + */ + bool IsTransparent() const; + //@{ /** @@ -174,7 +221,7 @@ public: @see GetColour() */ - virtual void SetColour(wxColour& colour); + virtual void SetColour(const wxColour& colour); virtual void SetColour(unsigned char red, unsigned char green, unsigned char blue); //@} @@ -184,9 +231,9 @@ public: @param bitmap The bitmap to use for stippling. - @remarks The style will be set to wxBRUSHSTYLE_STIPPLE, unless the bitmap + @remarks The style will be set to @c wxBRUSHSTYLE_STIPPLE, unless the bitmap has a mask associated to it, in which case the style will be set - to wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE. + to @c wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE. @see wxBitmap */ @@ -217,56 +264,84 @@ public: /** An empty brush. + wxBrush::IsOk() always returns @false for this object. */ wxBrush wxNullBrush; /** Blue brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxBLUE_BRUSH; /** Green brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxGREEN_BRUSH; +/** + Yellow brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). +*/ +wxBrush* wxYELLOW_BRUSH; + /** White brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxWHITE_BRUSH; /** Black brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxBLACK_BRUSH; /** Grey brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxGREY_BRUSH; /** Medium grey brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxMEDIUM_GREY_BRUSH; /** Light grey brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxLIGHT_GREY_BRUSH; /** Transparent brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxTRANSPARENT_BRUSH; /** Cyan brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxCYAN_BRUSH; /** Red brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). */ wxBrush* wxRED_BRUSH; @@ -274,7 +349,6 @@ wxBrush* wxRED_BRUSH; /** @class wxBrushList - @wxheader{gdicmn.h} A brush list is a list containing all brushes which have been created. @@ -286,7 +360,7 @@ wxBrush* wxRED_BRUSH; @see wxBrush */ -class wxBrushList : public wxList +class wxBrushList { public: /**