2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: gdicmn.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxRealPoint
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-03-15 14:15:46 -04:00
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Bitmap type flags. See wxBitmap and wxImage classes.
|
2008-03-15 14:15:46 -04:00
|
|
|
*/
|
|
|
|
enum wxBitmapType
|
|
|
|
{
|
|
|
|
wxBITMAP_TYPE_INVALID,
|
|
|
|
wxBITMAP_TYPE_BMP,
|
|
|
|
wxBITMAP_TYPE_BMP_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_ICO,
|
|
|
|
wxBITMAP_TYPE_ICO_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_CUR,
|
|
|
|
wxBITMAP_TYPE_CUR_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_XBM,
|
|
|
|
wxBITMAP_TYPE_XBM_DATA,
|
|
|
|
wxBITMAP_TYPE_XPM,
|
|
|
|
wxBITMAP_TYPE_XPM_DATA,
|
|
|
|
wxBITMAP_TYPE_TIF,
|
|
|
|
wxBITMAP_TYPE_TIF_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_GIF,
|
|
|
|
wxBITMAP_TYPE_GIF_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_PNG,
|
|
|
|
wxBITMAP_TYPE_PNG_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_JPEG,
|
|
|
|
wxBITMAP_TYPE_JPEG_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_PNM,
|
|
|
|
wxBITMAP_TYPE_PNM_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_PCX,
|
|
|
|
wxBITMAP_TYPE_PCX_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_PICT,
|
|
|
|
wxBITMAP_TYPE_PICT_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_ICON,
|
|
|
|
wxBITMAP_TYPE_ICON_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_ANI,
|
|
|
|
wxBITMAP_TYPE_IFF,
|
|
|
|
wxBITMAP_TYPE_TGA,
|
|
|
|
wxBITMAP_TYPE_MACCURSOR,
|
|
|
|
wxBITMAP_TYPE_MACCURSOR_RESOURCE,
|
|
|
|
wxBITMAP_TYPE_ANY = 50
|
|
|
|
};
|
|
|
|
|
2009-02-25 08:12:09 -05:00
|
|
|
/**
|
|
|
|
Polygon filling mode. See wxDC::DrawPolygon.
|
|
|
|
*/
|
|
|
|
enum wxPolygonFillMode
|
|
|
|
{
|
|
|
|
wxODDEVEN_RULE = 1,
|
|
|
|
wxWINDING_RULE
|
|
|
|
};
|
|
|
|
|
2008-03-15 14:15:46 -04:00
|
|
|
/**
|
2010-01-26 07:39:41 -05:00
|
|
|
Standard cursors.
|
|
|
|
|
|
|
|
Notice that under wxMSW some of these cursors are defined in @c wx.rc file
|
|
|
|
and not by the system itself so you should include this file from your own
|
|
|
|
resource file (possibly creating a trivial resource file just containing a
|
|
|
|
single include line if you don't need it otherwise) to be able to use them.
|
|
|
|
|
|
|
|
See wxCursor.
|
2008-03-15 14:15:46 -04:00
|
|
|
*/
|
|
|
|
enum wxStockCursor
|
|
|
|
{
|
|
|
|
wxCURSOR_NONE,
|
2008-05-02 00:12:39 -04:00
|
|
|
wxCURSOR_ARROW, ///< A standard arrow cursor.
|
|
|
|
wxCURSOR_RIGHT_ARROW, ///< A standard arrow cursor pointing to the right.
|
|
|
|
wxCURSOR_BULLSEYE, ///< Bullseye cursor.
|
|
|
|
wxCURSOR_CHAR, ///< Rectangular character cursor.
|
|
|
|
wxCURSOR_CROSS, ///< A cross cursor.
|
|
|
|
wxCURSOR_HAND, ///< A hand cursor.
|
|
|
|
wxCURSOR_IBEAM, ///< An I-beam cursor (vertical line).
|
|
|
|
wxCURSOR_LEFT_BUTTON, ///< Represents a mouse with the left button depressed.
|
|
|
|
wxCURSOR_MAGNIFIER, ///< A magnifier icon.
|
|
|
|
wxCURSOR_MIDDLE_BUTTON, ///< Represents a mouse with the middle button depressed.
|
|
|
|
wxCURSOR_NO_ENTRY, ///< A no-entry sign cursor.
|
|
|
|
wxCURSOR_PAINT_BRUSH, ///< A paintbrush cursor.
|
|
|
|
wxCURSOR_PENCIL, ///< A pencil cursor.
|
|
|
|
wxCURSOR_POINT_LEFT, ///< A cursor that points left.
|
|
|
|
wxCURSOR_POINT_RIGHT, ///< A cursor that points right.
|
|
|
|
wxCURSOR_QUESTION_ARROW, ///< An arrow and question mark.
|
|
|
|
wxCURSOR_RIGHT_BUTTON, ///< Represents a mouse with the right button depressed.
|
|
|
|
wxCURSOR_SIZENESW, ///< A sizing cursor pointing NE-SW.
|
|
|
|
wxCURSOR_SIZENS, ///< A sizing cursor pointing N-S.
|
|
|
|
wxCURSOR_SIZENWSE, ///< A sizing cursor pointing NW-SE.
|
|
|
|
wxCURSOR_SIZEWE, ///< A sizing cursor pointing W-E.
|
|
|
|
wxCURSOR_SIZING, ///< A general sizing cursor.
|
|
|
|
wxCURSOR_SPRAYCAN, ///< A spraycan cursor.
|
|
|
|
wxCURSOR_WAIT, ///< A wait cursor.
|
|
|
|
wxCURSOR_WATCH, ///< A watch cursor.
|
|
|
|
wxCURSOR_BLANK, ///< Transparent cursor.
|
|
|
|
wxCURSOR_DEFAULT, ///< Standard X11 cursor (only in wxGTK).
|
|
|
|
wxCURSOR_COPY_ARROW , ///< MacOS Theme Plus arrow (only in wxMac).
|
|
|
|
wxCURSOR_CROSS_REVERSE, ///< Only available on wxX11.
|
|
|
|
wxCURSOR_DOUBLE_ARROW, ///< Only available on wxX11.
|
|
|
|
wxCURSOR_BASED_ARROW_UP, ///< Only available on wxX11.
|
|
|
|
wxCURSOR_BASED_ARROW_DOWN, ///< Only available on wxX11.
|
|
|
|
wxCURSOR_ARROWWAIT, ///< A wait cursor with a standard arrow.
|
2008-03-15 14:15:46 -04:00
|
|
|
wxCURSOR_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxRealPoint
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-05-02 00:12:39 -04:00
|
|
|
A wxRealPoint is a useful data structure for graphics operations.
|
2008-04-06 11:28:55 -04:00
|
|
|
|
2010-07-11 06:44:03 -04:00
|
|
|
It contains floating point @e x and @e y members.
|
2009-03-15 07:33:40 -04:00
|
|
|
See wxPoint for an integer version.
|
|
|
|
|
2010-07-11 06:44:03 -04:00
|
|
|
Note that the coordinates stored inside a wxRealPoint object may be negative
|
2009-03-15 07:33:40 -04:00
|
|
|
and that wxRealPoint functions do not perform any check against negative values.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{data}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxPoint
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxRealPoint
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
2009-03-15 07:33:40 -04:00
|
|
|
/**
|
|
|
|
Initializes to zero the x and y members.
|
|
|
|
*/
|
2008-04-06 11:28:55 -04:00
|
|
|
wxRealPoint();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-04-06 11:28:55 -04:00
|
|
|
Initializes the point with the given coordinates.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxRealPoint(double x, double y);
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2010-06-09 14:03:27 -04:00
|
|
|
/**
|
|
|
|
Converts the given wxPoint (with integer coordinates) to a wxRealPoint.
|
|
|
|
*/
|
|
|
|
wxRealPoint(const wxPoint& pt);
|
2008-04-06 11:28:55 -04:00
|
|
|
|
2010-06-09 14:03:27 -04:00
|
|
|
/**
|
|
|
|
@name Miscellaneous operators
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2010-06-09 14:03:27 -04:00
|
|
|
Note that these operators are documented as class members
|
|
|
|
(to make them easier to find) but, as their prototype shows,
|
|
|
|
they are implemented as global operators; note that this is
|
|
|
|
transparent to the user but it helps to understand why the
|
|
|
|
following functions are documented to take the wxPoint they
|
|
|
|
operate on as an explicit argument.
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
wxRealPoint& operator=(const wxRealPoint& pt);
|
|
|
|
|
|
|
|
bool operator ==(const wxRealPoint& p1, const wxRealPoint& p2);
|
|
|
|
bool operator !=(const wxRealPoint& p1, const wxRealPoint& p2);
|
|
|
|
|
|
|
|
wxRealPoint operator +(const wxRealPoint& p1, const wxRealPoint& p2);
|
|
|
|
wxRealPoint operator -(const wxRealPoint& p1, const wxRealPoint& p2);
|
|
|
|
|
|
|
|
wxRealPoint& operator +=(const wxRealPoint& pt);
|
|
|
|
wxRealPoint& operator -=(const wxRealPoint& pt);
|
|
|
|
|
|
|
|
wxRealPoint operator +(const wxRealPoint& pt, const wxSize& sz);
|
|
|
|
wxRealPoint operator -(const wxRealPoint& pt, const wxSize& sz);
|
|
|
|
wxRealPoint operator +(const wxSize& sz, const wxRealPoint& pt);
|
|
|
|
wxRealPoint operator -(const wxSize& sz, const wxRealPoint& pt);
|
|
|
|
|
|
|
|
wxRealPoint& operator +=(const wxSize& sz);
|
|
|
|
wxRealPoint& operator -=(const wxSize& sz);
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2010-06-09 14:03:27 -04:00
|
|
|
wxSize operator /(const wxRealPoint& sz, int factor);
|
|
|
|
wxSize operator *(const wxRealPoint& sz, int factor);
|
|
|
|
wxSize operator *(int factor, const wxSize& sz);
|
|
|
|
wxSize& operator /=(int factor);
|
|
|
|
wxSize& operator *=(int factor);
|
|
|
|
//@}
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2008-04-06 11:28:55 -04:00
|
|
|
/**
|
|
|
|
X coordinate of this point.
|
|
|
|
*/
|
|
|
|
double x;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Y coordinate of this point.
|
|
|
|
*/
|
|
|
|
double y;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxRect
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
A class for manipulating rectangles.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2010-07-11 06:44:03 -04:00
|
|
|
Note that the x, y coordinates and the width and height stored inside a wxRect
|
|
|
|
object may be negative and that wxRect functions do not perform any check against
|
2009-03-15 07:33:40 -04:00
|
|
|
negative values.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{data}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxPoint, wxSize
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxRect
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Default constructor.
|
2009-03-15 07:33:40 -04:00
|
|
|
Initializes to zero the internal @a x, @a y, @a width and @a height members.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxRect();
|
2008-05-02 00:12:39 -04:00
|
|
|
/**
|
|
|
|
Creates a wxRect object from @a x, @a y, @a width and @a height values.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxRect(int x, int y, int width, int height);
|
2008-05-02 00:12:39 -04:00
|
|
|
/**
|
|
|
|
Creates a wxRect object from top-left and bottom-right points.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
|
2008-05-02 00:12:39 -04:00
|
|
|
/**
|
2009-03-15 07:33:40 -04:00
|
|
|
Creates a wxRect object from position @a pos and @a size values.
|
2008-05-02 00:12:39 -04:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxRect(const wxPoint& pos, const wxSize& size);
|
2008-05-02 00:12:39 -04:00
|
|
|
/**
|
|
|
|
Creates a wxRect object from @a size values at the origin.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxRect(const wxSize& size);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Returns the rectangle having the same size as this one but centered
|
|
|
|
relatively to the given rectangle @a r. By default, rectangle is
|
|
|
|
centred in both directions but if @a dir includes only @c wxVERTICAL or
|
|
|
|
only @c wxHORIZONTAL, then it is only centered in this direction while
|
2008-03-08 08:52:38 -05:00
|
|
|
the other component of its position remains unchanged.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxRect CentreIn(const wxRect& r, int dir = wxBOTH) const;
|
2008-05-02 00:12:39 -04:00
|
|
|
wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Returns @true if the given point is inside the rectangle (or on its
|
|
|
|
boundary) and @false otherwise.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool Contains(int x, int y) const;
|
2008-05-02 00:12:39 -04:00
|
|
|
/**
|
|
|
|
Returns @true if the given point is inside the rectangle (or on its
|
|
|
|
boundary) and @false otherwise.
|
|
|
|
*/
|
|
|
|
bool Contains(const wxPoint& pt) const;
|
|
|
|
/**
|
|
|
|
Returns @true if the given rectangle is completely inside this
|
|
|
|
rectangle (or touches its boundary) and @false otherwise.
|
|
|
|
*/
|
|
|
|
bool Contains(const wxRect& rect) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Decrease the rectangle size.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-05-02 00:12:39 -04:00
|
|
|
This method is the opposite from Inflate(): Deflate(a, b) is equivalent
|
|
|
|
to Inflate(-a, -b). Please refer to Inflate() for full description.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2010-11-01 23:07:35 -04:00
|
|
|
wxRect& Deflate(wxCoord dx, wxCoord dy);
|
|
|
|
wxRect& Deflate(const wxSize& diff);
|
|
|
|
wxRect& Deflate(wxCoord diff);
|
|
|
|
wxRect Deflate(wxCoord dx, wxCoord dy) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the bottom point of the rectangle.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetBottom() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the position of the bottom left corner.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxPoint GetBottomLeft() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the position of the bottom right corner.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxPoint GetBottomRight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the height member.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetHeight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Gets the left point of the rectangle (the same as GetX()).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetLeft() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the position.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxPoint GetPosition() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the right point of the rectangle.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetRight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the size.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxSize GetSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Gets the top point of the rectangle (the same as GetY()).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetTop() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Gets the position of the top left corner of the rectangle, same as
|
2008-03-08 08:52:38 -05:00
|
|
|
GetPosition().
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxPoint GetTopLeft() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the position of the top right corner.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxPoint GetTopRight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the width member.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetWidth() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the x member.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetX() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the y member.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetY() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Increases the size of the rectangle.
|
2008-05-02 00:12:39 -04:00
|
|
|
|
|
|
|
The left border is moved farther left and the right border is moved
|
|
|
|
farther right by @a dx. The upper border is moved farther up and the
|
2011-03-22 10:08:30 -04:00
|
|
|
bottom border is moved farther down by @a dy. (Note that the width and
|
2008-05-02 00:12:39 -04:00
|
|
|
height of the rectangle thus change by 2*dx and 2*dy, respectively.) If
|
|
|
|
one or both of @a dx and @a dy are negative, the opposite happens: the
|
|
|
|
rectangle size decreases in the respective direction.
|
|
|
|
|
|
|
|
Inflating and deflating behaves "naturally". Defined more precisely,
|
|
|
|
that means:
|
|
|
|
-# "Real" inflates (that is, @a dx and/or @a dy = 0) are not
|
|
|
|
constrained. Thus inflating a rectangle can cause its upper left
|
|
|
|
corner to move into the negative numbers. (2.5.4 and older forced
|
|
|
|
the top left coordinate to not fall below (0, 0), which implied a
|
|
|
|
forced move of the rectangle.)
|
|
|
|
-# Deflates are clamped to not reduce the width or height of the
|
|
|
|
rectangle below zero. In such cases, the top-left corner is
|
|
|
|
nonetheless handled properly. For example, a rectangle at (10, 10)
|
|
|
|
with size (20, 40) that is inflated by (-15, -15) will become
|
|
|
|
located at (20, 25) at size (0, 10). Finally, observe that the width
|
|
|
|
and height are treated independently. In the above example, the
|
|
|
|
width is reduced by 20, whereas the height is reduced by the full 30
|
|
|
|
(rather than also stopping at 20, when the width reached zero).
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see Deflate()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2010-11-01 23:07:35 -04:00
|
|
|
wxRect& Inflate(wxCoord dx, wxCoord dy);
|
|
|
|
wxRect& Inflate(const wxSize& diff);
|
|
|
|
wxRect& Inflate(wxCoord diff);
|
2008-03-09 12:24:26 -04:00
|
|
|
wxRect Inflate(wxCoord dx, wxCoord dy) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-11-22 07:39:45 -05:00
|
|
|
Modifies this rectangle to contain the overlapping portion of this rectangle
|
2008-05-02 00:12:39 -04:00
|
|
|
and the one passed in as parameter.
|
2008-11-22 07:39:45 -05:00
|
|
|
|
|
|
|
@return This rectangle, modified.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
wxRect& Intersect(const wxRect& rect);
|
2008-11-22 07:39:45 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the overlapping portion of this rectangle and the one passed in as
|
|
|
|
parameter.
|
|
|
|
*/
|
|
|
|
wxRect Intersect(const wxRect& rect) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if this rectangle has a non-empty intersection with the
|
2008-03-09 08:33:59 -04:00
|
|
|
rectangle @a rect and @false otherwise.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool Intersects(const wxRect& rect) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Returns @true if this rectangle has a width or height less than or
|
|
|
|
equal to 0 and @false otherwise.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsEmpty() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Moves the rectangle by the specified offset. If @a dx is positive, the
|
|
|
|
rectangle is moved to the right, if @a dy is positive, it is moved to the
|
2008-03-08 08:52:38 -05:00
|
|
|
bottom, otherwise it is moved to the left or top respectively.
|
|
|
|
*/
|
|
|
|
void Offset(wxCoord dx, wxCoord dy);
|
2008-03-08 09:43:31 -05:00
|
|
|
void Offset(const wxPoint& pt);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the height.
|
|
|
|
*/
|
|
|
|
void SetHeight(int height);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the size.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetSize(const wxSize& s);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the width.
|
|
|
|
*/
|
|
|
|
void SetWidth(int width);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the x position.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
void SetX(int x);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the y position.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
void SetY(int y);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Modifies the rectangle to contain the bounding box of this rectangle
|
|
|
|
and the one passed in as parameter.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
wxRect Union(const wxRect& rect) const;
|
|
|
|
wxRect& Union(const wxRect& rect);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Inequality operator.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
bool operator !=(const wxRect& r1, const wxRect& r2);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-05-02 00:12:39 -04:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Like Union(), but doesn't treat empty rectangles specially.
|
|
|
|
*/
|
|
|
|
wxRect operator +(const wxRect& r1, const wxRect& r2);
|
|
|
|
wxRect& operator +=(const wxRect& r);
|
|
|
|
//@}
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the intersection of two rectangles (which may be empty).
|
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
wxRect operator *(const wxRect& r1, const wxRect& r2);
|
|
|
|
wxRect& operator *=(const wxRect& r);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Assignment operator.
|
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
wxRect& operator=(const wxRect& rect);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Equality operator.
|
|
|
|
*/
|
|
|
|
bool operator ==(const wxRect& r1, const wxRect& r2);
|
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Height member.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
int height;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-05-02 00:12:39 -04:00
|
|
|
/**
|
|
|
|
Width member.
|
|
|
|
*/
|
|
|
|
int width;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
x coordinate of the top-level corner of the rectangle.
|
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
int x;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
y coordinate of the top-level corner of the rectangle.
|
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
int y;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxPoint
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-05-02 00:12:39 -04:00
|
|
|
A wxPoint is a useful data structure for graphics operations.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2010-07-11 06:44:03 -04:00
|
|
|
It contains integer @e x and @e y members.
|
2009-03-15 07:33:40 -04:00
|
|
|
See wxRealPoint for a floating point version.
|
|
|
|
|
|
|
|
Note that the width and height stored inside a wxPoint object may be negative
|
|
|
|
and that wxPoint functions do not perform any check against negative values
|
|
|
|
(this is used to e.g. store the special -1 value in ::wxDefaultPosition instance).
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{data}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-06 11:28:55 -04:00
|
|
|
@stdobjects
|
|
|
|
::wxDefaultPosition
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxRealPoint
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxPoint
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Constructs a point.
|
2009-03-15 07:33:40 -04:00
|
|
|
Initializes the internal x and y coordinates to zero.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxPoint();
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2009-03-15 07:33:40 -04:00
|
|
|
/**
|
|
|
|
Initializes the point object with the given @a x and @a y coordinates.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxPoint(int x, int y);
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2010-06-09 14:03:27 -04:00
|
|
|
/**
|
|
|
|
Converts the given wxRealPoint (with floating point coordinates) to a
|
|
|
|
wxPoint instance.
|
|
|
|
*/
|
|
|
|
wxPoint(const wxRealPoint& pt);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2009-03-15 07:33:40 -04:00
|
|
|
@name Miscellaneous operators
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2010-05-30 19:28:14 -04:00
|
|
|
Note that these operators are documented as class members
|
|
|
|
(to make them easier to find) but, as their prototype shows,
|
|
|
|
they are implemented as global operators; note that this is
|
|
|
|
transparent to the user but it helps to understand why the
|
|
|
|
following functions are documented to take the wxPoint they
|
|
|
|
operate on as an explicit argument.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2009-03-15 07:33:40 -04:00
|
|
|
//@{
|
2008-10-29 11:34:31 -04:00
|
|
|
wxPoint& operator=(const wxPoint& pt);
|
2008-05-02 00:12:39 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
bool operator ==(const wxPoint& p1, const wxPoint& p2);
|
|
|
|
bool operator !=(const wxPoint& p1, const wxPoint& p2);
|
2008-05-02 00:12:39 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
wxPoint operator +(const wxPoint& p1, const wxPoint& p2);
|
|
|
|
wxPoint operator -(const wxPoint& p1, const wxPoint& p2);
|
2008-05-02 00:12:39 -04:00
|
|
|
|
|
|
|
wxPoint& operator +=(const wxPoint& pt);
|
|
|
|
wxPoint& operator -=(const wxPoint& pt);
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
wxPoint operator +(const wxPoint& pt, const wxSize& sz);
|
|
|
|
wxPoint operator -(const wxPoint& pt, const wxSize& sz);
|
|
|
|
wxPoint operator +(const wxSize& sz, const wxPoint& pt);
|
|
|
|
wxPoint operator -(const wxSize& sz, const wxPoint& pt);
|
2008-05-02 00:12:39 -04:00
|
|
|
|
|
|
|
wxPoint& operator +=(const wxSize& sz);
|
|
|
|
wxPoint& operator -=(const wxSize& sz);
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2010-05-30 19:28:14 -04:00
|
|
|
wxSize operator /(const wxPoint& sz, int factor);
|
|
|
|
wxSize operator *(const wxPoint& sz, int factor);
|
|
|
|
wxSize operator *(int factor, const wxSize& sz);
|
|
|
|
wxSize& operator /=(int factor);
|
|
|
|
wxSize& operator *=(int factor);
|
2009-03-15 07:33:40 -04:00
|
|
|
//@}
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2010-08-11 12:03:51 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
@name Defaults handling.
|
|
|
|
|
|
|
|
Test for and set non-specified wxPoint components.
|
|
|
|
|
|
|
|
Although a wxPoint is always initialized to (0, 0), wxWidgets commonly
|
|
|
|
uses wxDefaultCoord (defined as @c -1) to indicate that a point hasn't
|
|
|
|
been initialized or specified. In particular, ::wxDefaultPosition is
|
|
|
|
used in many places with this meaning.
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if neither of the point components is equal to
|
|
|
|
wxDefaultCoord.
|
|
|
|
|
|
|
|
This method is typically used before calling SetDefaults().
|
|
|
|
|
|
|
|
@since 2.9.2
|
|
|
|
*/
|
|
|
|
bool IsFullySpecified() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Combine this object with another one replacing the uninitialized
|
|
|
|
values.
|
|
|
|
|
|
|
|
It is typically used like this:
|
|
|
|
|
|
|
|
@code
|
|
|
|
if ( !pos.IsFullySpecified() )
|
|
|
|
{
|
|
|
|
pos.SetDefaults(GetDefaultPosition());
|
|
|
|
}
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@see IsFullySpecified()
|
|
|
|
|
|
|
|
@since 2.9.2
|
|
|
|
*/
|
2010-11-10 20:29:14 -05:00
|
|
|
void SetDefaults(const wxPoint& pt);
|
2010-08-11 12:03:51 -04:00
|
|
|
//@}
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
x member.
|
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
int x;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
y member.
|
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
int y;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
2008-04-06 11:28:55 -04:00
|
|
|
/**
|
2010-08-11 12:03:51 -04:00
|
|
|
Global instance of a wxPoint initialized with values (-1,-1).
|
2008-04-06 11:28:55 -04:00
|
|
|
*/
|
2010-11-10 20:29:14 -05:00
|
|
|
const wxPoint wxDefaultPosition;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxColourDatabase
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
wxWidgets maintains a database of standard RGB colours for a predefined
|
2008-05-02 00:12:39 -04:00
|
|
|
set of named colours. The application may add to this set if desired by
|
|
|
|
using AddColour() and may use it to look up colours by names using Find()
|
|
|
|
or find the names for the standard colour using FindName().
|
|
|
|
|
|
|
|
There is one predefined, global instance of this class called
|
|
|
|
::wxTheColourDatabase.
|
|
|
|
|
|
|
|
The standard database contains at least the following colours:
|
|
|
|
|
|
|
|
@beginTable
|
|
|
|
<tr><td>
|
|
|
|
AQUAMARINE
|
|
|
|
@n BLACK
|
|
|
|
@n BLUE
|
|
|
|
@n BLUE VIOLET
|
|
|
|
@n BROWN
|
|
|
|
@n CADET BLUE
|
|
|
|
@n CORAL
|
|
|
|
@n CORNFLOWER BLUE
|
|
|
|
@n CYAN
|
|
|
|
@n DARK GREY
|
|
|
|
@n DARK GREEN
|
|
|
|
@n DARK OLIVE GREEN
|
|
|
|
@n DARK ORCHID
|
|
|
|
@n DARK SLATE BLUE
|
|
|
|
@n DARK SLATE GREY
|
|
|
|
@n DARK TURQUOISE
|
|
|
|
@n DIM GREY
|
|
|
|
</td><td>
|
|
|
|
FIREBRICK
|
|
|
|
@n FOREST GREEN
|
|
|
|
@n GOLD
|
|
|
|
@n GOLDENROD
|
|
|
|
@n GREY
|
|
|
|
@n GREEN
|
|
|
|
@n GREEN YELLOW
|
|
|
|
@n INDIAN RED
|
|
|
|
@n KHAKI
|
|
|
|
@n LIGHT BLUE
|
|
|
|
@n LIGHT GREY
|
|
|
|
@n LIGHT STEEL BLUE
|
|
|
|
@n LIME GREEN
|
|
|
|
@n MAGENTA
|
|
|
|
@n MAROON
|
|
|
|
@n MEDIUM AQUAMARINE
|
|
|
|
@n MEDIUM BLUE
|
|
|
|
</td><td>
|
|
|
|
MEDIUM FOREST GREEN
|
|
|
|
@n MEDIUM GOLDENROD
|
|
|
|
@n MEDIUM ORCHID
|
|
|
|
@n MEDIUM SEA GREEN
|
|
|
|
@n MEDIUM SLATE BLUE
|
|
|
|
@n MEDIUM SPRING GREEN
|
|
|
|
@n MEDIUM TURQUOISE
|
|
|
|
@n MEDIUM VIOLET RED
|
|
|
|
@n MIDNIGHT BLUE
|
|
|
|
@n NAVY
|
|
|
|
@n ORANGE
|
|
|
|
@n ORANGE RED
|
|
|
|
@n ORCHID
|
|
|
|
@n PALE GREEN
|
|
|
|
@n PINK
|
|
|
|
@n PLUM
|
|
|
|
@n PURPLE
|
|
|
|
</td><td>
|
|
|
|
RED
|
|
|
|
@n SALMON
|
|
|
|
@n SEA GREEN
|
|
|
|
@n SIENNA
|
|
|
|
@n SKY BLUE
|
|
|
|
@n SLATE BLUE
|
|
|
|
@n SPRING GREEN
|
|
|
|
@n STEEL BLUE
|
|
|
|
@n TAN
|
|
|
|
@n THISTLE
|
|
|
|
@n TURQUOISE
|
|
|
|
@n VIOLET
|
|
|
|
@n VIOLET RED
|
|
|
|
@n WHEAT
|
|
|
|
@n WHITE
|
|
|
|
@n YELLOW
|
|
|
|
@n YELLOW GREEN
|
|
|
|
</td></tr>
|
|
|
|
@endTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
2008-05-02 00:12:39 -04:00
|
|
|
@category{gdi}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxColour
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxColourDatabase
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Constructs the colour database. It will be initialized at the first
|
|
|
|
use.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxColourDatabase();
|
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Adds a colour to the database. If a colour with the same name already
|
|
|
|
exists, it is replaced.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
void AddColour(const wxString& colourName, const wxColour& colour);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Finds a colour given the name. Returns an invalid colour object (that
|
|
|
|
is, wxColour::IsOk() will return @false) if the colour wasn't found in
|
|
|
|
the database.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
wxColour Find(const wxString& colourName) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Finds a colour name given the colour. Returns an empty string if the
|
|
|
|
colour is not found in the database.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxString FindName(const wxColour& colour) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-07-25 07:24:38 -04:00
|
|
|
/**
|
2011-03-22 10:08:30 -04:00
|
|
|
Global instance of a wxColourDatabase.
|
2010-07-25 07:24:38 -04:00
|
|
|
*/
|
|
|
|
wxColourDatabase* wxTheColourDatabase;
|
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxSize
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2010-07-11 06:44:03 -04:00
|
|
|
A wxSize is a useful data structure for graphics operations.
|
2009-03-15 07:33:40 -04:00
|
|
|
It simply contains integer @e width and @e height members.
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2009-03-15 07:33:40 -04:00
|
|
|
Note that the width and height stored inside a wxSize object may be negative
|
|
|
|
and that wxSize functions do not perform any check against negative values
|
|
|
|
(this is used to e.g. store the special -1 value in ::wxDefaultSize instance).
|
|
|
|
See also IsFullySpecified() and SetDefaults() for utility functions regarding
|
|
|
|
the special -1 value.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-05-02 00:12:39 -04:00
|
|
|
wxSize is used throughout wxWidgets as well as wxPoint which, although
|
|
|
|
almost equivalent to wxSize, has a different meaning: wxPoint represents a
|
|
|
|
position while wxSize represents the size.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-05-02 00:12:39 -04:00
|
|
|
@beginWxPythonOnly
|
|
|
|
wxPython defines aliases for the @e x and @e y members named @e width and
|
|
|
|
@e height since it makes much more sense for sizes.
|
|
|
|
@endWxPythonOnly
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{data}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-06 11:28:55 -04:00
|
|
|
@stdobjects
|
|
|
|
::wxDefaultSize
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxPoint, wxRealPoint
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxSize
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2009-03-15 07:33:40 -04:00
|
|
|
Initializes this size object with zero width and height.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxSize();
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2009-03-15 07:33:40 -04:00
|
|
|
/**
|
|
|
|
Initializes this size object with the given @a width and @a height.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxSize(int width, int height);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Decreases the size in both x and y directions.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see IncBy()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2010-07-11 06:44:03 -04:00
|
|
|
void DecBy(const wxPoint& pt);
|
2008-03-08 08:52:38 -05:00
|
|
|
void DecBy(const wxSize& size);
|
2008-03-08 09:43:31 -05:00
|
|
|
void DecBy(int dx, int dy);
|
|
|
|
void DecBy(int d);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Decrements this object so that both of its dimensions are not greater
|
|
|
|
than the corresponding dimensions of the @a size.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see IncTo()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DecTo(const wxSize& size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the height member.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetHeight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the width member.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetWidth() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Increases the size in both x and y directions.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see DecBy()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2010-07-11 06:44:03 -04:00
|
|
|
void IncBy(const wxPoint& pt);
|
2008-03-08 08:52:38 -05:00
|
|
|
void IncBy(const wxSize& size);
|
2008-03-08 09:43:31 -05:00
|
|
|
void IncBy(int dx, int dy);
|
|
|
|
void IncBy(int d);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Increments this object so that both of its dimensions are not less than
|
|
|
|
the corresponding dimensions of the @a size.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see DecTo()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void IncTo(const wxSize& size);
|
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Returns @true if neither of the size object components is equal to -1,
|
|
|
|
which is used as default for the size values in wxWidgets (hence the
|
|
|
|
predefined ::wxDefaultSize has both of its components equal to -1).
|
|
|
|
|
|
|
|
This method is typically used before calling SetDefaults().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsFullySpecified() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Scales the dimensions of this object by the given factors. If you want
|
|
|
|
to scale both dimensions by the same factor you can also use
|
|
|
|
operator*=().
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return A reference to this object (so that you can concatenate other
|
2008-05-02 00:12:39 -04:00
|
|
|
operations in the same line).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-05-02 00:12:39 -04:00
|
|
|
wxSize& Scale(float xscale, float yscale);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the width and height members.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
void Set(int width, int height);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Combine this size object with another one replacing the default (i.e.
|
|
|
|
equal to -1) components of this object with those of the other. It is
|
|
|
|
typically used like this:
|
|
|
|
|
|
|
|
@code
|
|
|
|
if ( !size.IsFullySpecified() )
|
|
|
|
{
|
|
|
|
size.SetDefaults(GetDefaultSize());
|
|
|
|
}
|
|
|
|
@endcode
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see IsFullySpecified()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetDefaults(const wxSize& sizeDefault);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the height.
|
|
|
|
*/
|
|
|
|
void SetHeight(int height);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the width.
|
|
|
|
*/
|
|
|
|
void SetWidth(int width);
|
2008-05-02 00:12:39 -04:00
|
|
|
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2008-05-02 00:12:39 -04:00
|
|
|
/**
|
2009-03-15 07:33:40 -04:00
|
|
|
@name Miscellaneous operators
|
2010-07-11 06:44:03 -04:00
|
|
|
|
2010-05-30 19:28:14 -04:00
|
|
|
Note that these operators are documented as class members
|
|
|
|
(to make them easier to find) but, as their prototype shows,
|
|
|
|
they are implemented as global operators; note that this is
|
|
|
|
transparent to the user but it helps to understand why the
|
|
|
|
following functions are documented to take the wxSize they
|
|
|
|
operate on as an explicit argument.
|
2008-05-02 00:12:39 -04:00
|
|
|
*/
|
2009-03-15 07:33:40 -04:00
|
|
|
//@{
|
2008-10-29 11:34:31 -04:00
|
|
|
wxSize& operator=(const wxSize& sz);
|
2008-05-02 00:12:39 -04:00
|
|
|
|
|
|
|
bool operator ==(const wxSize& s1, const wxSize& s2);
|
|
|
|
bool operator !=(const wxSize& s1, const wxSize& s2);
|
|
|
|
|
|
|
|
wxSize operator +(const wxSize& s1, const wxSize& s2);
|
|
|
|
wxSize operator -(const wxSize& s1, const wxSize& s2);
|
|
|
|
wxSize& operator +=(const wxSize& sz);
|
|
|
|
wxSize& operator -=(const wxSize& sz);
|
|
|
|
|
|
|
|
wxSize operator /(const wxSize& sz, int factor);
|
|
|
|
wxSize operator *(const wxSize& sz, int factor);
|
|
|
|
wxSize operator *(int factor, const wxSize& sz);
|
|
|
|
wxSize& operator /=(int factor);
|
|
|
|
wxSize& operator *=(int factor);
|
2009-03-15 07:33:40 -04:00
|
|
|
//@}
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
2008-04-06 11:28:55 -04:00
|
|
|
/**
|
2008-05-02 00:12:39 -04:00
|
|
|
Global instance of a wxSize object initialized to (-1,-1).
|
2008-04-06 11:28:55 -04:00
|
|
|
*/
|
2010-11-10 20:29:14 -05:00
|
|
|
const wxSize wxDefaultSize;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_gdi */
|
2008-03-08 08:52:38 -05:00
|
|
|
//@{
|
2008-03-11 03:57:21 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-03-20 02:00:05 -04:00
|
|
|
This macro loads a bitmap from either application resources (on the
|
|
|
|
platforms for which they exist, i.e. Windows and OS2) or from an XPM file.
|
|
|
|
This can help to avoid using @ifdef_ when creating bitmaps.
|
|
|
|
|
|
|
|
@see @ref overview_bitmap, wxICON()
|
|
|
|
|
|
|
|
@header{wx/gdicmn.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-20 02:00:05 -04:00
|
|
|
#define wxBITMAP(bitmapName)
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-20 02:00:05 -04:00
|
|
|
This macro loads an icon from either application resources (on the
|
|
|
|
platforms for which they exist, i.e. Windows and OS2) or from an XPM file.
|
|
|
|
This can help to avoid using @ifdef_ when creating icons.
|
|
|
|
|
|
|
|
@see @ref overview_bitmap, wxBITMAP()
|
|
|
|
|
|
|
|
@header{wx/gdicmn.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2009-02-25 08:12:09 -05:00
|
|
|
#define wxICON(iconName)
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-20 02:00:05 -04:00
|
|
|
Returns @true if the display is colour, @false otherwise.
|
|
|
|
|
|
|
|
@header{wx/gdicmn.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-20 02:00:05 -04:00
|
|
|
bool wxColourDisplay();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-20 02:00:05 -04:00
|
|
|
Returns the depth of the display (a value of 1 denotes a monochrome
|
|
|
|
display).
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-20 02:00:05 -04:00
|
|
|
@header{wx/gdicmn.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-20 02:00:05 -04:00
|
|
|
int wxDisplayDepth();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-20 02:00:05 -04:00
|
|
|
Globally sets the cursor; only has an effect on Windows, Mac and GTK+. You
|
|
|
|
should call this function with wxNullCursor to restore the system cursor.
|
|
|
|
|
|
|
|
@see wxCursor, wxWindow::SetCursor()
|
|
|
|
|
|
|
|
@header{wx/gdicmn.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-20 02:00:05 -04:00
|
|
|
void wxSetCursor(const wxCursor& cursor);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-20 02:00:05 -04:00
|
|
|
//@}
|
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_gdi */
|
2008-03-20 02:00:05 -04:00
|
|
|
//@{
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-03-20 02:00:05 -04:00
|
|
|
Returns the dimensions of the work area on the display. On Windows this
|
|
|
|
means the area not covered by the taskbar, etc. Other platforms are
|
|
|
|
currently defaulting to the whole display until a way is found to provide
|
|
|
|
this info for all window managers, etc.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-20 02:00:05 -04:00
|
|
|
@header{wx/gdicmn.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-20 02:00:05 -04:00
|
|
|
void wxClientDisplayRect(int* x, int* y, int* width, int* height);
|
|
|
|
wxRect wxGetClientDisplayRect();
|
|
|
|
//@}
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_gdi */
|
2008-09-21 05:35:49 -04:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the display resolution in pixels per inch.
|
|
|
|
|
2008-09-22 12:06:56 -04:00
|
|
|
The @c x component of the returned wxSize object contains the horizontal
|
|
|
|
resolution and the @c y one -- the vertical resolution.
|
|
|
|
|
2008-09-21 05:35:49 -04:00
|
|
|
@header{wx/gdicmn.h}
|
|
|
|
|
|
|
|
@since 2.9.0
|
|
|
|
*/
|
|
|
|
wxSize wxGetDisplayPPI();
|
|
|
|
//@}
|
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_gdi */
|
2008-03-20 02:00:05 -04:00
|
|
|
//@{
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-03-20 02:00:05 -04:00
|
|
|
Returns the display size in pixels.
|
|
|
|
|
2008-09-22 12:06:56 -04:00
|
|
|
For the version taking @a width and @a header arguments, either of them
|
|
|
|
can be @NULL if the caller is not interested in the returned value.
|
|
|
|
|
2008-03-20 02:00:05 -04:00
|
|
|
@header{wx/gdicmn.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-20 02:00:05 -04:00
|
|
|
void wxDisplaySize(int* width, int* height);
|
|
|
|
wxSize wxGetDisplaySize();
|
|
|
|
//@}
|
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_gdi */
|
2008-03-20 02:00:05 -04:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the display size in millimeters.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-09-22 12:06:56 -04:00
|
|
|
For the version taking @a width and @a header arguments, either of them
|
|
|
|
can be @NULL if the caller is not interested in the returned value.
|
|
|
|
|
|
|
|
@see wxGetDisplayPPI()
|
|
|
|
|
2008-03-20 02:00:05 -04:00
|
|
|
@header{wx/gdicmn.h}
|
|
|
|
*/
|
|
|
|
void wxDisplaySizeMM(int* width, int* height);
|
|
|
|
wxSize wxGetDisplaySizeMM();
|
2008-03-11 03:57:21 -04:00
|
|
|
//@}
|
|
|
|
|