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