ctrlsub.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/motif/ctrlsub.h
  3. // Purpose: common functionality of wxItemContainer-derived controls
  4. // Author: Vadim Zeitlin
  5. // Created: 2007-07-25
  6. // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
  7. // Licence: wxWindows licence
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_MOTIF_CTRLSUB_H_
  10. #define _WX_MOTIF_CTRLSUB_H_
  11. #include "wx/dynarray.h"
  12. #include "wx/generic/ctrlsub.h"
  13. // ----------------------------------------------------------------------------
  14. // wxControlWithItems
  15. // ----------------------------------------------------------------------------
  16. class WXDLLIMPEXP_CORE wxControlWithItems : public wxControlWithItemsGeneric
  17. {
  18. public:
  19. wxControlWithItems() { }
  20. protected:
  21. // Motif functions inserting items in the control interpret positions
  22. // differently from wx: they're 1-based and 0 means to append
  23. unsigned int GetMotifPosition(unsigned int pos) const
  24. {
  25. return pos == GetCount() ? 0 : pos + 1;
  26. }
  27. private:
  28. DECLARE_ABSTRACT_CLASS(wxControlWithItems)
  29. wxDECLARE_NO_COPY_CLASS(wxControlWithItems);
  30. };
  31. #endif // _WX_MOTIF_CTRLSUB_H_