1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _ribbon.sip
8//
9//---------------------------------------------------------------------------
10
11%ModuleHeaderCode
12#include <wx/ribbon/bar.h>
13%End
14
15
16//---------------------------------------------------------------------------
17
18enum wxRibbonBarOption
19{
20    wxRIBBON_BAR_SHOW_PAGE_LABELS,
21    wxRIBBON_BAR_SHOW_PAGE_ICONS,
22    wxRIBBON_BAR_FLOW_HORIZONTAL,
23    wxRIBBON_BAR_FLOW_VERTICAL,
24    wxRIBBON_BAR_SHOW_PANEL_EXT_BUTTONS,
25    wxRIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS,
26    wxRIBBON_BAR_ALWAYS_SHOW_TABS,
27    wxRIBBON_BAR_SHOW_TOGGLE_BUTTON,
28    wxRIBBON_BAR_SHOW_HELP_BUTTON,
29    wxRIBBON_BAR_DEFAULT_STYLE,
30    wxRIBBON_BAR_FOLDBAR_STYLE
31};
32
33enum wxRibbonDisplayMode
34{
35    wxRIBBON_BAR_PINNED,
36    wxRIBBON_BAR_MINIMIZED,
37    wxRIBBON_BAR_EXPANDED
38};
39
40wxEventType wxEVT_RIBBONBAR_PAGE_CHANGED   /PyName=wxEVT_RIBBONBAR_PAGE_CHANGED/;
41
42wxEventType wxEVT_RIBBONBAR_PAGE_CHANGING   /PyName=wxEVT_RIBBONBAR_PAGE_CHANGING/;
43
44wxEventType wxEVT_RIBBONBAR_TAB_MIDDLE_DOWN   /PyName=wxEVT_RIBBONBAR_TAB_MIDDLE_DOWN/;
45
46wxEventType wxEVT_RIBBONBAR_TAB_MIDDLE_UP   /PyName=wxEVT_RIBBONBAR_TAB_MIDDLE_UP/;
47
48wxEventType wxEVT_RIBBONBAR_TAB_RIGHT_DOWN   /PyName=wxEVT_RIBBONBAR_TAB_RIGHT_DOWN/;
49
50wxEventType wxEVT_RIBBONBAR_TAB_RIGHT_UP   /PyName=wxEVT_RIBBONBAR_TAB_RIGHT_UP/;
51
52wxEventType wxEVT_RIBBONBAR_TAB_LEFT_DCLICK   /PyName=wxEVT_RIBBONBAR_TAB_LEFT_DCLICK/;
53
54wxEventType wxEVT_RIBBONBAR_TOGGLED   /PyName=wxEVT_RIBBONBAR_TOGGLED/;
55
56wxEventType wxEVT_RIBBONBAR_HELP_CLICK   /PyName=wxEVT_RIBBONBAR_HELP_CLICK/;
57
58class wxRibbonBarEvent : wxNotifyEvent
59{
60    %Docstring
61        RibbonBarEvent(command_type=wx.wxEVT_NULL, win_id=0, page=None)
62
63        Event used to indicate various actions relating to a wxRibbonBar.
64    %End
65    %TypeHeaderCode
66        #include <wx/ribbon/bar.h>
67    %End
68
69public:
70    wxRibbonBarEvent(
71        wxEventType command_type = wxEVT_NULL,
72        int win_id = 0,
73        wxRibbonPage * page = NULL
74    );
75
76    wxRibbonPage * GetPage();
77    %Docstring
78        GetPage() -> RibbonPage
79
80        Returns the page being changed to, or being clicked on.
81    %End
82
83    void SetPage(
84        wxRibbonPage * page
85    );
86    %Docstring
87        SetPage(page)
88
89        Sets the page relating to this event.
90    %End
91
92    public:
93    virtual wxEvent* Clone() const /Factory/;
94
95
96    private:
97        wxRibbonBarEvent& operator=(const wxRibbonBarEvent&);
98
99
100    public:
101
102
103    %Property(name=Page, get=GetPage, set=SetPage)
104};  // end of class wxRibbonBarEvent
105
106
107class wxRibbonPageTabInfo
108{
109    %Docstring
110
111    %End
112    %TypeHeaderCode
113        #include <wx/ribbon/bar.h>
114    %End
115
116public:
117    wxRect rect;
118
119    wxRibbonPage * page;
120
121    int ideal_width;
122
123    int small_begin_need_separator_width;
124
125    int small_must_have_separator_width;
126
127    int minimum_width;
128
129    bool active;
130
131    bool hovered;
132
133    bool highlight;
134
135    bool shown;
136
137};  // end of class wxRibbonPageTabInfo
138
139
140class wxRibbonBar : wxRibbonControl
141{
142    %Docstring
143        RibbonBar()
144        RibbonBar(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=RIBBON_BAR_DEFAULT_STYLE)
145
146        Top-level control in a ribbon user interface.
147    %End
148    %TypeHeaderCode
149        #include <wx/ribbon/bar.h>
150    %End
151
152public:
153    wxRibbonBar();
154    %PreMethodCode
155        if (!wxPyCheckForApp()) return NULL;
156    %End
157
158    wxRibbonBar(
159        wxWindow * parent   /TransferThis/,
160        wxWindowID id = wxID_ANY,
161        const wxPoint & pos = wxDefaultPosition,
162        const wxSize & size = wxDefaultSize,
163        long style = wxRIBBON_BAR_DEFAULT_STYLE
164    );
165    %PreMethodCode
166        if (!wxPyCheckForApp()) return NULL;
167    %End
168
169    ~wxRibbonBar();
170
171    bool Create(
172        wxWindow * parent   /TransferThis/,
173        wxWindowID id = wxID_ANY,
174        const wxPoint & pos = wxDefaultPosition,
175        const wxSize & size = wxDefaultSize,
176        long style = wxRIBBON_BAR_DEFAULT_STYLE
177    );
178    %Docstring
179        Create(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=RIBBON_BAR_DEFAULT_STYLE) -> bool
180
181        Create a ribbon bar in two-step ribbon bar construction.
182    %End
183
184    void SetTabCtrlMargins(
185        int left,
186        int right
187    );
188    %Docstring
189        SetTabCtrlMargins(left, right)
190
191        Set the margin widths (in pixels) on the left and right sides of the
192        tab bar region of the ribbon bar.
193    %End
194
195    void SetArtProvider(
196        wxRibbonArtProvider * art   /Transfer/
197    );
198    %Docstring
199        SetArtProvider(art)
200
201        Set the art provider to be used be the ribbon bar.
202    %End
203
204    bool SetActivePage(
205        size_t page
206    );
207    %Docstring
208        SetActivePage(page) -> bool
209        SetActivePage(page) -> bool
210
211        Set the active page by index, without triggering any events.
212    %End
213
214    bool SetActivePage(
215        wxRibbonPage * page
216    );
217
218    int GetActivePage() const;
219    %Docstring
220        GetActivePage() -> int
221
222        Get the index of the active page.
223    %End
224
225    wxRibbonPage * GetPage(
226        int n
227    );
228    %Docstring
229        GetPage(n) -> RibbonPage
230
231        Get a page by index.
232    %End
233
234    size_t GetPageCount() const;
235    %Docstring
236        GetPageCount() -> size_t
237
238        Get the number of pages in this bar.
239    %End
240
241    bool DismissExpandedPanel();
242    %Docstring
243        DismissExpandedPanel() -> bool
244
245        Dismiss the expanded panel of the currently active page.
246    %End
247
248    int GetPageNumber(
249        wxRibbonPage * page
250    ) const;
251    %Docstring
252        GetPageNumber(page) -> int
253
254        Returns the number for a given ribbon bar page.
255    %End
256
257    void DeletePage(
258        size_t n
259    );
260    %Docstring
261        DeletePage(n)
262
263        Delete a single page from this ribbon bar.
264    %End
265
266    void ClearPages();
267    %Docstring
268        ClearPages()
269
270        Delete all pages from the ribbon bar.
271    %End
272
273    bool IsPageShown(
274        size_t page
275    ) const;
276    %Docstring
277        IsPageShown(page) -> bool
278
279        Indicates whether the tab for the given page is shown to the user or
280        not.
281    %End
282
283    void ShowPage(
284        size_t page,
285        bool show_tab = true
286    );
287    %Docstring
288        ShowPage(page, show_tab=True)
289
290        Show or hide the tab for a given page.
291    %End
292
293    void HidePage(
294        size_t page
295    );
296    %Docstring
297        HidePage(page)
298
299        Hides the tab for a given page.
300    %End
301
302    bool IsPageHighlighted(
303        size_t page
304    ) const;
305    %Docstring
306        IsPageHighlighted(page) -> bool
307
308        Indicates whether a tab is currently highlighted.
309    %End
310
311    void AddPageHighlight(
312        size_t page,
313        bool highlight = true
314    );
315    %Docstring
316        AddPageHighlight(page, highlight=True)
317
318        Highlight the specified tab.
319    %End
320
321    void RemovePageHighlight(
322        size_t page
323    );
324    %Docstring
325        RemovePageHighlight(page)
326
327        Changes a tab to not be highlighted.
328    %End
329
330    void ShowPanels(
331        bool show = true
332    );
333    %Docstring
334        ShowPanels(show=True)
335
336        Shows or hides the panel area of the ribbon bar.
337    %End
338
339    void HidePanels();
340    %Docstring
341        HidePanels()
342
343        Hides the panel area of the ribbon bar.
344    %End
345
346    bool ArePanelsShown() const;
347    %Docstring
348        ArePanelsShown() -> bool
349
350        Indicates whether the panel area of the ribbon bar is shown.
351    %End
352
353    bool Realize();
354    %Docstring
355        Realize() -> bool
356
357        Perform initial layout and size calculations of the bar and its
358        children.
359    %End
360
361    public:
362    virtual wxPoint GetClientAreaOrigin() const;
363    virtual bool Validate();
364    virtual bool TransferDataToWindow();
365    virtual bool TransferDataFromWindow();
366    virtual void InitDialog();
367    virtual bool AcceptsFocus() const;
368    virtual bool AcceptsFocusRecursively() const;
369    virtual bool AcceptsFocusFromKeyboard() const;
370    virtual void AddChild( wxWindowBase *child );
371    virtual void RemoveChild( wxWindowBase *child );
372    virtual void InheritAttributes();
373    virtual bool ShouldInheritColours() const;
374    virtual void OnInternalIdle();
375    virtual wxWindow *GetMainWindowOfCompositeControl();
376    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
377    virtual void SetCanFocus(bool canFocus);
378    virtual bool Destroy();
379    virtual void SetValidator( const wxValidator &validator );
380    virtual wxValidator* GetValidator();
381
382
383    protected:
384    virtual bool ProcessEvent(wxEvent & event);
385    virtual void DoEnable(bool enable);
386    virtual void DoGetPosition(int *x, int *y) const;
387    virtual void DoGetSize(int *width, int *height) const;
388    virtual void DoGetClientSize(int *width, int *height) const;
389    virtual wxSize DoGetBestSize() const;
390    virtual wxSize DoGetBestClientSize() const;
391    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
392    virtual void DoSetClientSize(int width, int height);
393    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
394    virtual wxSize DoGetBorderSize() const;
395    virtual void DoMoveWindow(int x, int y, int width, int height);
396    virtual void DoSetWindowVariant( wxWindowVariant variant);
397    virtual wxBorder GetDefaultBorder() const;
398    virtual wxBorder GetDefaultBorderForControl() const;
399    virtual void DoFreeze();
400    virtual void DoThaw();
401    virtual bool HasTransparentBackground();
402    virtual bool TryBefore(wxEvent& event);
403    virtual bool TryAfter(wxEvent& event);
404
405
406    public:
407
408
409    static
410    wxVisualAttributes GetClassDefaultAttributes(
411        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
412    );
413    %Docstring
414        GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes
415    %End
416    %PreMethodCode
417        if (!wxPyCheckForApp()) return NULL;
418    %End
419
420    public:
421
422
423    %Property(name=ActivePage, get=GetActivePage, set=SetActivePage)
424    %Property(name=PageCount, get=GetPageCount)
425};  // end of class wxRibbonBar
426
427
428%Extract(id=pycode_ribbon)
429EVT_RIBBONBAR_PAGE_CHANGED    = wx.PyEventBinder(wxEVT_RIBBONBAR_PAGE_CHANGED, 1)
430EVT_RIBBONBAR_PAGE_CHANGING   = wx.PyEventBinder(wxEVT_RIBBONBAR_PAGE_CHANGING,1)
431EVT_RIBBONBAR_TAB_MIDDLE_DOWN = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_MIDDLE_DOWN, 1)
432EVT_RIBBONBAR_TAB_MIDDLE_UP   = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_MIDDLE_UP, 1)
433EVT_RIBBONBAR_TAB_RIGHT_DOWN  = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_RIGHT_DOWN, 1)
434EVT_RIBBONBAR_TAB_RIGHT_UP    = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_RIGHT_UP, 1)
435EVT_RIBBONBAR_TAB_LEFT_DCLICK = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_LEFT_DCLICK, 1)
436EVT_RIBBONBAR_TOGGLED         = wx.PyEventBinder(wxEVT_RIBBONBAR_TOGGLED, 1)
437EVT_RIBBONBAR_HELP_CLICK      = wx.PyEventBinder(wxEVT_RIBBONBAR_HELP_CLICK, 1)
438
439%End
440
441class wxRibbonPageTabInfoArray
442{
443public:
444    SIP_SSIZE_T __len__();
445    %MethodCode
446        sipRes = sipCpp->GetCount();
447    %End
448
449            wxRibbonPageTabInfo& __getitem__(long index);
450        %MethodCode
451            if (0 > index)
452                index += sipCpp->GetCount();
453
454            if ((index < sipCpp->GetCount()) && (0 <= index)) {
455                sipRes = &sipCpp->Item(index);
456            }
457            else {
458                wxPyErr_SetString(PyExc_IndexError, "sequence index out of range");
459                sipError = sipErrorFail;
460            }
461        %End
462
463
464    int __contains__(wxRibbonPageTabInfo& obj);
465    %MethodCode
466        int idx = sipCpp->Index(*obj, false);
467        sipRes = idx != wxNOT_FOUND;
468    %End
469
470    void append(wxRibbonPageTabInfo& obj);
471    %MethodCode
472        sipCpp->Add(*obj);
473    %End
474
475    // TODO:  add support for index(value, [start, [stop]])
476    int index(wxRibbonPageTabInfo& obj);
477    %MethodCode
478        int idx = sipCpp->Index(*obj, false);
479        if (idx == wxNOT_FOUND) {
480            sipError = sipErrorFail;
481            wxPyErr_SetString(PyExc_ValueError,
482                              "sequence.index(x): x not in sequence");
483            }
484        sipRes = idx;
485    %End
486};
487
488%Extract(id=pycode_ribbon)
489def _RibbonPageTabInfoArray___repr__(self):
490    return "RibbonPageTabInfoArray: " + repr(list(self))
491RibbonPageTabInfoArray.__repr__ = _RibbonPageTabInfoArray___repr__
492del _RibbonPageTabInfoArray___repr__
493%End
494
495
496
497//---------------------------------------------------------------------------
498
499