simplebook.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/simplebook.h
  3. // Purpose: wxSimplebook public API documentation.
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @class wxSimplebook
  9. wxSimplebook is a control showing exactly one of its several pages.
  10. It implements wxBookCtrlBase class interface but doesn't allow the user to
  11. change the page being displayed, unlike all the other book control classes,
  12. only the program can do it.
  13. This class is created in the same manner as any other wxBookCtrl but then
  14. the program will typically call ChangeSelection() to show different pages.
  15. See the @ref page_samples_notebook for an example of wxSimplebook in
  16. action.
  17. Notice that is often convenient to use ShowNewPage() instead of the base
  18. class AddPage().
  19. There are no special styles defined for this class as it has no visual
  20. appearance of its own.
  21. There are also no special events, this class reuses
  22. @c wxEVT_BOOKCTRL_PAGE_CHANGING and @c
  23. wxEVT_BOOKCTRL_PAGE_CHANGED events for the events it generates if
  24. the program calls SetSelection().
  25. @library{wxcore}
  26. @category{bookctrl}
  27. @see wxBookCtrl, wxNotebook, @ref page_samples_notebook
  28. @since 2.9.5
  29. */
  30. class wxSimplebook : public wxBookCtrlBase
  31. {
  32. public:
  33. /**
  34. Default constructor.
  35. Use Create() later to really create the control.
  36. */
  37. wxSimplebook();
  38. /**
  39. Constructs a simple book control.
  40. */
  41. wxSimplebook(wxWindow* parent,
  42. wxWindowID id = wxID_ANY,
  43. const wxPoint& pos = wxDefaultPosition,
  44. const wxSize& size = wxDefaultSize,
  45. long style = 0,
  46. const wxString& name = wxEmptyString);
  47. /**
  48. Really create the window of an object created using default
  49. constructor.
  50. @since 3.0.2
  51. */
  52. bool Create(wxWindow* parent,
  53. wxWindowID id = wxID_ANY,
  54. const wxPoint& pos = wxDefaultPosition,
  55. const wxSize& size = wxDefaultSize,
  56. long style = 0,
  57. const wxString& name = wxEmptyString);
  58. /**
  59. Set the effects to use for showing and hiding the pages.
  60. This method allows to specify the effects passed to
  61. wxWindow::ShowWithEffect() and wxWindow::HideWithEffect() respectively
  62. when the pages need to be shown or hidden.
  63. By default, no effects are used, but as the pages are only changed
  64. by the program and not the user himself, it may be useful to use some
  65. visual effects to make the changes more noticeable.
  66. @param showEffect
  67. The effect to use for showing the newly selected page.
  68. @param hideEffect
  69. The effect to use for hiding the previously selected page.
  70. @see SetEffectsTimeouts()
  71. */
  72. void SetEffects(wxShowEffect showEffect, wxShowEffect hideEffect);
  73. /**
  74. Set the same effect to use for both showing and hiding the pages.
  75. This is the same as <code>SetEffects(effect, effect)</code>.
  76. @see SetEffectTimeout()
  77. */
  78. void SetEffect(wxShowEffect effect);
  79. /**
  80. Set the effect timeout to use for showing and hiding the pages.
  81. This method allows to configure the timeout arguments passed to
  82. wxWindow::ShowWithEffect() and wxWindow::HideWithEffect() if a
  83. non-default effect is used.
  84. If this method is not called, default, system-dependent timeout is
  85. used.
  86. @param showTimeout
  87. Timeout of the show effect, in milliseconds.
  88. @param hideTimeout
  89. Timeout of the hide effect, in milliseconds.
  90. @see SetEffects()
  91. */
  92. void SetEffectsTimeouts(unsigned showTimeout, unsigned hideTimeout);
  93. /**
  94. Set the same effect timeout to use for both showing and hiding the
  95. pages.
  96. This is the same as <code>SetEffectsTimeouts(timeout, timeout)</code>.
  97. @see SetEffect()
  98. */
  99. void SetEffectTimeout(unsigned timeout);
  100. /**
  101. Add a new page and show it immediately.
  102. This is simply a thin wrapper around the base class
  103. wxBookCtrlBase::AddPage() method using empty label (which is unused by
  104. this class anyhow) and selecting the new page immediately.
  105. */
  106. bool ShowNewPage(wxWindow* page);
  107. };