- // generate a control id for the controls which were not given one by
- // user
- static int NewControlId() { return --ms_lastControlId; }
- // get the id of the control following the one with the given
- // (autogenerated) id
- static int NextControlId(int winid) { return winid - 1; }
- // get the id of the control preceding the one with the given
- // (autogenerated) id
- static int PrevControlId(int winid) { return winid + 1; }
+
+ // window id uniquely identifies the window among its siblings unless
+ // it is wxID_ANY which means "don't care"
+ void SetId( wxWindowID winid ) { m_windowId = winid; }
+ wxWindowID GetId() const { return m_windowId; }
+
+ // returns true if this id value belong to the range reserved for the
+ // auto-generated (by NewControlId()) ids (they're always negative)
+ static bool IsAutoGeneratedId(wxWindowID id);
+
+ // generate a unique id (or count of them consecutively), returns a
+ // valid id in IsAutoGeneratedId() range or wxID_NONE if failed
+ static wxWindowID NewControlId(int count = 1);
+
+ // mark an id previously returned by NewControlId() as being unused any
+ // more so that it can be reused again for another control later
+ static void ReleaseControlId(wxWindowID id);
+