use wxWindowIDRef to transparently implement auto-generated ids ref-counting (slightly modified patch 1835458)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -233,12 +233,6 @@
|
||||
|
||||
typedef short int WXTYPE;
|
||||
|
||||
/* special care should be taken with this type under Windows where the real */
|
||||
/* window id is unsigned, so we must always do the cast before comparing them */
|
||||
/* (or else they would be always different!). Using wxGetWindowId() which does */
|
||||
/* the cast itself is recommended. Note that this type can't be unsigned */
|
||||
/* because wxID_ANY == -1 is a valid (and largely used) value for window id. */
|
||||
typedef int wxWindowID;
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* other feature tests */
|
||||
@@ -1782,8 +1776,19 @@ enum
|
||||
These ids delimit the range used by automatically-generated ids
|
||||
(i.e. those used when wxID_ANY is specified during construction).
|
||||
*/
|
||||
#if defined(__WXMSW__) || wxUSE_AUTOID_MANAGEMENT
|
||||
/*
|
||||
On MSW the range is always restricted no matter if id management
|
||||
is used or not because the native window ids are limited to short
|
||||
range. On other platforms the range is only restricted if id
|
||||
management is used so the reference count buffer won't be so big.
|
||||
*/
|
||||
wxID_AUTO_LOWEST = -32000,
|
||||
wxID_AUTO_HIGHEST = -2000,
|
||||
#else
|
||||
wxID_AUTO_LOWEST = -1000000,
|
||||
wxID_AUTO_HIGHEST = -2000,
|
||||
#endif
|
||||
|
||||
/* no id matches this one when compared to it */
|
||||
wxID_NONE = -3,
|
||||
@@ -1919,6 +1924,19 @@ enum
|
||||
wxID_HIGHEST = 5999
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* wxWindowID type (after wxID_XYZ enum, platform detection, and dlimpexp.h) */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/* special care should be taken with this type under Windows where the real */
|
||||
/* window id is unsigned, so we must always do the cast before comparing them */
|
||||
/* (or else they would be always different!). Using wxGetWindowId() which does */
|
||||
/* the cast itself is recommended. Note that this type can't be unsigned */
|
||||
/* because wxID_ANY == -1 is a valid (and largely used) value for window id. */
|
||||
#ifdef __cplusplus
|
||||
#include "wx/windowid.h"
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* other constants */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user