]>
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$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxIdManager | |
7c913512 | 11 | |
f41d6c8c FM |
12 | wxIdManager is responsible for allocating and releasing window IDs. |
13 | It is used by wxWindow::NewControlId() and wxWindow::UnreserveControlId(), | |
14 | and can also be used be used directly. | |
7c913512 | 15 | |
23324ae1 | 16 | @library{wxcore} |
f41d6c8c | 17 | @category{misc} |
7c913512 | 18 | |
f41d6c8c FM |
19 | @see wxWindow::NewControlId(), wxWindow::UnreserveControlId(), |
20 | @ref overview_windowids | |
23324ae1 | 21 | */ |
7c913512 | 22 | class wxIdManager |
23324ae1 FM |
23 | { |
24 | public: | |
25 | /** | |
f41d6c8c FM |
26 | Called directly by wxWindow::NewControlId(), this function will create |
27 | a new ID or range of IDs. | |
28 | The IDs will be reserved until assigned to a wxWindowIDRef() or unreserved | |
29 | with UnreserveControlId(). | |
30 | Only ID values that are not assigned to a wxWindowIDRef() need to be unreserved. | |
3c4f71cc | 31 | |
7c913512 | 32 | @param count |
4cc4bfaf | 33 | The number of sequential IDs to reserve. |
3c4f71cc | 34 | |
d29a9a8a | 35 | @return The value of the first ID in the sequence, or wxID_NONE. |
23324ae1 FM |
36 | */ |
37 | static wxWindowID ReserveControlId(int count = 1); | |
f41d6c8c FM |
38 | |
39 | /** | |
40 | Called directly by wxWindow::UnreserveControlId(), this function will | |
41 | unreserve an ID or range of IDs that is currently reserved. | |
42 | This should only be called for IDs returned by ReserveControlId() that | |
43 | have NOT been assigned to a wxWindowIDRef (see @ref overview_windowids). | |
44 | ||
45 | @param id | |
46 | The first of the range of IDs to unreserve. | |
47 | @param count | |
48 | The number of sequential IDs to unreserve. | |
49 | ||
50 | @return The value of the first ID in the sequence, or wxID_NONE. | |
51 | */ | |
52 | static wxWindowID UnreserveControlId(wxWindowID id, int count = 1); | |
23324ae1 | 53 | }; |
e54c96f1 | 54 |