Finished initial review of [q-r] by Utensil Candel also making the enumeration lists more readable (one per line).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -270,7 +270,7 @@ GENERATE_CHI = NO
|
|||||||
BINARY_TOC = NO
|
BINARY_TOC = NO
|
||||||
TOC_EXPAND = NO
|
TOC_EXPAND = NO
|
||||||
DISABLE_INDEX = NO
|
DISABLE_INDEX = NO
|
||||||
ENUM_VALUES_PER_LINE = 4
|
ENUM_VALUES_PER_LINE = 1
|
||||||
GENERATE_TREEVIEW = NO
|
GENERATE_TREEVIEW = NO
|
||||||
TREEVIEW_WIDTH = 250
|
TREEVIEW_WIDTH = 250
|
||||||
|
|
||||||
|
@@ -94,7 +94,7 @@ in the distribution.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section page_port_wxmac wxCocoa
|
@section page_port_wxcocoa wxCocoa
|
||||||
|
|
||||||
@htmlonly
|
@htmlonly
|
||||||
<img src="osxleopard_logo.png" alt="Mac OS X (Leopard) logo"
|
<img src="osxleopard_logo.png" alt="Mac OS X (Leopard) logo"
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
platform.
|
platform.
|
||||||
@li @c <wx/confbase.h> - Base config class.
|
@li @c <wx/confbase.h> - Base config class.
|
||||||
@li @c <wx/fileconf.h> - wxFileConfig class.
|
@li @c <wx/fileconf.h> - wxFileConfig class.
|
||||||
@li @c <wx/msw/regconf.h> - wxRegConfig class.
|
@li @c <wx/msw/regconf.h> - wxRegConfig class, see also wxRegKey.
|
||||||
|
|
||||||
|
|
||||||
@section configbase_example Example
|
@section configbase_example Example
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxRegKey
|
@class wxRegKey
|
||||||
@headerfile registry.h wx/msw/registry.h
|
@wxheader{msw/registry.h}
|
||||||
|
|
||||||
wxRegKey is a class representing the Windows registry (it is only available
|
wxRegKey is a class representing the Windows registry (it is only available
|
||||||
under Windows). One can create, query and delete registry keys using this
|
under Windows). One can create, query and delete registry keys using this
|
||||||
@@ -17,37 +17,80 @@
|
|||||||
The Windows registry is easy to understand. There are five registry keys,
|
The Windows registry is easy to understand. There are five registry keys,
|
||||||
namely:
|
namely:
|
||||||
|
|
||||||
HKEY_CLASSES_ROOT (HKCR)
|
@li HKEY_CLASSES_ROOT (HKCR)
|
||||||
HKEY_CURRENT_USER (HKCU)
|
@li HKEY_CURRENT_USER (HKCU)
|
||||||
HKEY_LOCAL_MACHINE (HKLM)
|
@li HKEY_LOCAL_MACHINE (HKLM)
|
||||||
HKEY_CURRENT_CONFIG (HKCC)
|
@li HKEY_CURRENT_CONFIG (HKCC)
|
||||||
HKEY_USERS (HKU)
|
@li HKEY_USERS (HKU)
|
||||||
|
|
||||||
After creating a key, it can hold a value. The values can be:
|
After creating a key, it can hold a value. The values can be:
|
||||||
|
|
||||||
String Value
|
@li String Value
|
||||||
Binary Value
|
@li Binary Value
|
||||||
DWORD Value
|
@li DWORD Value
|
||||||
Multi String Value
|
@li Multi String Value
|
||||||
Expandable String Value
|
@li Expandable String Value
|
||||||
|
|
||||||
@onlyfor{wxmsw}
|
@onlyfor{wxmsw}
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{FIXME}
|
@category{misc}
|
||||||
|
|
||||||
|
@b Example:
|
||||||
|
|
||||||
|
@code
|
||||||
|
wxRegKey *key = new wxRegKey("HKEY_LOCAL_MACHINE\\Software\\MyKey");
|
||||||
|
|
||||||
|
// Create the key if it does not exist.
|
||||||
|
if( !key->Exists() )
|
||||||
|
key->Create();
|
||||||
|
|
||||||
|
// Create a new value "MYVALUE" and set it to 12.
|
||||||
|
key->SetValue("MYVALUE", 12);
|
||||||
|
|
||||||
|
// Read the value back.
|
||||||
|
long value;
|
||||||
|
key->QueryValue("MYVALUE", &value);
|
||||||
|
wxMessageBox(wxString::Format("%d", value), "Registry Value", wxOK);
|
||||||
|
|
||||||
|
// Get the number of subkeys and enumerate them.
|
||||||
|
size_t subkeys;
|
||||||
|
key->GetKeyInfo(&subkeys, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
wxString key_name;
|
||||||
|
key->GetFirstKey(key_name, 1);
|
||||||
|
for(int i = 0; i < subkeys; i++)
|
||||||
|
{
|
||||||
|
wxMessageBox(key_name, "Subkey Name", wxOK);
|
||||||
|
key->GetNextKey(key_name, 1);
|
||||||
|
}
|
||||||
|
@endcode
|
||||||
*/
|
*/
|
||||||
class wxRegKey
|
class wxRegKey
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//@{
|
/**
|
||||||
|
Default constructor, initializes to HKCR.
|
||||||
|
*/
|
||||||
|
wxRegKey();
|
||||||
|
/**
|
||||||
|
The constructor to set the full name of the key.
|
||||||
|
*/
|
||||||
|
wxRegKey(const wxString& strKey);
|
||||||
/**
|
/**
|
||||||
The constructor to set the full name of the key under a previously created
|
The constructor to set the full name of the key under a previously created
|
||||||
parent.
|
parent.
|
||||||
*/
|
*/
|
||||||
wxRegKey();
|
|
||||||
wxRegKey(const wxString& strKey);
|
|
||||||
wxRegKey(const wxRegKey& keyParent, const wxString& strKey);
|
wxRegKey(const wxRegKey& keyParent, const wxString& strKey);
|
||||||
//@}
|
|
||||||
|
/**
|
||||||
|
Access modes for wxRegKey.
|
||||||
|
*/
|
||||||
|
enum AccessMode
|
||||||
|
{
|
||||||
|
Read, ///< Read-only
|
||||||
|
Write ///< Read and Write
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Closes the key.
|
Closes the key.
|
||||||
@@ -78,7 +121,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
Returns @true if the key exists.
|
Returns @true if the key exists.
|
||||||
*/
|
*/
|
||||||
static bool Exists() const;
|
bool Exists() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gets the first key.
|
Gets the first key.
|
||||||
@@ -102,8 +145,8 @@ public:
|
|||||||
@param pnMaxValueLen
|
@param pnMaxValueLen
|
||||||
The maximum length of a value.
|
The maximum length of a value.
|
||||||
*/
|
*/
|
||||||
bool GetKeyInfo(size_t* pnSubKeys, size_t* pnValues,
|
bool GetKeyInfo(size_t* pnSubKeys, size_t* pnMaxKeyLen,
|
||||||
size_t* pnMaxValueLen) const;
|
size_t* pnValues, size_t* pnMaxValueLen) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gets the name of the registry key.
|
Gets the name of the registry key.
|
||||||
@@ -152,18 +195,20 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Explicitly opens the key. This method also allows the key to be opened in
|
Explicitly opens the key. This method also allows the key to be opened in
|
||||||
read-only mode by passing @c Read() instead of default
|
read-only mode by passing wxRegKey::Read instead of default
|
||||||
@c Write() parameter.
|
wxRegKey::Write parameter.
|
||||||
*/
|
*/
|
||||||
bool Open(AccessMode mode = Write);
|
bool Open(AccessMode mode = Write);
|
||||||
|
|
||||||
//@{
|
/**
|
||||||
|
Retrieves the string value.
|
||||||
|
*/
|
||||||
|
bool QueryValue(const wxChar* szValue, wxString& strValue) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves the numeric value.
|
Retrieves the numeric value.
|
||||||
*/
|
*/
|
||||||
bool QueryValue(const wxChar* szValue, wxString& strValue) const;
|
|
||||||
const bool QueryValue(const wxChar* szValue, long* plValue) const;
|
const bool QueryValue(const wxChar* szValue, long* plValue) const;
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Renames the key.
|
Renames the key.
|
||||||
@@ -176,16 +221,19 @@ public:
|
|||||||
bool RenameValue(const wxChar* szValueOld,
|
bool RenameValue(const wxChar* szValueOld,
|
||||||
const wxChar* szValueNew);
|
const wxChar* szValueNew);
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Sets the given @a szValue which must be numeric, string or binary depending
|
Sets the given @a szValue which must be numeric.
|
||||||
on the overload used. If the value doesn't exist, it is created.
|
If the value doesn't exist, it is created.
|
||||||
*/
|
*/
|
||||||
bool SetValue(const wxChar* szValue, long lValue);
|
bool SetValue(const wxChar* szValue, long lValue);
|
||||||
bool SetValue(const wxChar* szValue,
|
/**
|
||||||
const wxString& strValue);
|
Sets the given @a szValue which must be string.
|
||||||
bool SetValue(const wxChar* szValue,
|
If the value doesn't exist, it is created.
|
||||||
const wxMemoryBuffer& buf);
|
*/
|
||||||
//@}
|
bool SetValue(const wxChar* szValue, const wxString& strValue);
|
||||||
|
/**
|
||||||
|
Sets the given @a szValue which must be binary.
|
||||||
|
If the value doesn't exist, it is created.
|
||||||
|
*/
|
||||||
|
bool SetValue(const wxChar* szValue, const wxMemoryBuffer& buf);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@anchor wxRE_FLAGS
|
||||||
|
|
||||||
Flags for regex compilation to be used with Compile().
|
Flags for regex compilation to be used with Compile().
|
||||||
*/
|
*/
|
||||||
enum
|
enum
|
||||||
@@ -38,6 +40,8 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@anchor wxRE_NOT_FLAGS
|
||||||
|
|
||||||
Flags for regex matching to be used with Matches().
|
Flags for regex matching to be used with Matches().
|
||||||
These flags are mainly useful when doing several matches in a long string
|
These flags are mainly useful when doing several matches in a long string
|
||||||
to prevent erroneous matches for <20><><EFBFBD><EFBFBD> and <20><>$<24><>:
|
to prevent erroneous matches for <20><><EFBFBD><EFBFBD> and <20><>$<24><>:
|
||||||
@@ -120,7 +124,7 @@ public:
|
|||||||
Create and compile the regular expression, use
|
Create and compile the regular expression, use
|
||||||
IsValid() to test for compilation errors.
|
IsValid() to test for compilation errors.
|
||||||
|
|
||||||
@todo Add referece to the flag enum.
|
As for the flags, please see @ref wxRE_FLAGS.
|
||||||
*/
|
*/
|
||||||
wxRegEx(const wxString& expr, int flags = wxRE_DEFAULT);
|
wxRegEx(const wxString& expr, int flags = wxRE_DEFAULT);
|
||||||
|
|
||||||
@@ -134,7 +138,7 @@ public:
|
|||||||
Compile the string into regular expression, return @true if ok or @false
|
Compile the string into regular expression, return @true if ok or @false
|
||||||
if string has a syntax error.
|
if string has a syntax error.
|
||||||
|
|
||||||
@todo Add referece to the flag enum.
|
As for the flags, please see @ref wxRE_FLAGS.
|
||||||
*/
|
*/
|
||||||
bool Compile(const wxString& pattern, int flags = wxRE_DEFAULT);
|
bool Compile(const wxString& pattern, int flags = wxRE_DEFAULT);
|
||||||
|
|
||||||
@@ -179,8 +183,8 @@ public:
|
|||||||
Matches the precompiled regular expression against the string @a text,
|
Matches the precompiled regular expression against the string @a text,
|
||||||
returns @true if matches and @false otherwise.
|
returns @true if matches and @false otherwise.
|
||||||
|
|
||||||
@e Flags may be combination of @c wxRE_NOTBOL and @c wxRE_NOTEOL.
|
@e Flags may be combination of @c wxRE_NOTBOL and @c wxRE_NOTEOL, see
|
||||||
@todo Add referece to the flag enum.
|
@ref wxRE_NOT_FLAGS.
|
||||||
|
|
||||||
Some regex libraries assume that the text given is null terminated, while
|
Some regex libraries assume that the text given is null terminated, while
|
||||||
others require the length be given as a separate parameter. Therefore for
|
others require the length be given as a separate parameter. Therefore for
|
||||||
@@ -202,8 +206,8 @@ public:
|
|||||||
Matches the precompiled regular expression against the string @a text,
|
Matches the precompiled regular expression against the string @a text,
|
||||||
returns @true if matches and @false otherwise.
|
returns @true if matches and @false otherwise.
|
||||||
|
|
||||||
@e Flags may be combination of @c wxRE_NOTBOL and @c wxRE_NOTEOL.
|
@e Flags may be combination of @c wxRE_NOTBOL and @c wxRE_NOTEOL, see
|
||||||
@todo Add referece to the flag enum.
|
@ref wxRE_NOT_FLAGS.
|
||||||
|
|
||||||
May only be called after successful call to Compile().
|
May only be called after successful call to Compile().
|
||||||
*/
|
*/
|
||||||
|
@@ -6,6 +6,31 @@
|
|||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
Types of results returned from a call to wxRegion::Contains().
|
||||||
|
*/
|
||||||
|
enum wxRegionContain
|
||||||
|
{
|
||||||
|
/** The specified value is not contained within this region. */
|
||||||
|
wxOutRegion = 0,
|
||||||
|
|
||||||
|
/**
|
||||||
|
The specified value is partially contained within this region.
|
||||||
|
|
||||||
|
On Windows, this result is not supported. ::wxInRegion will be returned
|
||||||
|
instead.
|
||||||
|
*/
|
||||||
|
wxPartRegion = 1,
|
||||||
|
|
||||||
|
/**
|
||||||
|
The specified value is fully contained within this region.
|
||||||
|
|
||||||
|
On Windows, this result will be returned even if only part of the specified
|
||||||
|
value is contained in this region.
|
||||||
|
*/
|
||||||
|
wxInRegion = 2
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxRegionIterator
|
@class wxRegionIterator
|
||||||
@wxheader{region.h}
|
@wxheader{region.h}
|
||||||
@@ -30,16 +55,17 @@
|
|||||||
class wxRegionIterator : public wxObject
|
class wxRegionIterator : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//@{
|
/**
|
||||||
|
Default constructor.
|
||||||
|
*/
|
||||||
|
wxRegionIterator();
|
||||||
/**
|
/**
|
||||||
Creates an iterator object given a region.
|
Creates an iterator object given a region.
|
||||||
*/
|
*/
|
||||||
wxRegionIterator();
|
|
||||||
wxRegionIterator(const wxRegion& region);
|
wxRegionIterator(const wxRegion& region);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
An alias for GetHeight.
|
An alias for GetHeight().
|
||||||
*/
|
*/
|
||||||
wxCoord GetH() const;
|
wxCoord GetH() const;
|
||||||
|
|
||||||
@@ -54,7 +80,7 @@ public:
|
|||||||
wxRect GetRect() const;
|
wxRect GetRect() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
An alias for GetWidth.
|
An alias for GetWidth().
|
||||||
*/
|
*/
|
||||||
wxCoord GetW() const;
|
wxCoord GetW() const;
|
||||||
|
|
||||||
@@ -78,22 +104,29 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool HaveRects() const;
|
bool HaveRects() const;
|
||||||
|
|
||||||
//@{
|
/**
|
||||||
|
Resets the iterator to the beginning of the rectangles.
|
||||||
|
*/
|
||||||
|
void Reset();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Resets the iterator to the given region.
|
Resets the iterator to the given region.
|
||||||
*/
|
*/
|
||||||
void Reset();
|
|
||||||
void Reset(const wxRegion& region);
|
void Reset(const wxRegion& region);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Increment operator. Increments the iterator to the next region.
|
Increment operator. Increments the iterator to the next region.
|
||||||
|
|
||||||
|
@beginWxPythonOnly
|
||||||
|
A wxPython alias for this operator is called Next.
|
||||||
|
@endWxPythonOnly
|
||||||
*/
|
*/
|
||||||
void operator ++();
|
void operator ++();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns @true if there are still some rectangles; otherwise returns @false.
|
Returns @true if there are still some rectangles; otherwise returns @false.
|
||||||
You can use this to test the iterator object as if it were of type bool.
|
|
||||||
|
You can use this to test the iterator object as if it were of type @c bool.
|
||||||
*/
|
*/
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
};
|
};
|
||||||
@@ -106,13 +139,16 @@ public:
|
|||||||
|
|
||||||
A wxRegion represents a simple or complex region on a device context or window.
|
A wxRegion represents a simple or complex region on a device context or window.
|
||||||
|
|
||||||
This class uses @ref overview_trefcount "reference counting and copy-on-write"
|
This class uses @ref overview_refcount "reference counting and copy-on-write"
|
||||||
internally so that assignments between two instances of this class are very
|
internally so that assignments between two instances of this class are very
|
||||||
cheap. You can therefore use actual objects instead of pointers without
|
cheap. You can therefore use actual objects instead of pointers without
|
||||||
efficiency problems. If an instance of this class is changed it will create
|
efficiency problems. If an instance of this class is changed it will create
|
||||||
its own data internally so that other instances, which previously shared the
|
its own data internally so that other instances, which previously shared the
|
||||||
data using the reference counting, are not affected.
|
data using the reference counting, are not affected.
|
||||||
|
|
||||||
|
@stdobjects
|
||||||
|
- ::wxNullRegion
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@category{data,gdi}
|
@category{data,gdi}
|
||||||
|
|
||||||
@@ -121,26 +157,47 @@ public:
|
|||||||
class wxRegion : public wxGDIObject
|
class wxRegion : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//@{
|
/**
|
||||||
|
Default constructor.
|
||||||
|
*/
|
||||||
|
wxRegion();
|
||||||
|
/**
|
||||||
|
Constructs a rectangular region with the given position and size.
|
||||||
|
*/
|
||||||
|
wxRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
|
/**
|
||||||
|
Constructs a rectangular region from the top left point and the bottom right
|
||||||
|
point.
|
||||||
|
*/
|
||||||
|
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
|
||||||
|
/**
|
||||||
|
Constructs a rectangular region a wxRect object.
|
||||||
|
*/
|
||||||
|
wxRegion(const wxRect& rect);
|
||||||
|
/**
|
||||||
|
Copy constructor, uses @ref overview_refcount.
|
||||||
|
*/
|
||||||
|
wxRegion(const wxRegion& region);
|
||||||
|
/**
|
||||||
|
Constructs a region corresponding to the polygon made of @a n points
|
||||||
|
in the provided array.
|
||||||
|
@a fillStyle parameter may have values @c wxWINDING_RULE or @c wxODDEVEN_RULE.
|
||||||
|
*/
|
||||||
|
wxRegion(size_t n, const wxPoint* points, int fillStyle = wxWINDING_RULE);
|
||||||
|
/**
|
||||||
|
Constructs a region using a bitmap. See Union() for more details.
|
||||||
|
*/
|
||||||
|
wxRegion(const wxBitmap& bmp);
|
||||||
/**
|
/**
|
||||||
Constructs a region using the non-transparent pixels of a bitmap. See
|
Constructs a region using the non-transparent pixels of a bitmap. See
|
||||||
Union() for more details.
|
Union() for more details.
|
||||||
*/
|
*/
|
||||||
wxRegion();
|
|
||||||
wxRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
|
||||||
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
|
|
||||||
wxRegion(const wxRect& rect);
|
|
||||||
wxRegion(const wxRegion& region);
|
|
||||||
wxRegion(size_t n, const wxPoint points,
|
|
||||||
int fillStyle = wxWINDING_RULE);
|
|
||||||
wxRegion(const wxBitmap& bmp);
|
|
||||||
wxRegion(const wxBitmap& bmp, const wxColour& transColour,
|
wxRegion(const wxBitmap& bmp, const wxColour& transColour,
|
||||||
int tolerance = 0);
|
int tolerance = 0);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor.
|
Destructor.
|
||||||
See @ref overview_refcountdestruct "reference-counted object destruction" for
|
See @ref overview_refcount_destruct "reference-counted object destruction" for
|
||||||
more info.
|
more info.
|
||||||
*/
|
*/
|
||||||
~wxRegion();
|
~wxRegion();
|
||||||
@@ -150,21 +207,40 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
//@{
|
/**
|
||||||
|
Returns a value indicating whether the given point is contained within the region.
|
||||||
|
|
||||||
|
@return The return value is one of @c wxOutRegion and @c wxInRegion.
|
||||||
|
*/
|
||||||
|
wxRegionContain Contains(long& x, long& y) const;
|
||||||
|
/**
|
||||||
|
Returns a value indicating whether the given point is contained within the region.
|
||||||
|
|
||||||
|
@return The return value is one of @c wxOutRegion and @c wxInRegion.
|
||||||
|
*/
|
||||||
|
wxRegionContain Contains(const wxPoint& pt) const;
|
||||||
/**
|
/**
|
||||||
Returns a value indicating whether the given rectangle is contained within the
|
Returns a value indicating whether the given rectangle is contained within the
|
||||||
region.
|
region.
|
||||||
|
|
||||||
@return The return value is one of wxOutRegion, wxPartRegion and
|
@return One of ::wxOutRegion, ::wxPartRegion or ::wxInRegion.
|
||||||
wxInRegion.
|
|
||||||
|
@note On Windows, only ::wxOutRegion and ::wxInRegion are returned; a value
|
||||||
|
::wxInRegion then indicates that all or some part of the region is
|
||||||
|
contained in this region.
|
||||||
*/
|
*/
|
||||||
wxRegionContain Contains(long& x, long& y) const;
|
wxRegionContain Contains(long& x, long& y, long& width, long& height) const;
|
||||||
const wxRegionContain Contains(const wxPoint& pt) const;
|
/**
|
||||||
const wxRegionContain Contains(long& x, long& y,
|
Returns a value indicating whether the given rectangle is contained within the
|
||||||
long& width,
|
region.
|
||||||
long& height) const;
|
|
||||||
const wxRegionContain Contains(const wxRect& rect) const;
|
@return One of ::wxOutRegion, ::wxPartRegion or ::wxInRegion.
|
||||||
//@}
|
|
||||||
|
@note On Windows, only ::wxOutRegion and ::wxInRegion are returned; a value
|
||||||
|
::wxInRegion then indicates that all or some part of the region is
|
||||||
|
contained in this region.
|
||||||
|
*/
|
||||||
|
wxRegionContain Contains(const wxRect& rect) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Convert the region to a black and white bitmap with the white pixels
|
Convert the region to a black and white bitmap with the white pixels
|
||||||
@@ -181,9 +257,9 @@ public:
|
|||||||
const wxRect GetBox() const;
|
const wxRect GetBox() const;
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Finds the intersection of this region and another region.
|
Finds the intersection of this region and another, rectangular region,
|
||||||
|
specified using position and size.
|
||||||
|
|
||||||
@return @true if successful, @false otherwise.
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
@@ -193,9 +269,26 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool Intersect(wxCoord x, wxCoord y, wxCoord width,
|
bool Intersect(wxCoord x, wxCoord y, wxCoord width,
|
||||||
wxCoord height);
|
wxCoord height);
|
||||||
|
/**
|
||||||
|
Finds the intersection of this region and another, rectangular region.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks Creates the intersection of the two regions, that is, the parts
|
||||||
|
which are in both regions. The result is stored in this
|
||||||
|
region.
|
||||||
|
*/
|
||||||
bool Intersect(const wxRect& rect);
|
bool Intersect(const wxRect& rect);
|
||||||
|
/**
|
||||||
|
Finds the intersection of this region and another region.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks Creates the intersection of the two regions, that is, the parts
|
||||||
|
which are in both regions. The result is stored in this
|
||||||
|
region.
|
||||||
|
*/
|
||||||
bool Intersect(const wxRegion& region);
|
bool Intersect(const wxRegion& region);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns @true if the region is empty, @false otherwise.
|
Returns @true if the region is empty, @false otherwise.
|
||||||
@@ -204,8 +297,10 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Returns @true if the region is equal to, i.e. covers the same area as,
|
Returns @true if the region is equal to, i.e. covers the same area as,
|
||||||
another one. Note that if both this region and @a region are invalid, they
|
another one.
|
||||||
are considered to be equal.
|
|
||||||
|
@note If both this region and @a region are invalid, they are
|
||||||
|
considered to be equal.
|
||||||
*/
|
*/
|
||||||
bool IsEqual(const wxRegion& region) const;
|
bool IsEqual(const wxRegion& region) const;
|
||||||
|
|
||||||
@@ -221,7 +316,16 @@ public:
|
|||||||
bool Offset(const wxPoint& pt);
|
bool Offset(const wxPoint& pt);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
/**
|
||||||
|
Subtracts a rectangular region from this region.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks This operation combines the parts of 'this' region that are not
|
||||||
|
part of the second region. The result is stored in this
|
||||||
|
region.
|
||||||
|
*/
|
||||||
|
bool Subtract(const wxRect& rect);
|
||||||
/**
|
/**
|
||||||
Subtracts a region from this region.
|
Subtracts a region from this region.
|
||||||
|
|
||||||
@@ -231,16 +335,11 @@ public:
|
|||||||
part of the second region. The result is stored in this
|
part of the second region. The result is stored in this
|
||||||
region.
|
region.
|
||||||
*/
|
*/
|
||||||
bool Subtract(const wxRect& rect);
|
|
||||||
bool Subtract(const wxRegion& region);
|
bool Subtract(const wxRegion& region);
|
||||||
//@}
|
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Finds the union of this region and the non-transparent pixels of a
|
Finds the union of this region and another, rectangular region, specified using
|
||||||
bitmap. Colour to be treated as transparent is specified in the
|
position and size.
|
||||||
@a transColour argument, along with an
|
|
||||||
optional colour tolerance value.
|
|
||||||
|
|
||||||
@return @true if successful, @false otherwise.
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
@@ -249,14 +348,73 @@ public:
|
|||||||
region.
|
region.
|
||||||
*/
|
*/
|
||||||
bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
|
/**
|
||||||
|
Finds the union of this region and another, rectangular region.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks This operation creates a region that combines all of this region
|
||||||
|
and the second region. The result is stored in this
|
||||||
|
region.
|
||||||
|
*/
|
||||||
bool Union(const wxRect& rect);
|
bool Union(const wxRect& rect);
|
||||||
|
/**
|
||||||
|
Finds the union of this region and another region.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks This operation creates a region that combines all of this region
|
||||||
|
and the second region. The result is stored in this
|
||||||
|
region.
|
||||||
|
*/
|
||||||
bool Union(const wxRegion& region);
|
bool Union(const wxRegion& region);
|
||||||
|
/**
|
||||||
|
Finds the union of this region and the non-transparent pixels of a
|
||||||
|
bitmap. The bitmap's mask is used to determine transparency. If the
|
||||||
|
bitmap doesn't have a mask, the bitmap's full dimensions are used.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks This operation creates a region that combines all of this region
|
||||||
|
and the second region. The result is stored in this
|
||||||
|
region.
|
||||||
|
*/
|
||||||
bool Union(const wxBitmap& bmp);
|
bool Union(const wxBitmap& bmp);
|
||||||
|
/**
|
||||||
|
Finds the union of this region and the non-transparent pixels of a
|
||||||
|
bitmap. Colour to be treated as transparent is specified in the
|
||||||
|
@a transColour argument, along with an optional colour tolerance value.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks This operation creates a region that combines all of this region
|
||||||
|
and the second region. The result is stored in this
|
||||||
|
region.
|
||||||
|
*/
|
||||||
bool Union(const wxBitmap& bmp, const wxColour& transColour,
|
bool Union(const wxBitmap& bmp, const wxColour& transColour,
|
||||||
int tolerance = 0);
|
int tolerance = 0);
|
||||||
//@}
|
|
||||||
|
|
||||||
//@{
|
/**
|
||||||
|
Finds the Xor of this region and another, rectangular region, specified using
|
||||||
|
position and size.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks This operation creates a region that combines all of this region
|
||||||
|
and the second region, except for any overlapping
|
||||||
|
areas. The result is stored in this region.
|
||||||
|
*/
|
||||||
|
bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
|
/**
|
||||||
|
Finds the Xor of this region and another, rectangular region.
|
||||||
|
|
||||||
|
@return @true if successful, @false otherwise.
|
||||||
|
|
||||||
|
@remarks This operation creates a region that combines all of this region
|
||||||
|
and the second region, except for any overlapping
|
||||||
|
areas. The result is stored in this region.
|
||||||
|
*/
|
||||||
|
bool Xor(const wxRect& rect);
|
||||||
/**
|
/**
|
||||||
Finds the Xor of this region and another region.
|
Finds the Xor of this region and another region.
|
||||||
|
|
||||||
@@ -266,14 +424,15 @@ public:
|
|||||||
and the second region, except for any overlapping
|
and the second region, except for any overlapping
|
||||||
areas. The result is stored in this region.
|
areas. The result is stored in this region.
|
||||||
*/
|
*/
|
||||||
bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
|
||||||
bool Xor(const wxRect& rect);
|
|
||||||
bool Xor(const wxRegion& region);
|
bool Xor(const wxRegion& region);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Assignment operator, using @ref overview_trefcount "reference counting".
|
Assignment operator, using @ref overview_refcount.
|
||||||
*/
|
*/
|
||||||
void operator =(const wxRegion& region);
|
void operator =(const wxRegion& region);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
An empty region.
|
||||||
|
*/
|
||||||
|
wxRegion wxNullRegion;
|
||||||
|
@@ -1,44 +1,131 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: renderer.h
|
// Name: renderer.h
|
||||||
// Purpose: interface of wxSplitterRenderParams
|
// Purpose: interface of wxRendererNative
|
||||||
// Author: wxWidgets team
|
// Author: wxWidgets team
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxSplitterRenderParams
|
@anchor wxCONTROL_FLAGS
|
||||||
|
|
||||||
|
The following rendering flags are defined for wxRendererNative:
|
||||||
|
*/
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
/** Control is disabled. */
|
||||||
|
wxCONTROL_DISABLED = 0x00000001,
|
||||||
|
|
||||||
|
/** Currently has keyboard focus. */
|
||||||
|
wxCONTROL_FOCUSED = 0x00000002,
|
||||||
|
|
||||||
|
/** (Button) is pressed. */
|
||||||
|
wxCONTROL_PRESSED = 0x00000004,
|
||||||
|
|
||||||
|
/** Control-specific bit. */
|
||||||
|
wxCONTROL_SPECIAL = 0x00000008,
|
||||||
|
|
||||||
|
/** Only for the buttons. */
|
||||||
|
wxCONTROL_ISDEFAULT = wxCONTROL_SPECIAL,
|
||||||
|
|
||||||
|
/** Only for the menu items. */
|
||||||
|
wxCONTROL_ISSUBMENU = wxCONTROL_SPECIAL,
|
||||||
|
|
||||||
|
/** Only for the tree items. */
|
||||||
|
wxCONTROL_EXPANDED = wxCONTROL_SPECIAL,
|
||||||
|
|
||||||
|
/** Only for the status bar panes. */
|
||||||
|
wxCONTROL_SIZEGRIP = wxCONTROL_SPECIAL,
|
||||||
|
|
||||||
|
/** Checkboxes only: flat border. */
|
||||||
|
wxCONTROL_FLAT = wxCONTROL_SPECIAL,
|
||||||
|
|
||||||
|
/** Mouse is currently over the control. */
|
||||||
|
wxCONTROL_CURRENT = 0x00000010,
|
||||||
|
|
||||||
|
/** Selected item in e.g. listbox. */
|
||||||
|
wxCONTROL_SELECTED = 0x00000020,
|
||||||
|
|
||||||
|
/** (Check/radio button) is checked. */
|
||||||
|
wxCONTROL_CHECKED = 0x00000040,
|
||||||
|
|
||||||
|
/** (Menu) item can be checked. */
|
||||||
|
wxCONTROL_CHECKABLE = 0x00000080,
|
||||||
|
|
||||||
|
/** (Check) undetermined state. */
|
||||||
|
wxCONTROL_UNDETERMINED = wxCONTROL_CHECKABLE
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@struct wxSplitterRenderParams
|
||||||
@wxheader{renderer.h}
|
@wxheader{renderer.h}
|
||||||
|
|
||||||
This is just a simple @c struct used as a return value of
|
This is just a simple @c struct used as a return value of
|
||||||
wxRendererNative::GetSplitterParams.
|
wxRendererNative::GetSplitterParams().
|
||||||
|
|
||||||
It doesn't have any methods and all of its fields are constant and so can be
|
It doesn't have any methods and all of its fields are constant, so they can
|
||||||
only examined but not modified.
|
only be examined but not modified.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{FIXME}
|
@category{gdi}
|
||||||
*/
|
*/
|
||||||
class wxSplitterRenderParams
|
struct wxSplitterRenderParams
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
/**
|
/**
|
||||||
const wxCoord border
|
The only way to initialize this struct is by using this ctor.
|
||||||
|
*/
|
||||||
|
wxSplitterRenderParams(wxCoord widthSash_, wxCoord border_, bool isSens_);
|
||||||
|
|
||||||
|
/**
|
||||||
The width of the border drawn by the splitter inside it, may be 0.
|
The width of the border drawn by the splitter inside it, may be 0.
|
||||||
*/
|
*/
|
||||||
|
const wxCoord border;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
const bool isHotSensitive
|
|
||||||
@true if the sash changes appearance when the mouse passes over it, @false
|
@true if the sash changes appearance when the mouse passes over it, @false
|
||||||
otherwise.
|
otherwise.
|
||||||
*/
|
*/
|
||||||
|
const bool isHotSensitive;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
const wxCoord widthSash
|
|
||||||
The width of the splitter sash.
|
The width of the splitter sash.
|
||||||
*/
|
*/
|
||||||
|
const wxCoord widthSash;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@struct wxHeaderButtonParams
|
||||||
|
@wxheader{renderer.h}
|
||||||
|
|
||||||
|
This @c struct can optionally be used with
|
||||||
|
wxRendererNative::DrawHeaderButton() to specify custom values used to draw
|
||||||
|
the text or bitmap label.
|
||||||
|
|
||||||
|
@library{wxbase}
|
||||||
|
@category{gdi}
|
||||||
|
*/
|
||||||
|
struct wxHeaderButtonParams
|
||||||
|
{
|
||||||
|
wxHeaderButtonParams();
|
||||||
|
|
||||||
|
wxColour m_arrowColour;
|
||||||
|
wxColour m_selectionColour;
|
||||||
|
wxString m_labelText;
|
||||||
|
wxFont m_labelFont;
|
||||||
|
wxColour m_labelColour;
|
||||||
|
wxBitmap m_labelBitmap;
|
||||||
|
int m_labelAlignment;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Used to specify the type of sort arrow used with
|
||||||
|
wxRendererNative::DrawHeaderButton().
|
||||||
|
*/
|
||||||
|
enum wxHeaderSortIconType
|
||||||
|
{
|
||||||
|
wxHDR_SORT_ICON_NONE, ///< Don't draw a sort arrow.
|
||||||
|
wxHDR_SORT_ICON_UP, ///< Draw a sort arrow icon pointing up.
|
||||||
|
wxHDR_SORT_ICON_DOWN ///< Draw a sort arrow icon pointing down.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -69,31 +156,76 @@ public:
|
|||||||
be a real renderer which does the drawing.
|
be a real renderer which does the drawing.
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@category{FIXME}
|
@category{gdi}
|
||||||
|
|
||||||
|
@see wxRendererNative
|
||||||
*/
|
*/
|
||||||
class wxDelegateRendererNative : public wxRendererNative
|
class wxDelegateRendererNative : public wxRendererNative
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
The default constructor does the same thing as the other one except that it
|
The default constructor does the same thing as the other one except that it
|
||||||
uses the @ref wxRendererNative::getgeneric "generic renderer" instead of the
|
uses the @ref wxRendererNative::GetGeneric() "generic renderer" instead of the
|
||||||
user-specified @e rendererNative.
|
user-specified @a rendererNative.
|
||||||
|
|
||||||
In any case, this sets up the delegate renderer object to follow all calls to
|
In any case, this sets up the delegate renderer object to follow all calls to
|
||||||
the specified real renderer.
|
the specified real renderer.
|
||||||
Note that this object does not take ownership of (i.e. won't delete)
|
|
||||||
@e rendererNative.
|
|
||||||
*/
|
*/
|
||||||
wxDelegateRendererNative();
|
wxDelegateRendererNative();
|
||||||
wxDelegateRendererNative(wxRendererNative& rendererNative);
|
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class also provides all the virtual methods of
|
This constructor uses the user-specified @a rendererNative to set up the delegate
|
||||||
wxRendererNative, please refer to that class
|
renderer object to follow all calls to the specified real renderer.
|
||||||
documentation for the details.
|
|
||||||
|
@note
|
||||||
|
This object does not take ownership of (i.e. won't delete) @a rendererNative.
|
||||||
*/
|
*/
|
||||||
DrawXXX(...);
|
wxDelegateRendererNative(wxRendererNative& rendererNative);
|
||||||
|
|
||||||
|
// The rest of these functions inherit the documentation from wxRendererNative
|
||||||
|
|
||||||
|
virtual int DrawHeaderButton(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0,
|
||||||
|
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
|
||||||
|
wxHeaderButtonParams* params = NULL);
|
||||||
|
|
||||||
|
virtual int DrawHeaderButtonContents(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0,
|
||||||
|
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
|
||||||
|
wxHeaderButtonParams* params = NULL);
|
||||||
|
|
||||||
|
virtual int GetHeaderButtonHeight(wxWindow *win);
|
||||||
|
|
||||||
|
virtual void DrawTreeItemButton(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0);
|
||||||
|
|
||||||
|
virtual void DrawSplitterBorder(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0);
|
||||||
|
|
||||||
|
virtual void DrawSplitterSash(wxWindow *win, wxDC& dc,
|
||||||
|
const wxSize& size, wxCoord position,
|
||||||
|
wxOrientation orient, int flags = 0);
|
||||||
|
|
||||||
|
virtual void DrawComboBoxDropButton(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0);
|
||||||
|
|
||||||
|
virtual void DrawDropArrow(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0);
|
||||||
|
|
||||||
|
virtual void DrawCheckBox(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0 );
|
||||||
|
|
||||||
|
virtual void DrawPushButton(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0 );
|
||||||
|
|
||||||
|
virtual void DrawItemSelectionRect(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0 );
|
||||||
|
|
||||||
|
virtual void DrawFocusRect(wxWindow* win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0);
|
||||||
|
|
||||||
|
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win);
|
||||||
|
|
||||||
|
virtual wxRendererVersion GetVersion() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -102,7 +234,7 @@ public:
|
|||||||
@class wxRendererNative
|
@class wxRendererNative
|
||||||
@wxheader{renderer.h}
|
@wxheader{renderer.h}
|
||||||
|
|
||||||
First, a brief introduction to wxRenderer and why it is needed.
|
First, a brief introduction to wxRendererNative and why it is needed.
|
||||||
|
|
||||||
Usually wxWidgets uses the underlying low level GUI system to draw all the
|
Usually wxWidgets uses the underlying low level GUI system to draw all the
|
||||||
controls - this is what we mean when we say that it is a "native" framework.
|
controls - this is what we mean when we say that it is a "native" framework.
|
||||||
@@ -115,7 +247,7 @@ public:
|
|||||||
appearance is different under different platforms while the lines are always
|
appearance is different under different platforms while the lines are always
|
||||||
drawn in the same way.
|
drawn in the same way.
|
||||||
|
|
||||||
This is why we have renderers: wxRenderer is a class which virtualizes the
|
This is why we have renderers: wxRendererNative is a class which virtualizes the
|
||||||
drawing, i.e. it abstracts the drawing operations and allows you to draw say, a
|
drawing, i.e. it abstracts the drawing operations and allows you to draw say, a
|
||||||
button, without caring about exactly how this is done. Of course, as we
|
button, without caring about exactly how this is done. Of course, as we
|
||||||
can draw the button differently in different renderers, this also allows us to
|
can draw the button differently in different renderers, this also allows us to
|
||||||
@@ -124,23 +256,23 @@ public:
|
|||||||
So the renderers work by exposing a large set of high-level drawing functions
|
So the renderers work by exposing a large set of high-level drawing functions
|
||||||
which are used by the generic controls. There is always a default global
|
which are used by the generic controls. There is always a default global
|
||||||
renderer but it may be changed or extended by the user, see
|
renderer but it may be changed or extended by the user, see
|
||||||
@ref overview_samplerender "Render sample".
|
@ref page_samples_render.
|
||||||
|
|
||||||
All drawing functions take some standard parameters:
|
All drawing functions take some standard parameters:
|
||||||
|
|
||||||
@e win is the window being drawn. It is normally not used and when
|
@li @a win - The window being drawn. It is normally not used and when
|
||||||
it is it should only be used as a generic wxWindow
|
it is it should only be used as a generic wxWindow
|
||||||
(in order to get its low level handle, for example), but you should
|
(in order to get its low level handle, for example), but you should
|
||||||
not assume that it is of some given type as the same renderer
|
not assume that it is of some given type as the same renderer
|
||||||
function may be reused for drawing different kinds of control.
|
function may be reused for drawing different kinds of control.
|
||||||
@e dc is the wxDC to draw on. Only this device
|
@li @a dc - The wxDC to draw on. Only this device
|
||||||
context should be used for drawing. It is not necessary to restore
|
context should be used for drawing. It is not necessary to restore
|
||||||
pens and brushes for it on function exit but, on the other hand, you
|
pens and brushes for it on function exit but, on the other hand, you
|
||||||
shouldn't assume that it is in any specific state on function entry:
|
shouldn't assume that it is in any specific state on function entry:
|
||||||
the rendering functions should always prepare it.
|
the rendering functions should always prepare it.
|
||||||
@e rect the bounding rectangle for the element to be drawn.
|
@li @a rect - The bounding rectangle for the element to be drawn.
|
||||||
@e flags the optional flags (none by default) which can be a
|
@li @a flags - The optional flags (none by default) which can be a
|
||||||
combination of the @c wxCONTROL_XXX constants below.
|
combination of the @ref wxCONTROL_FLAGS.
|
||||||
|
|
||||||
Note that each drawing function restores the wxDC attributes if
|
Note that each drawing function restores the wxDC attributes if
|
||||||
it changes them, so it is safe to assume that the same pen, brush and colours
|
it changes them, so it is safe to assume that the same pen, brush and colours
|
||||||
@@ -159,110 +291,130 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Draw a check box (used by wxDataViewCtrl).
|
Draw a check box (used by wxDataViewCtrl).
|
||||||
|
|
||||||
@a flags may have the @c wxCONTROL_CHECKED, @c wxCONTROL_CURRENT or
|
@a flags may have the @c wxCONTROL_CHECKED, @c wxCONTROL_CURRENT or
|
||||||
@c wxCONTROL_UNDETERMINED bit set.
|
@c wxCONTROL_UNDETERMINED bit set, see @ref wxCONTROL_FLAGS.
|
||||||
*/
|
*/
|
||||||
void DrawCheckBox(wxWindow* win, wxDC& dc, const wxRect& rect,
|
virtual void DrawCheckBox(wxWindow* win, wxDC& dc,
|
||||||
int flags);
|
const wxRect& rect, int flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw a button like the one used by wxComboBox to show a
|
Draw a button like the one used by wxComboBox to show a
|
||||||
drop down window. The usual appearance is a downwards pointing arrow.
|
drop down window. The usual appearance is a downwards pointing arrow.
|
||||||
@a flags may have the @c wxCONTROL_PRESSED or @c wxCONTROL_CURRENT bit set.
|
|
||||||
|
@a flags may have the @c wxCONTROL_PRESSED or @c wxCONTROL_CURRENT bit set,
|
||||||
|
see @ref wxCONTROL_FLAGS.
|
||||||
*/
|
*/
|
||||||
void DrawComboBoxDropButton(wxWindow* win, wxDC& dc,
|
virtual void DrawComboBoxDropButton(wxWindow* win, wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
int flags);
|
int flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw a drop down arrow that is suitable for use outside a combo box. Arrow will
|
Draw a drop down arrow that is suitable for use outside a combo box. Arrow will
|
||||||
have
|
have transparent background.
|
||||||
transparent background.
|
|
||||||
@a rect is not entirely filled by the arrow. Instead, you should use bounding
|
@a rect is not entirely filled by the arrow. Instead, you should use bounding
|
||||||
rectangle of a drop down button which arrow matches the size you need.
|
rectangle of a drop down button which arrow matches the size you need.
|
||||||
@a flags may have the @c wxCONTROL_PRESSED or @c wxCONTROL_CURRENT bit set.
|
|
||||||
|
@a flags may have the @c wxCONTROL_PRESSED or @c wxCONTROL_CURRENT bit set,
|
||||||
|
see @ref wxCONTROL_FLAGS.
|
||||||
*/
|
*/
|
||||||
void DrawDropArrow(wxWindow* win, wxDC& dc, const wxRect& rect,
|
virtual void DrawDropArrow(wxWindow* win, wxDC& dc, const wxRect& rect,
|
||||||
int flags);
|
int flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw a focus rectangle using the specified rectangle.
|
Draw a focus rectangle using the specified rectangle.
|
||||||
wxListCtrl. The only supported flags is
|
wxListCtrl.
|
||||||
@c wxCONTROL_SELECTED for items which are selected.
|
|
||||||
|
The only supported flags is @c wxCONTROL_SELECTED for items which are selected.
|
||||||
|
see @ref wxCONTROL_FLAGS.
|
||||||
*/
|
*/
|
||||||
void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect,
|
virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect,
|
||||||
int flags = 0);
|
int flags = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw the header control button (used, for example, by
|
Draw the header control button (used, for example, by wxListCtrl).
|
||||||
wxListCtrl). Depending on platforms the
|
|
||||||
@a flags parameter may support the @c wxCONTROL_SELECTED
|
Depending on platforms the @a flags parameter may support the @c wxCONTROL_SELECTED
|
||||||
@c wxCONTROL_DISABLED and @c wxCONTROL_CURRENT bits.
|
@c wxCONTROL_DISABLED and @c wxCONTROL_CURRENT bits, see @ref wxCONTROL_FLAGS.
|
||||||
The @a sortArrow parameter can be one of
|
|
||||||
@c wxHDR_SORT_ICON_NONE, @c wxHDR_SORT_ICON_UP, or
|
@return
|
||||||
@c wxHDR_SORT_ICON_DOWN. Additional values controlling the
|
The optimal width to contain the the unabreviated label text or
|
||||||
drawing of a text or bitmap label can be passed in @e params. The
|
bitmap, the sort arrow if present, and internal margins.
|
||||||
value returned is the optimal width to contain the the unabreviated
|
|
||||||
label text or bitmap, the sort arrow if present, and internal margins.
|
|
||||||
*/
|
*/
|
||||||
int DrawHeaderButton(wxWindow* win, wxDC& dc, const wxRect& rect,
|
virtual int DrawHeaderButton(wxWindow* win, wxDC& dc,
|
||||||
int flags = 0,
|
const wxRect& rect, int flags = 0,
|
||||||
|
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
|
||||||
|
wxHeaderButtonParams* params = NULL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Draw the contents of a header control button (label, sort arrows,
|
||||||
|
etc.). This function is normally only called by DrawHeaderButton().
|
||||||
|
|
||||||
|
Depending on platforms the @a flags parameter may support the @c wxCONTROL_SELECTED
|
||||||
|
@c wxCONTROL_DISABLED and @c wxCONTROL_CURRENT bits, see @ref wxCONTROL_FLAGS.
|
||||||
|
|
||||||
|
@return
|
||||||
|
The optimal width to contain the the unabreviated label text or
|
||||||
|
bitmap, the sort arrow if present, and internal margins.
|
||||||
|
*/
|
||||||
|
virtual int DrawHeaderButtonContents(wxWindow *win, wxDC& dc,
|
||||||
|
const wxRect& rect, int flags = 0,
|
||||||
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
|
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
|
||||||
wxHeaderButtonParams* params = NULL);
|
wxHeaderButtonParams* params = NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw a selection rectangle underneath the text as used e.g. in a
|
Draw a selection rectangle underneath the text as used e.g. in a
|
||||||
wxListCtrl. The supported @a flags are
|
wxListCtrl.
|
||||||
@c wxCONTROL_SELECTED for items which are selected (e.g. often a blue
|
|
||||||
rectangle) and @c wxCONTROL_CURRENT for the item that has the focus
|
The supported @a flags are @c wxCONTROL_SELECTED for items
|
||||||
(often a dotted line around the item's text). @c wxCONTROL_FOCUSED may
|
which are selected (e.g. often a blue rectangle) and @c wxCONTROL_CURRENT
|
||||||
be used to indicate if the control has the focus (othewise the the selection
|
for the item that has the focus (often a dotted line around the item's text).
|
||||||
rectangle is e.g. often grey and not blue). This may be ignored by the renderer
|
@c wxCONTROL_FOCUSED may be used to indicate if the control has the focus
|
||||||
or deduced by the code directly from the @e win.
|
(othewise the the selection rectangle is e.g. often grey and not blue).
|
||||||
|
This may be ignored by the renderer or deduced by the code directly from
|
||||||
|
the @a win.
|
||||||
*/
|
*/
|
||||||
void DrawItemSelectionRect(wxWindow* win, wxDC& dc,
|
virtual void DrawItemSelectionRect(wxWindow* win, wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect, int flags = 0);
|
||||||
int flags = 0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw a blank push button that looks very similar to wxButton.
|
Draw a blank push button that looks very similar to wxButton.
|
||||||
|
|
||||||
@a flags may have the @c wxCONTROL_PRESSED, @c wxCONTROL_CURRENT or
|
@a flags may have the @c wxCONTROL_PRESSED, @c wxCONTROL_CURRENT or
|
||||||
@c wxCONTROL_ISDEFAULT bit set.
|
@c wxCONTROL_ISDEFAULT bit set, see @ref wxCONTROL_FLAGS.
|
||||||
*/
|
*/
|
||||||
void DrawPushButton(wxWindow* win, wxDC& dc, const wxRect& rect,
|
virtual void DrawPushButton(wxWindow* win, wxDC& dc,
|
||||||
int flags);
|
const wxRect& rect, int flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw the border for sash window: this border must be such that the sash
|
Draw the border for sash window: this border must be such that the sash
|
||||||
drawn by @ref drawsplittersash() DrawSash blends into it
|
drawn by DrawSplitterSash() blends into it well.
|
||||||
well.
|
|
||||||
*/
|
*/
|
||||||
void DrawSplitterBorder(wxWindow* win, wxDC& dc,
|
virtual void DrawSplitterBorder(wxWindow* win, wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect, int flags = 0);
|
||||||
int flags = 0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw a sash. The @a orient parameter defines whether the sash should be
|
Draw a sash. The @a orient parameter defines whether the sash should be
|
||||||
vertical or horizontal and how the @a position should be interpreted.
|
vertical or horizontal and how the @a position should be interpreted.
|
||||||
*/
|
*/
|
||||||
void DrawSplitterSash(wxWindow* win, wxDC& dc,
|
virtual void DrawSplitterSash(wxWindow* win, wxDC& dc,
|
||||||
const wxSize& size,
|
const wxSize& size, wxCoord position,
|
||||||
wxCoord position,
|
wxOrientation orient, int flags = 0);
|
||||||
wxOrientation orient,
|
|
||||||
int flags = 0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw the expanded/collapsed icon for a tree control item. To draw an expanded
|
Draw the expanded/collapsed icon for a tree control item.
|
||||||
button the @a flags parameter must contain @c wxCONTROL_EXPANDED bit.
|
|
||||||
|
To draw an expanded button the @a flags parameter must contain @c wxCONTROL_EXPANDED bit,
|
||||||
|
see @ref wxCONTROL_FLAGS.
|
||||||
*/
|
*/
|
||||||
void DrawTreeItemButton(wxWindow* win, wxDC& dc,
|
virtual void DrawTreeItemButton(wxWindow* win, wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect, int flags = 0);
|
||||||
int flags = 0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return the currently used renderer.
|
Return the currently used renderer.
|
||||||
*/
|
*/
|
||||||
wxRendererNative Get();
|
static wxRendererNative Get();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return the default (native) implementation for this platform -- this is also
|
Return the default (native) implementation for this platform -- this is also
|
||||||
@@ -270,67 +422,70 @@ public:
|
|||||||
Set() in which case the return value of this
|
Set() in which case the return value of this
|
||||||
method may be different from the return value of Get().
|
method may be different from the return value of Get().
|
||||||
*/
|
*/
|
||||||
wxRendererNative GetDefault();
|
static wxRendererNative GetDefault();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return the generic implementation of the renderer. Under some platforms, this
|
Return the generic implementation of the renderer. Under some platforms, this
|
||||||
is the default renderer implementation, others have platform-specific default
|
is the default renderer implementation, others have platform-specific default
|
||||||
renderer which can be retrieved by calling GetDefault().
|
renderer which can be retrieved by calling GetDefault().
|
||||||
*/
|
*/
|
||||||
wxRendererNative GetGeneric();
|
static wxRendererNative GetGeneric();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the height of a header button, either a fixed platform height if
|
Returns the height of a header button, either a fixed platform height if
|
||||||
available, or a
|
available, or a
|
||||||
generic height based on the window's font.
|
generic height based on the window's font.
|
||||||
*/
|
*/
|
||||||
int GetHeaderButtonHeight(const wxWindow* win);
|
virtual int GetHeaderButtonHeight(wxWindow* win);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the splitter parameters, see
|
Get the splitter parameters, see
|
||||||
wxSplitterRenderParams.
|
wxSplitterRenderParams.
|
||||||
*/
|
*/
|
||||||
wxSplitterRenderParams GetSplitterParams(const wxWindow* win);
|
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow* win);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function is used for version checking: Load()
|
This function is used for version checking: Load()
|
||||||
refuses to load any shared libraries implementing an older or incompatible
|
refuses to load any shared libraries implementing an older or incompatible
|
||||||
version.
|
version.
|
||||||
|
|
||||||
|
@remarks
|
||||||
The implementation of this method is always the same in all renderers (simply
|
The implementation of this method is always the same in all renderers (simply
|
||||||
construct wxRendererVersion using the
|
construct wxRendererVersion using the @c wxRendererVersion::Current_XXX values),
|
||||||
@c wxRendererVersion::Current_XXX values), but it has to be in the derived,
|
but it has to be in the derived, not base, class, to detect mismatches between
|
||||||
not base, class, to detect mismatches between the renderers versions and so you
|
the renderers versions and so you have to implement it anew in all renderers.
|
||||||
have to implement it anew in all renderers.
|
|
||||||
*/
|
*/
|
||||||
wxRendererVersion GetVersion() const;
|
virtual wxRendererVersion GetVersion() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Load the renderer from the specified DLL, the returned pointer must be
|
Load the renderer from the specified DLL, the returned pointer must be
|
||||||
deleted by caller if not @NULL when it is not used any more.
|
deleted by caller if not @NULL when it is not used any more.
|
||||||
|
|
||||||
The @a name should be just the base name of the renderer and not the full
|
The @a name should be just the base name of the renderer and not the full
|
||||||
name of the DLL file which is constructed differently (using
|
name of the DLL file which is constructed differently (using
|
||||||
wxDynamicLibrary::CanonicalizePluginName)
|
wxDynamicLibrary::CanonicalizePluginName())
|
||||||
on different systems.
|
on different systems.
|
||||||
*/
|
*/
|
||||||
wxRendererNative* Load(const wxString& name);
|
static wxRendererNative* Load(const wxString& name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set the renderer to use, passing @NULL reverts to using the default
|
Set the renderer to use, passing @NULL reverts to using the default
|
||||||
renderer (the global renderer must always exist).
|
renderer (the global renderer must always exist).
|
||||||
|
|
||||||
Return the previous renderer used with Set() or @NULL if none.
|
Return the previous renderer used with Set() or @NULL if none.
|
||||||
*/
|
*/
|
||||||
wxRendererNative* Set(wxRendererNative* renderer);
|
static wxRendererNative* Set(wxRendererNative* renderer);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxRendererVersion
|
@struct wxRendererVersion
|
||||||
@wxheader{renderer.h}
|
@wxheader{renderer.h}
|
||||||
|
|
||||||
This simple struct represents the wxRendererNative
|
This simple struct represents the wxRendererNative
|
||||||
interface version and is only used as the return value of
|
interface version and is only used as the return value of
|
||||||
wxRendererNative::GetVersion.
|
wxRendererNative::GetVersion().
|
||||||
|
|
||||||
The version has two components: the version itself and the age. If the main
|
The version has two components: the version itself and the age. If the main
|
||||||
program and the renderer have different versions they are never compatible with
|
program and the renderer have different versions they are never compatible with
|
||||||
@@ -342,29 +497,27 @@ public:
|
|||||||
done by IsCompatible() method.
|
done by IsCompatible() method.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{FIXME}
|
@category{gdi}
|
||||||
*/
|
*/
|
||||||
class wxRendererVersion
|
struct wxRendererVersion
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
/**
|
/**
|
||||||
Checks if the main program is compatible with the renderer having the version
|
Checks if the main program is compatible with the renderer having the version
|
||||||
@e ver, returns @true if it is and @false otherwise.
|
@e ver, returns @true if it is and @false otherwise.
|
||||||
This method is used by
|
|
||||||
wxRendererNative::Load to determine whether a
|
This method is used by wxRendererNative::Load() to determine whether a
|
||||||
renderer can be used.
|
renderer can be used.
|
||||||
*/
|
*/
|
||||||
static bool IsCompatible(const wxRendererVersion& ver);
|
static bool IsCompatible(const wxRendererVersion& ver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
const int age
|
|
||||||
The age component.
|
The age component.
|
||||||
*/
|
*/
|
||||||
|
const int age;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
const int version
|
|
||||||
The version component.
|
The version component.
|
||||||
*/
|
*/
|
||||||
|
const int version;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user