/////////////////////////////////////////////////////////////////////////////
// Name: dc.h
-// Purpose: documentation for wxDC class
+// Purpose: interface of wxDC
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows license
them.
@library{wxcore}
- @category{dc}
+ @category{dc,gdi}
- @seealso
- Overview
+ @see Overview()
*/
class wxDC : public wxObject
{
Copy from a source DC to this DC, specifying the destination
coordinates, size of area to copy, source DC, source coordinates,
logical function, whether to use a bitmap mask, and mask source position.
-
+
@param xdest
Destination device context x position.
@param ydest
with the bitmap
selected into the source device context. The Windows implementation does
the following if MaskBlt cannot be used:
-
-
+
+
Creates a temporary bitmap and copies the destination area into it.
Copies the source area into the temporary bitmap using the specified
logical function.
and the background colour set to WHITE.
ORs the temporary bitmap with the destination area.
Deletes the temporary bitmap.
-
-
+
+
This sequence of operations ensures that the source's transparent area need
not be black,
and logical functions are supported.
and ysrc
will be assumed for the mask source position. Currently only implemented on
Windows.
-
+
@remarks There is partial support for Blit in wxPostScriptDC, under X.
-
+
@see StretchBlit(), wxMemoryDC, wxBitmap, wxMask
*/
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width,
Adds the specified point to the bounding box which can be retrieved with
MinX(), MaxX() and
MinY(), MaxY() functions.
-
+
@see ResetBoundingBox()
*/
void CalcBoundingBox(wxCoord x, wxCoord y);
//@{
/**
Draws a circle with the given centre and radius.
-
+
@see DrawEllipse()
*/
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius);
Draws an ellipse contained in the rectangle specified either with the given top
left corner and the given size or directly. The current pen is used for the
outline and the current brush for filling the shape.
-
+
@see DrawCircle()
*/
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width,
particular, a font different from @c wxNORMAL_FONT should be used as the
latter is not a TrueType font. @c wxSWISS_FONT is an example of a font
which is.
-
+
@see DrawText()
*/
void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
/**
Gets the brush used for painting the background (see wxDC::SetBackground).
*/
- const wxBrush GetBackground();
+ const wxBrush GetBackground() const;
/**
Returns the current background mode: @c wxSOLID or @c wxTRANSPARENT.
-
+
@see SetBackgroundMode()
*/
- int GetBackgroundMode();
+ int GetBackgroundMode() const;
/**
Gets the current brush (see wxDC::SetBrush).
*/
- const wxBrush GetBrush();
+ const wxBrush GetBrush() const;
/**
Gets the character height of the currently set font.
/**
Returns the depth (number of bits/pixel) of this DC.
-
- @see wxDisplayDepth
+
+ @see wxDisplayDepth()
*/
- int GetDepth();
+ int GetDepth() const;
/**
Gets the current font. Notice that even although each device context object has
initially and only after calling SetFont() a valid
font is returned.
*/
- const wxFont GetFont();
+ const wxFont GetFont() const;
/**
Gets the current layout direction of the device context. On platforms where RTL
is supported, the return value will either be @c wxLayout_LeftToRight or
@c wxLayout_RightToLeft. If RTL layout is not supported, the return value will
be @c wxLayout_Default.
-
+
@see SetLayoutDirection()
*/
- wxLayoutDirection GetLayoutDirection();
+ wxLayoutDirection GetLayoutDirection() const;
/**
Gets the current logical function (see wxDC::SetLogicalFunction).
If the optional parameter @a font is specified and valid, then it is used
for the text extent calculation. Otherwise the currently selected font is.
Note that this function works both with single-line and multi-line strings.
-
+
@see wxFont, SetFont(), GetPartialTextExtents(), GetTextExtent()
*/
void GetMultiLineTextExtent(const wxString& string, wxCoord* w,
wxCoord* h,
wxCoord* heightLine = NULL,
- wxFont* font = NULL);
- wxSize GetMultiLineTextExtent(const wxString& string);
+ wxFont* font = NULL) const;
+ const wxSize GetMultiLineTextExtent(const wxString& string) const;
//@}
/**
Returns the resolution of the device in pixels per inch.
*/
- wxSize GetPPI();
+ wxSize GetPPI() const;
/**
Fills the @a widths array with the widths from the beginning of
various platforms have a native API function that is faster or more
accurate than the generic implementation then it should be used
instead.
-
+
@see GetMultiLineTextExtent(), GetTextExtent()
*/
bool GetPartialTextExtents(const wxString& text,
- wxArrayInt& widths);
+ wxArrayInt& widths) const;
/**
Gets the current pen (see wxDC::SetPen).
*/
- const wxPen GetPen();
+ const wxPen GetPen() const;
/**
Gets in @a colour the colour at the specified location.
represent the maximum horizontal and vertical 'pixel' values used in your
application, the following code will scale the graphic to fit on the
printer page:
-
-
+
+
@b GetSize()
-
+
Returns a Wx::Size
-
+
@b GetSizeWH()
-
+
Returns a 2-element list
@c ( width, height )
*/
- void GetSize(wxCoord* width, wxCoord* height);
- wxSize GetSize();
+ void GetSize(wxCoord* width, wxCoord* height) const;
+ const wxSize GetSize() const;
//@}
//@{
/**
Returns the horizontal and vertical resolution in millimetres.
*/
- void GetSizeMM(wxCoord* width, wxCoord* height);
- wxSize GetSizeMM();
+ void GetSizeMM(wxCoord* width, wxCoord* height) const;
+ const wxSize GetSizeMM() const;
//@}
/**
Gets the current text background colour (see wxDC::SetTextBackground).
*/
- const wxColour GetTextBackground();
+ const wxColour GetTextBackground() const;
//@{
/**
If the optional parameter @a font is specified and valid, then it is used
for the text extent calculation. Otherwise the currently selected font is.
Note that this function only works with single-line strings.
-
+
@see wxFont, SetFont(), GetPartialTextExtents(),
GetMultiLineTextExtent()
*/
wxCoord* h,
wxCoord* descent = NULL,
wxCoord* externalLeading = NULL,
- const wxFont* font = NULL);
- wxSize GetTextExtent(const wxString& string);
+ const wxFont* font = NULL) const;
+ const wxSize GetTextExtent(const wxString& string) const;
//@}
/**
Gets the current text foreground colour (see wxDC::SetTextForeground).
*/
- const wxColour GetTextForeground();
+ const wxColour GetTextForeground() const;
/**
Gets the current user scale factor (set by wxDC::SetUserScale).
/**
Resets the bounding box: after a call to this function, the bounding box
doesn't contain anything.
-
+
@see CalcBoundingBox()
*/
void ResetBoundingBox();
Sets the x and y axis orientation (i.e., the direction from lowest to
highest values on the axis). The default orientation is
x axis from left to right and y axis from top down.
-
+
@param xLeftRight
True to set the x axis orientation to the natural
left to right orientation, @false to invert it.
The clipping region is an area to which drawing is restricted. Possible uses
for the clipping region are for clipping text or for speeding up window redraws
when only a known area of the screen is damaged.
-
+
@see DestroyClippingRegion(), wxRegion
*/
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width,
/**
Sets the current layout direction for the device context. @a dir may be either
@c wxLayout_Default, @c wxLayout_LeftToRight or @c wxLayout_RightToLeft.
-
+
@see GetLayoutDirection()
*/
void SetLayoutDirection(wxLayoutDirection dir);
The possible values
and their meaning in terms of source and destination pixel values are
as follows:
-
+
The default is wxCOPY, which simply draws with the current colour.
The others combine the current colour and the background using a
logical operation. wxINVERT is commonly used for drawing rubber bands or
Drawing to a Windows printer device context uses the current mapping mode,
but mapping mode is currently ignored for PostScript output.
The mapping mode can be one of the following:
-
+
wxMM_TWIPS
-
+
Each logical unit is 1/20 of a point, or 1/1440 of
an inch.
-
+
wxMM_POINTS
-
+
Each logical unit is a point, or 1/72 of an inch.
-
+
wxMM_METRIC
-
+
Each logical unit is 1 mm.
-
+
wxMM_LOMETRIC
-
+
Each logical unit is 1/10 of a mm.
-
+
wxMM_TEXT
-
+
Each logical unit is 1 device pixel.
*/
void SetMapMode(int int);
coordinates, destination size, source DC, source coordinates,
size of source area to copy, logical function, whether to use a bitmap mask,
and mask source position.
-
+
@param xdest
Destination device context x position.
@param ydest
with the bitmap
selected into the source device context. The Windows implementation does
the following if MaskBlt cannot be used:
-
-
+
+
Creates a temporary bitmap and copies the destination area into it.
Copies the source area into the temporary bitmap using the specified
logical function.
and the background colour set to WHITE.
ORs the temporary bitmap with the destination area.
Deletes the temporary bitmap.
-
-
+
+
This sequence of operations ensures that the source's transparent area need
not be black,
and logical functions are supported.
and ysrc
will be assumed for the mask source position. Currently only implemented on
Windows.
-
+
@remarks There is partial support for Blit in wxPostScriptDC, under X.
*/
bool StretchBlit(wxCoord xdest, wxCoord ydest, wxCoord dstWidth,
};
+
/**
@class wxDCClipper
@wxheader{dc.h}
@library{wxcore}
@category{gdi}
- @seealso
- wxDC::SetClippingRegion
+ @see wxDC::SetClippingRegion
*/
class wxDCClipper
{
wxDCClipper(wxDC& dc, int x, int y, int w, int h);
//@}
};
+