choice.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/choice.h
  3. // Purpose: wxChoice class
  4. // Author: David Webster
  5. // Modified by:
  6. // Created: 10/13/99
  7. // Copyright: (c) David Webster
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_CHOICE_H_
  11. #define _WX_CHOICE_H_
  12. // ----------------------------------------------------------------------------
  13. // Choice item
  14. // ----------------------------------------------------------------------------
  15. class WXDLLIMPEXP_CORE wxChoice: public wxChoiceBase
  16. {
  17. DECLARE_DYNAMIC_CLASS(wxChoice)
  18. public:
  19. // ctors
  20. inline wxChoice() { }
  21. virtual ~wxChoice();
  22. inline wxChoice( wxWindow* pParent
  23. ,wxWindowID vId
  24. ,const wxPoint& rPos = wxDefaultPosition
  25. ,const wxSize& rSize = wxDefaultSize
  26. ,int n = 0
  27. ,const wxString asChoices[] = NULL
  28. ,long lStyle = 0
  29. ,const wxValidator& rValidator = wxDefaultValidator
  30. ,const wxString& rsName = wxChoiceNameStr
  31. )
  32. {
  33. Create( pParent
  34. ,vId
  35. ,rPos
  36. ,rSize
  37. ,n
  38. ,asChoices
  39. ,lStyle
  40. ,rValidator
  41. ,rsName
  42. );
  43. }
  44. inline wxChoice( wxWindow* pParent
  45. ,wxWindowID vId
  46. ,const wxPoint& rPos
  47. ,const wxSize& rSize
  48. ,const wxArrayString& asChoices
  49. ,long lStyle = 0
  50. ,const wxValidator& rValidator = wxDefaultValidator
  51. ,const wxString& rsName = wxChoiceNameStr
  52. )
  53. {
  54. Create( pParent
  55. ,vId
  56. ,rPos
  57. ,rSize
  58. ,asChoices
  59. ,lStyle
  60. ,rValidator
  61. ,rsName
  62. );
  63. }
  64. bool Create( wxWindow* pParent
  65. ,wxWindowID vId
  66. ,const wxPoint& rPos = wxDefaultPosition
  67. ,const wxSize& rSize = wxDefaultSize
  68. ,int n = 0
  69. ,const wxString asChoices[] = NULL
  70. ,long lStyle = 0
  71. ,const wxValidator& rValidator = wxDefaultValidator
  72. ,const wxString& rsName = wxChoiceNameStr
  73. );
  74. bool Create( wxWindow* pParent
  75. ,wxWindowID vId
  76. ,const wxPoint& rPos
  77. ,const wxSize& rSize
  78. ,const wxArrayString& asChoices
  79. ,long lStyle = 0
  80. ,const wxValidator& rValidator = wxDefaultValidator
  81. ,const wxString& rsName = wxChoiceNameStr
  82. );
  83. //
  84. // Implement base class virtuals
  85. //
  86. virtual void DoDeleteOneItem(unsigned int n);
  87. virtual void DoClear(void);
  88. virtual unsigned int GetCount() const;
  89. virtual int GetSelection(void) const;
  90. virtual void SetSelection(int n);
  91. virtual wxString GetString(unsigned int n) const;
  92. virtual void SetString(unsigned int n, const wxString& rsStr);
  93. //
  94. // OS2 only
  95. //
  96. virtual bool OS2Command( WXUINT uParam
  97. ,WXWORD wId
  98. );
  99. MRESULT OS2WindowProc( WXUINT uMsg
  100. ,WXWPARAM wParam
  101. ,WXLPARAM lParam
  102. );
  103. protected:
  104. virtual int DoInsertItems(const wxArrayStringsAdapter& items,
  105. unsigned int pos,
  106. void **clientData,
  107. wxClientDataType type);
  108. virtual void DoSetItemClientData(unsigned int n, void* pClientData);
  109. virtual void* DoGetItemClientData(unsigned int n) const;
  110. virtual wxSize DoGetBestSize(void) const;
  111. virtual void DoSetSize( int nX
  112. ,int nY
  113. ,int nWidth
  114. ,int nHeight
  115. ,int nsizeFlags = wxSIZE_AUTO
  116. );
  117. void Free(void);
  118. }; // end of CLASS wxChoice
  119. #endif // _WX_CHOICE_H_