File: toolbook.h

package info (click to toggle)
wxpython4.0 4.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 221,752 kB
  • sloc: cpp: 962,555; python: 230,573; ansic: 170,731; makefile: 51,756; sh: 9,342; perl: 1,564; javascript: 584; php: 326; xml: 200
file content (128 lines) | stat: -rw-r--r-- 4,181 bytes parent folder | download | duplicates (3)
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
/////////////////////////////////////////////////////////////////////////////
// Name:        toolbook.h
// Purpose:     interface of wxToolbook
// Author:      wxWidgets team
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#define wxTBK_BUTTONBAR            0x0100
#define wxTBK_HORZ_LAYOUT          0x8000

wxEventType wxEVT_TOOLBOOK_PAGE_CHANGED;
wxEventType wxEVT_TOOLBOOK_PAGE_CHANGING;


/**
    @class wxToolbook

    wxToolbook is a class similar to wxNotebook but which uses a wxToolBar to
    show the labels instead of the tabs.

    There is no documentation for this class yet but its usage is identical to
    wxNotebook (except for the features clearly related to tabs only), so please
    refer to that class documentation for now. You can also use the
    @ref page_samples_notebook to see wxToolbook in action.

    One feature of this class not supported by wxBookCtrlBase is the support
    for disabling some of the pages, see EnablePage().

    @beginStyleTable
    @style{wxTBK_BUTTONBAR}
        Use wxButtonToolBar-based implementation under macOS (ignored under
        other platforms).
    @style{wxTBK_HORZ_LAYOUT}
        Shows the text and the icons alongside, not vertically stacked (only
        implement under Windows and GTK 2 platforms as it relies on
        @c wxTB_HORZ_LAYOUT flag support).
    @endStyleTable

    The common wxBookCtrl styles described in the @ref overview_bookctrl are
    also supported.

    @beginEventEmissionTable{wxBookCtrlEvent}
    @event{EVT_TOOLBOOK_PAGE_CHANGED(id, func)}
        The page selection was changed.
        Processes a @c wxEVT_TOOLBOOK_PAGE_CHANGED event.
    @event{EVT_TOOLBOOK_PAGE_CHANGING(id, func)}
        The page selection is about to be changed.
        Processes a @c wxEVT_TOOLBOOK_PAGE_CHANGING event.
        This event can be vetoed (using wxNotifyEvent::Veto()).
    @endEventTable

    @library{wxcore}
    @category{bookctrl}

    @see @ref overview_bookctrl, wxBookCtrlBase, wxNotebook,
         @ref page_samples_notebook
*/
class wxToolbook : public wxBookCtrlBase
{
public:
    ///@{
    /**
        Constructs a choicebook control.
    */
    wxToolbook();
    wxToolbook(wxWindow* parent, wxWindowID id,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = 0,
                 const wxString& name = wxEmptyString);
    ///@}

    /**
       Create the tool book control that has already been constructed with
       the default constructor.
    */
    bool Create(wxWindow *parent,
                wxWindowID id,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                long style = 0,
                const wxString& name = wxEmptyString);

    /**
        Returns the wxToolBarBase associated with the control.
    */
    wxToolBarBase* GetToolBar() const;

    /**
       Enables or disables the specified page.

       Using this function, a page can be disabled when it can't be used, while
       still remaining present to let the users know that more functionality is
       available, even if currently inaccessible.

       Icons for disabled pages are created by wxBitmap::ConvertToDisabled().

       @param page
            The index of the page.
       @param enable
            @true to enable the page and @false to disable it.

       @return @true if successful, @false otherwise (currently only if the
            index is invalid).

       @since 3.1.2
    */
    bool EnablePage(size_t page, bool enable);

   /**
       Enables or disables the specified page.

       This is similar to the overload above, but finds the index of the
       specified page.

       @param page
            Pointer of a page windows inside the book control.
       @param enable
            @true to enable the page and @false to disable it.

       @return @true if successful, @false otherwise, e.g. if @a page is not
           one of the pages of this control.

       @since 3.1.2
    */
    bool EnablePage(wxWindow *page, bool enable);
};