choicebk.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: choicebk.h
  3. // Purpose: interface of wxChoicebook
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. // wxChoicebook flags
  8. #define wxCHB_DEFAULT wxBK_DEFAULT
  9. #define wxCHB_TOP wxBK_TOP
  10. #define wxCHB_BOTTOM wxBK_BOTTOM
  11. #define wxCHB_LEFT wxBK_LEFT
  12. #define wxCHB_RIGHT wxBK_RIGHT
  13. #define wxCHB_ALIGN_MASK wxBK_ALIGN_MASK
  14. wxEventType wxEVT_CHOICEBOOK_PAGE_CHANGED;
  15. wxEventType wxEVT_CHOICEBOOK_PAGE_CHANGING;
  16. /**
  17. @class wxChoicebook
  18. wxChoicebook is a class similar to wxNotebook, but uses a wxChoice control
  19. to show the labels instead of the tabs.
  20. For usage documentation of this class, please refer to the base abstract class
  21. wxBookCtrl. You can also use the @ref page_samples_notebook to see wxChoicebook in
  22. action.
  23. wxChoicebook allows the use of wxBookCtrlBase::GetControlSizer(), allowing
  24. a program to add other controls next to the choice control. This is
  25. particularly useful when screen space is restricted, as it often is when
  26. wxChoicebook is being employed.
  27. @beginStyleTable
  28. @style{wxCHB_DEFAULT}
  29. Choose the default location for the labels depending on the current
  30. platform (left everywhere except Mac where it is top).
  31. @style{wxCHB_TOP}
  32. Place labels above the page area.
  33. @style{wxCHB_LEFT}
  34. Place labels on the left side.
  35. @style{wxCHB_RIGHT}
  36. Place labels on the right side.
  37. @style{wxCHB_BOTTOM}
  38. Place labels below the page area.
  39. @endStyleTable
  40. @beginEventEmissionTable{wxBookCtrlEvent}
  41. @event{EVT_CHOICEBOOK_PAGE_CHANGED(id, func)}
  42. The page selection was changed.
  43. Processes a @c wxEVT_CHOICEBOOK_PAGE_CHANGED event.
  44. @event{EVT_CHOICEBOOK_PAGE_CHANGING(id, func)}
  45. The page selection is about to be changed.
  46. Processes a @c wxEVT_CHOICEBOOK_PAGE_CHANGING event.
  47. This event can be vetoed (using wxNotifyEvent::Veto()).
  48. @endEventTable
  49. @library{wxcore}
  50. @category{bookctrl}
  51. @appearance{choicebook}
  52. @see @ref overview_bookctrl, wxNotebook, @ref page_samples_notebook
  53. */
  54. class wxChoicebook : public wxBookCtrlBase
  55. {
  56. public:
  57. //@{
  58. /**
  59. Constructs a choicebook control.
  60. */
  61. wxChoicebook();
  62. wxChoicebook(wxWindow* parent, wxWindowID id,
  63. const wxPoint& pos = wxDefaultPosition,
  64. const wxSize& size = wxDefaultSize,
  65. long style = 0,
  66. const wxString& name = wxEmptyString);
  67. //@}
  68. /**
  69. Create the choicebook control that has already been constructed with
  70. the default constructor.
  71. */
  72. bool Create(wxWindow *parent,
  73. wxWindowID id,
  74. const wxPoint& pos = wxDefaultPosition,
  75. const wxSize& size = wxDefaultSize,
  76. long style = 0,
  77. const wxString& name = wxEmptyString);
  78. /**
  79. Returns the wxChoice associated with the control.
  80. */
  81. wxChoice * GetChoiceCtrl() const;
  82. };