Classes | |
class | wxRealPoint |
A wxRealPoint is a useful data structure for graphics operations. More... | |
class | wxRect |
A class for manipulating rectangles. More... | |
class | wxPoint |
A wxPoint is a useful data structure for graphics operations. More... | |
class | wxColourDatabase |
wxWidgets maintains a database of standard RGB colours for a predefined set of named colours. More... | |
class | wxSize |
A wxSize is a useful data structure for graphics operations. More... | |
Macros | |
#define | wxBITMAP(bitmapName) |
This macro loads a bitmap from either application resources (on the platforms for which they exist, i.e. | |
#define | wxBITMAP_PNG(bitmapName) |
Creates a bitmap from either application resources or embedded image data in PNG format. | |
#define | wxBITMAP_PNG_FROM_DATA(bitmapName) |
Creates a bitmap from embedded image data in PNG format. | |
#define | wxICON(iconName) |
This macro loads an icon from either application resources (on the platforms for which they exist, i.e. | |
Functions | |
bool | wxColourDisplay () |
Returns true if the display is colour, false otherwise. | |
int | wxDisplayDepth () |
Returns the depth of the display (a value of 1 denotes a monochrome display). | |
void | wxSetCursor (const wxCursor &cursor) |
Globally sets the cursor; only has an effect on Windows, Mac and GTK+. | |
void | wxClientDisplayRect (int *x, int *y, int *width, int *height) |
Returns the dimensions of the work area on the display. | |
wxRect | wxGetClientDisplayRect () |
Returns the dimensions of the work area on the display. | |
wxSize | wxGetDisplayPPI () |
Returns the display resolution in pixels per inch. | |
void | wxDisplaySize (int *width, int *height) |
Returns the display size in pixels. | |
wxSize | wxGetDisplaySize () |
Returns the display size in pixels. | |
void | wxDisplaySizeMM (int *width, int *height) |
Returns the display size in millimeters. | |
wxSize | wxGetDisplaySizeMM () |
Returns the display size in millimeters. | |
Variables | |
const wxPoint | wxDefaultPosition |
Global instance of a wxPoint initialized with values (-1,-1). | |
wxColourDatabase * | wxTheColourDatabase |
Global instance of a wxColourDatabase. | |
const wxSize | wxDefaultSize |
Global instance of a wxSize object initialized to (-1,-1). | |
#define wxBITMAP | ( | bitmapName | ) |
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.
Include file:
#include <wx/gdicmn.h>
#define wxBITMAP_PNG | ( | bitmapName | ) |
Creates a bitmap from either application resources or embedded image data in PNG format.
This macro is similar to wxBITMAP() but works with bitmap data in PNG format and not BMP or XPM.
Under Windows the given bitmapName must be present in the application resource file with the type RCDATA
and refer to a PNG image. I.e. you should have a definition similar to the following in your .rc file:
to be able to use wxBITMAP_PNG(mybitmap)
in the code.
Under OS X the file with the specified name and "png" extension must be present in the "Resources" subdirectory of the application bundle.
Under the other platforms, this is equivalent to wxBITMAP_PNG_FROM_DATA() and so loads the image data from the array called bitmapName_png
that must exist. Notice that it must be an array and not a pointer as the macro needs to be able to determine its size. Such an array can be produced by a number of conversion programs. A very simple one is included in wxWidgets distribution as misc/scripts/png2c.py
.
Finally notice that you must register PNG image handler to be able to load bitmaps from PNG data. This can be done either by calling wxInitAllImageHandlers() which also registers all the other image formats or including the necessary header:
and calling
in your application startup code.
Include file:
#include <wx/gdicmn.h>
#define wxBITMAP_PNG_FROM_DATA | ( | bitmapName | ) |
Creates a bitmap from embedded image data in PNG format.
This macro is a thin wrapper around wxBitmap::NewFromPNGData() and takes just the base name of the array containing the image data and computes its size internally. In other words, the array called bitmapName_png
must exist. Notice that it must be an array and not a pointer as the macro needs to be able to determine its size. Such an array can be produced by a number of conversion programs. A very simple one is included in wxWidgets distribution as misc/scripts/png2c.py
.
You can use wxBITMAP_PNG() to load the PNG bitmaps from resources on the platforms that support this and only fall back to loading them from data under the other ones (i.e. not Windows and not OS X).
Include file:
#include <wx/gdicmn.h>
#define wxICON | ( | iconName | ) |
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.
Include file:
#include <wx/gdicmn.h>
enum wxBitmapType |
Bitmap type flags.
See wxBitmap and wxImage classes.
enum wxPolygonFillMode |
enum wxStockCursor |
Standard cursors.
Notice that under wxMSW some of these cursors are defined in 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.
void wxClientDisplayRect | ( | int * | x, |
int * | y, | ||
int * | width, | ||
int * | height | ||
) |
Returns the dimensions of the work area on the display.
This is the same as wxGetClientDisplayRect() but allows retrieving the individual components instead of the entire rectangle.
Any of the output pointers can be NULL if the corresponding value is not needed by the caller.
Include file:
#include <wx/gdicmn.h>
bool wxColourDisplay | ( | ) |
Returns true if the display is colour, false otherwise.
Include file:
#include <wx/gdicmn.h>
int wxDisplayDepth | ( | ) |
Returns the depth of the display (a value of 1 denotes a monochrome display).
Include file:
#include <wx/gdicmn.h>
void wxDisplaySize | ( | int * | width, |
int * | height | ||
) |
Returns the display size in pixels.
Either of output pointers can be NULL if the caller is not interested in the corresponding value.
Include file:
#include <wx/gdicmn.h>
void wxDisplaySizeMM | ( | int * | width, |
int * | height | ||
) |
Returns the display size in millimeters.
Either of output pointers can be NULL if the caller is not interested in the corresponding value.
Include file:
#include <wx/gdicmn.h>
wxRect wxGetClientDisplayRect | ( | ) |
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.
Include file:
#include <wx/gdicmn.h>
wxSize wxGetDisplayPPI | ( | ) |
wxSize wxGetDisplaySize | ( | ) |
wxSize wxGetDisplaySizeMM | ( | ) |
void wxSetCursor | ( | const wxCursor & | cursor | ) |
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.
Include file:
#include <wx/gdicmn.h>
wxColourDatabase* wxTheColourDatabase |
Global instance of a wxColourDatabase.