simplebook.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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() (inherited from the base class) later to really create the
  36. control.
  37. */
  38. wxSimplebook();
  39. /**
  40. Constructs a simple book control.
  41. */
  42. wxSimplebook(wxWindow* parent,
  43. wxWindowID id = wxID_ANY,
  44. const wxPoint& pos = wxDefaultPosition,
  45. const wxSize& size = wxDefaultSize,
  46. long style = 0,
  47. const wxString& name = wxEmptyString);
  48. /**
  49. Set the effects to use for showing and hiding the pages.
  50. This method allows to specify the effects passed to
  51. wxWindow::ShowWithEffect() and wxWindow::HideWithEffect() respectively
  52. when the pages need to be shown or hidden.
  53. By default, no effects are used, but as the pages are only changed
  54. by the program and not the user himself, it may be useful to use some
  55. visual effects to make the changes more noticeable.
  56. @param showEffect
  57. The effect to use for showing the newly selected page.
  58. @param hideEffect
  59. The effect to use for hiding the previously selected page.
  60. @see SetEffectsTimeouts()
  61. */
  62. void SetEffects(wxShowEffect showEffect, wxShowEffect hideEffect);
  63. /**
  64. Set the same effect to use for both showing and hiding the pages.
  65. This is the same as <code>SetEffects(effect, effect)</code>.
  66. @see SetEffectTimeout()
  67. */
  68. void SetEffect(wxShowEffect effect);
  69. /**
  70. Set the effect timeout to use for showing and hiding the pages.
  71. This method allows to configure the timeout arguments passed to
  72. wxWindow::ShowWithEffect() and wxWindow::HideWithEffect() if a
  73. non-default effect is used.
  74. If this method is not called, default, system-dependent timeout is
  75. used.
  76. @param showTimeout
  77. Timeout of the show effect, in milliseconds.
  78. @param hideTimeout
  79. Timeout of the hide effect, in milliseconds.
  80. @see SetEffects()
  81. */
  82. void SetEffectsTimeouts(unsigned showTimeout, unsigned hideTimeout);
  83. /**
  84. Set the same effect timeout to use for both showing and hiding the
  85. pages.
  86. This is the same as <code>SetEffectsTimeouts(timeout, timeout)</code>.
  87. @see SetEffect()
  88. */
  89. void SetEffectTimeout(unsigned timeout);
  90. /**
  91. Add a new page and show it immediately.
  92. This is simply a thin wrapper around the base class
  93. wxBookCtrlBase::AddPage() method using empty label (which is unused by
  94. this class anyhow) and selecting the new page immediately.
  95. */
  96. bool ShowNewPage(wxWindow* page);
  97. };