]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/windowid.h
Make storing non-trivial data in wxThreadSpecificInfo possible.
[wxWidgets.git] / interface / wx / windowid.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: windowid.h
3 // Purpose: interface of wxIdManager
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
7
8 /**
9 The type of unique identifiers (ID) used for wxWindow-derived classes.
10 */
11 typedef int wxWindowID;
12
13 /**
14 @class wxIdManager
15
16 wxIdManager is responsible for allocating and releasing window IDs.
17 It is used by wxWindow::NewControlId() and wxWindow::UnreserveControlId(),
18 and can also be used be used directly.
19
20 @library{wxcore}
21 @category{cfg}
22
23 @see wxWindow::NewControlId(), wxWindow::UnreserveControlId(),
24 @ref overview_windowids
25 */
26 class wxIdManager
27 {
28 public:
29 /**
30 Called directly by wxWindow::NewControlId(), this function will create
31 a new ID or range of IDs.
32 The IDs will be reserved until assigned to a wxWindowIDRef() or unreserved
33 with UnreserveControlId().
34 Only ID values that are not assigned to a wxWindowIDRef() need to be unreserved.
35
36 @param count
37 The number of sequential IDs to reserve.
38
39 @return The value of the first ID in the sequence, or wxID_NONE.
40 */
41 static wxWindowID ReserveId(int count = 1);
42
43 /**
44 Called directly by wxWindow::UnreserveControlId(), this function will
45 unreserve an ID or range of IDs that is currently reserved.
46 This should only be called for IDs returned by ReserveControlId() that
47 have NOT been assigned to a wxWindowIDRef (see @ref overview_windowids).
48
49 @param id
50 The first of the range of IDs to unreserve.
51 @param count
52 The number of sequential IDs to unreserve.
53
54 @return The value of the first ID in the sequence, or wxID_NONE.
55 */
56 static void UnreserveId(wxWindowID id, int count = 1);
57 };
58