]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: windowid.h | |
e54c96f1 | 3 | // Purpose: interface of wxIdManager |
23324ae1 | 4 | // Author: wxWidgets team |
526954c5 | 5 | // Licence: wxWindows licence |
23324ae1 FM |
6 | ///////////////////////////////////////////////////////////////////////////// |
7 | ||
d4bb7c93 FM |
8 | /** |
9 | The type of unique identifiers (ID) used for wxWindow-derived classes. | |
10 | */ | |
11 | typedef int wxWindowID; | |
12 | ||
23324ae1 FM |
13 | /** |
14 | @class wxIdManager | |
7c913512 | 15 | |
f41d6c8c FM |
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. | |
7c913512 | 19 | |
23324ae1 | 20 | @library{wxcore} |
3c99e2fd | 21 | @category{cfg} |
7c913512 | 22 | |
f41d6c8c FM |
23 | @see wxWindow::NewControlId(), wxWindow::UnreserveControlId(), |
24 | @ref overview_windowids | |
23324ae1 | 25 | */ |
7c913512 | 26 | class wxIdManager |
23324ae1 FM |
27 | { |
28 | public: | |
29 | /** | |
f41d6c8c FM |
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. | |
3c4f71cc | 35 | |
7c913512 | 36 | @param count |
4cc4bfaf | 37 | The number of sequential IDs to reserve. |
3c4f71cc | 38 | |
d29a9a8a | 39 | @return The value of the first ID in the sequence, or wxID_NONE. |
23324ae1 | 40 | */ |
a90e69f7 | 41 | static wxWindowID ReserveId(int count = 1); |
f41d6c8c FM |
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 | */ | |
a90e69f7 | 56 | static void UnreserveId(wxWindowID id, int count = 1); |
23324ae1 | 57 | }; |
e54c96f1 | 58 |