windowid.h 1.9 KB

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