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