File: simplebook.h

package info (click to toggle)
wxwidgets3.0 3.0.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 120,464 kB
  • sloc: cpp: 896,633; makefile: 52,303; ansic: 21,971; sh: 5,713; python: 2,940; xml: 1,534; perl: 264; javascript: 33
file content (139 lines) | stat: -rw-r--r-- 4,509 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/////////////////////////////////////////////////////////////////////////////
// Name:        wx/simplebook.h
// Purpose:     wxSimplebook public API documentation.
// Author:      wxWidgets team
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

/**
    @class wxSimplebook

    wxSimplebook is a control showing exactly one of its several pages.

    It implements wxBookCtrlBase class interface but doesn't allow the user to
    change the page being displayed, unlike all the other book control classes,
    only the program can do it.

    This class is created in the same manner as any other wxBookCtrl but then
    the program will typically call ChangeSelection() to show different pages.
    See the @ref page_samples_notebook for an example of wxSimplebook in
    action.

    Notice that is often convenient to use ShowNewPage() instead of the base
    class AddPage().

    There are no special styles defined for this class as it has no visual
    appearance of its own.

    There are also no special events, this class reuses
    @c wxEVT_BOOKCTRL_PAGE_CHANGING and @c
    wxEVT_BOOKCTRL_PAGE_CHANGED events for the events it generates if
    the program calls SetSelection().

    @library{wxcore}
    @category{bookctrl}

    @see wxBookCtrl, wxNotebook, @ref page_samples_notebook

    @since 2.9.5
*/
class wxSimplebook : public wxBookCtrlBase
{
public:
    /**
        Default constructor.

        Use Create() later to really create the control.
    */
    wxSimplebook();

    /**
        Constructs a simple book control.
    */
    wxSimplebook(wxWindow* parent,
                 wxWindowID id = wxID_ANY,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = 0,
                 const wxString& name = wxEmptyString);

    /**
        Really create the window of an object created using default
        constructor.

        @since 3.0.2
     */
    bool Create(wxWindow* parent,
                wxWindowID id = wxID_ANY,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                long style = 0,
                const wxString& name = wxEmptyString);

    /**
        Set the effects to use for showing and hiding the pages.

        This method allows specifying the effects passed to
        wxWindow::ShowWithEffect() and wxWindow::HideWithEffect() respectively
        when the pages need to be shown or hidden.

        By default, no effects are used, but as the pages are only changed
        by the program and not the user himself, it may be useful to use some
        visual effects to make the changes more noticeable.

        @param showEffect
            The effect to use for showing the newly selected page.
        @param hideEffect
            The effect to use for hiding the previously selected page.

        @see SetEffectsTimeouts()
     */
    void SetEffects(wxShowEffect showEffect, wxShowEffect hideEffect);

    /**
        Set the same effect to use for both showing and hiding the pages.

        This is the same as <code>SetEffects(effect, effect)</code>.

        @see SetEffectTimeout()
     */
    void SetEffect(wxShowEffect effect);

    /**
        Set the effect timeout to use for showing and hiding the pages.

        This method allows configuring the timeout arguments passed to
        wxWindow::ShowWithEffect() and wxWindow::HideWithEffect() if a
        non-default effect is used.

        If this method is not called, default, system-dependent timeout is
        used.

        @param showTimeout
            Timeout of the show effect, in milliseconds.
        @param hideTimeout
            Timeout of the hide effect, in milliseconds.

        @see SetEffects()
     */
    void SetEffectsTimeouts(unsigned showTimeout, unsigned hideTimeout);

    /**
        Set the same effect timeout to use for both showing and hiding the
        pages.

        This is the same as <code>SetEffectsTimeouts(timeout, timeout)</code>.

        @see SetEffect()
     */
    void SetEffectTimeout(unsigned timeout);

    /**
        Add a new page and show it immediately.

        This is simply a thin wrapper around the base class
        wxBookCtrlBase::AddPage() method using empty label (which is unused by
        this class anyhow) and selecting the new page immediately.
     */
    bool ShowNewPage(wxWindow* page);
};