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/toolbar.h>
13%End
14
15
16//---------------------------------------------------------------------------
17
18        // forward declarations
19        class wxRibbonToolBarToolBase;
20
21
22wxEventType wxEVT_RIBBONTOOLBAR_CLICKED   /PyName=wxEVT_RIBBONTOOLBAR_CLICKED/;
23
24wxEventType wxEVT_RIBBONTOOLBAR_DROPDOWN_CLICKED   /PyName=wxEVT_RIBBONTOOLBAR_DROPDOWN_CLICKED/;
25
26class wxRibbonToolBar : wxRibbonControl
27{
28    %Docstring
29        RibbonToolBar()
30        RibbonToolBar(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0)
31
32        A ribbon tool bar is similar to a traditional toolbar which has no
33        labels.
34    %End
35    %TypeHeaderCode
36        #include <wx/ribbon/toolbar.h>
37    %End
38
39public:
40    wxRibbonToolBar();
41    %PreMethodCode
42        if (!wxPyCheckForApp()) return NULL;
43    %End
44
45    wxRibbonToolBar(
46        wxWindow * parent   /TransferThis/,
47        wxWindowID id = wxID_ANY,
48        const wxPoint & pos = wxDefaultPosition,
49        const wxSize & size = wxDefaultSize,
50        long style = 0
51    );
52    %PreMethodCode
53        if (!wxPyCheckForApp()) return NULL;
54    %End
55
56    ~wxRibbonToolBar();
57
58    bool Create(
59        wxWindow * parent   /TransferThis/,
60        wxWindowID id = wxID_ANY,
61        const wxPoint & pos = wxDefaultPosition,
62        const wxSize & size = wxDefaultSize,
63        long style = 0
64    );
65    %Docstring
66        Create(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0) -> bool
67
68        Create a tool bar in two-step tool bar construction.
69    %End
70
71    wxRibbonToolBarToolBase * AddTool(
72        int tool_id,
73        const wxBitmap & bitmap,
74        const wxString & help_string,
75        wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL
76    );
77    %Docstring
78        AddTool(tool_id, bitmap, help_string, kind=RIBBON_BUTTON_NORMAL) -> RibbonToolBarToolBase
79        AddTool(tool_id, bitmap, bitmap_disabled=wx.NullBitmap, help_string=wx.EmptyString, kind=RIBBON_BUTTON_NORMAL, clientData=None) -> RibbonToolBarToolBase
80
81        Add a tool to the tool bar (simple version).
82    %End
83
84    wxRibbonToolBarToolBase * AddTool(
85        int tool_id,
86        const wxBitmap & bitmap,
87        const wxBitmap & bitmap_disabled = wxNullBitmap,
88        const wxString & help_string = wxEmptyString,
89        wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL,
90        wxPyUserData* clientData   /Transfer/ = NULL
91    );
92
93    wxRibbonToolBarToolBase * AddDropdownTool(
94        int tool_id,
95        const wxBitmap & bitmap,
96        const wxString & help_string = wxEmptyString
97    );
98    %Docstring
99        AddDropdownTool(tool_id, bitmap, help_string=wx.EmptyString) -> RibbonToolBarToolBase
100
101        Add a dropdown tool to the tool bar (simple version).
102    %End
103
104    wxRibbonToolBarToolBase * AddHybridTool(
105        int tool_id,
106        const wxBitmap & bitmap,
107        const wxString & help_string = wxEmptyString
108    );
109    %Docstring
110        AddHybridTool(tool_id, bitmap, help_string=wx.EmptyString) -> RibbonToolBarToolBase
111
112        Add a hybrid tool to the tool bar (simple version).
113    %End
114
115    wxRibbonToolBarToolBase * AddToggleTool(
116        int tool_id,
117        const wxBitmap & bitmap,
118        const wxString & help_string
119    );
120    %Docstring
121        AddToggleTool(tool_id, bitmap, help_string) -> RibbonToolBarToolBase
122
123        Add a toggle tool to the tool bar (simple version).
124    %End
125
126    wxRibbonToolBarToolBase * AddSeparator();
127    %Docstring
128        AddSeparator() -> RibbonToolBarToolBase
129
130        Add a separator to the tool bar.
131    %End
132
133    wxRibbonToolBarToolBase * InsertTool(
134        size_t pos,
135        int tool_id,
136        const wxBitmap & bitmap,
137        const wxString & help_string,
138        wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL
139    );
140    %Docstring
141        InsertTool(pos, tool_id, bitmap, help_string, kind=RIBBON_BUTTON_NORMAL) -> RibbonToolBarToolBase
142        InsertTool(pos, tool_id, bitmap, bitmap_disabled=wx.NullBitmap, help_string=wx.EmptyString, kind=RIBBON_BUTTON_NORMAL, clientData=None) -> RibbonToolBarToolBase
143
144        Insert a tool to the tool bar (simple version) as the specified
145        position.
146    %End
147
148    wxRibbonToolBarToolBase * InsertTool(
149        size_t pos,
150        int tool_id,
151        const wxBitmap & bitmap,
152        const wxBitmap & bitmap_disabled = wxNullBitmap,
153        const wxString & help_string = wxEmptyString,
154        wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL,
155        wxPyUserData* clientData   /Transfer/ = NULL
156    );
157
158    wxRibbonToolBarToolBase * InsertDropdownTool(
159        size_t pos,
160        int tool_id,
161        const wxBitmap & bitmap,
162        const wxString & help_string = wxEmptyString
163    );
164    %Docstring
165        InsertDropdownTool(pos, tool_id, bitmap, help_string=wx.EmptyString) -> RibbonToolBarToolBase
166
167        Insert a dropdown tool to the tool bar (simple version) as the
168        specified position.
169    %End
170
171    wxRibbonToolBarToolBase * InsertHybridTool(
172        size_t pos,
173        int tool_id,
174        const wxBitmap & bitmap,
175        const wxString & help_string = wxEmptyString
176    );
177    %Docstring
178        InsertHybridTool(pos, tool_id, bitmap, help_string=wx.EmptyString) -> RibbonToolBarToolBase
179
180        Insert a hybrid tool to the tool bar (simple version) as the specified
181        position.
182    %End
183
184    wxRibbonToolBarToolBase * InsertToggleTool(
185        size_t pos,
186        int tool_id,
187        const wxBitmap & bitmap,
188        const wxString & help_string = wxEmptyString
189    );
190    %Docstring
191        InsertToggleTool(pos, tool_id, bitmap, help_string=wx.EmptyString) -> RibbonToolBarToolBase
192
193        Insert a toggle tool to the tool bar (simple version) as the specified
194        position.
195    %End
196
197    wxRibbonToolBarToolBase * InsertSeparator(
198        size_t pos
199    );
200    %Docstring
201        InsertSeparator(pos) -> RibbonToolBarToolBase
202
203        Insert a separator to the tool bar at the specified position.
204    %End
205
206    void ClearTools();
207    %Docstring
208        ClearTools()
209
210        Deletes all the tools in the toolbar.
211    %End
212
213    bool DeleteTool(
214        int tool_id
215    );
216    %Docstring
217        DeleteTool(tool_id) -> bool
218
219        Removes the specified tool from the toolbar and deletes it.
220    %End
221
222    bool DeleteToolByPos(
223        size_t pos
224    );
225    %Docstring
226        DeleteToolByPos(pos) -> bool
227
228        This function behaves like DeleteTool() but it deletes the tool at the
229        specified position and not the one with the given id.
230    %End
231
232    wxRibbonToolBarToolBase * FindById(
233        int tool_id
234    ) const;
235    %Docstring
236        FindById(tool_id) -> RibbonToolBarToolBase
237
238        Returns a pointer to the tool opaque structure by id or NULL if no
239        corresponding tool is found.
240    %End
241
242    wxRibbonToolBarToolBase * GetToolByPos(
243        size_t pos
244    ) const;
245    %Docstring
246        GetToolByPos(pos) -> RibbonToolBarToolBase
247
248        Return the opaque pointer corresponding to the given tool.
249    %End
250
251    int GetToolId(
252        const wxRibbonToolBarToolBase * tool
253    ) const;
254    %Docstring
255        GetToolId(tool) -> int
256
257        Return the id assciated to the tool opaque structure.
258    %End
259
260    wxPyUserData* GetToolClientData(
261        int tool_id
262    ) const;
263    %Docstring
264        GetToolClientData(tool_id) -> PyUserData
265
266        Get any client data associated with the tool.
267    %End
268    %MethodCode
269        PyErr_Clear();
270        Py_BEGIN_ALLOW_THREADS
271        sipRes = _wxRibbonToolBar_GetToolClientData(sipCpp, tool_id);
272        Py_END_ALLOW_THREADS
273        if (PyErr_Occurred()) sipIsErr = 1;
274    %End
275    %TypeCode
276    wxPyUserData* _wxRibbonToolBar_GetToolClientData(const wxRibbonToolBar* self, int tool_id)
277    {
278        return dynamic_cast<wxPyUserData*>(self->GetToolClientData(tool_id));
279    }
280    %End
281
282    bool GetToolEnabled(
283        int tool_id
284    ) const;
285    %Docstring
286        GetToolEnabled(tool_id) -> bool
287
288        Called to determine whether a tool is enabled (responds to user
289        input).
290    %End
291
292    wxString GetToolHelpString(
293        int tool_id
294    ) const;
295    %Docstring
296        GetToolHelpString(tool_id) -> String
297
298        Returns the help string for the given tool.
299    %End
300
301    wxRibbonButtonKind GetToolKind(
302        int tool_id
303    ) const;
304    %Docstring
305        GetToolKind(tool_id) -> RibbonButtonKind
306
307        Return the kind of the given tool.
308    %End
309
310    int GetToolPos(
311        int tool_id
312    ) const;
313    %Docstring
314        GetToolPos(tool_id) -> int
315
316        Returns the tool position in the toolbar, or wxNOT_FOUND if the tool
317        is not found.
318    %End
319
320    bool GetToolState(
321        int tool_id
322    ) const;
323    %Docstring
324        GetToolState(tool_id) -> bool
325
326        Gets the on/off state of a toggle tool.
327    %End
328
329    bool Realize();
330    %Docstring
331        Realize() -> bool
332
333        Calculate tool layouts and positions.
334    %End
335
336    void SetRows(
337        int nMin,
338        int nMax = -1
339    );
340    %Docstring
341        SetRows(nMin, nMax=-1)
342
343        Set the number of rows to distribute tool groups over.
344    %End
345
346    void SetToolClientData(
347        int tool_id,
348        wxPyUserData* clientData   /Transfer/
349    );
350    %Docstring
351        SetToolClientData(tool_id, clientData)
352
353        Sets the client data associated with the tool.
354    %End
355
356    void SetToolDisabledBitmap(
357        int tool_id,
358        const wxBitmap & bitmap
359    );
360    %Docstring
361        SetToolDisabledBitmap(tool_id, bitmap)
362
363        Sets the bitmap to be used by the tool with the given ID when the tool
364        is in a disabled state.
365    %End
366
367    void SetToolHelpString(
368        int tool_id,
369        const wxString & helpString
370    );
371    %Docstring
372        SetToolHelpString(tool_id, helpString)
373
374        Sets the help string shown in tooltip for the given tool.
375    %End
376
377    void SetToolNormalBitmap(
378        int tool_id,
379        const wxBitmap & bitmap
380    );
381    %Docstring
382        SetToolNormalBitmap(tool_id, bitmap)
383
384        Sets the bitmap to be used by the tool with the given ID.
385    %End
386
387    void EnableTool(
388        int tool_id,
389        bool enable = true
390    );
391    %Docstring
392        EnableTool(tool_id, enable=True)
393
394        Enable or disable a single tool on the bar.
395    %End
396
397    void ToggleTool(
398        int tool_id,
399        bool checked
400    );
401    %Docstring
402        ToggleTool(tool_id, checked)
403
404        Set a toggle tool to the checked or unchecked state.
405    %End
406
407    public:
408    virtual wxPoint GetClientAreaOrigin() const;
409    virtual bool Validate();
410    virtual bool TransferDataToWindow();
411    virtual bool TransferDataFromWindow();
412    virtual void InitDialog();
413    virtual bool AcceptsFocus() const;
414    virtual bool AcceptsFocusRecursively() const;
415    virtual bool AcceptsFocusFromKeyboard() const;
416    virtual void AddChild( wxWindowBase *child );
417    virtual void RemoveChild( wxWindowBase *child );
418    virtual void InheritAttributes();
419    virtual bool ShouldInheritColours() const;
420    virtual void OnInternalIdle();
421    virtual wxWindow *GetMainWindowOfCompositeControl();
422    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
423    virtual void SetCanFocus(bool canFocus);
424    virtual bool Destroy();
425    virtual void SetValidator( const wxValidator &validator );
426    virtual wxValidator* GetValidator();
427
428
429    protected:
430    virtual bool ProcessEvent(wxEvent & event);
431    virtual void DoEnable(bool enable);
432    virtual void DoGetPosition(int *x, int *y) const;
433    virtual void DoGetSize(int *width, int *height) const;
434    virtual void DoGetClientSize(int *width, int *height) const;
435    virtual wxSize DoGetBestSize() const;
436    virtual wxSize DoGetBestClientSize() const;
437    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
438    virtual void DoSetClientSize(int width, int height);
439    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
440    virtual wxSize DoGetBorderSize() const;
441    virtual void DoMoveWindow(int x, int y, int width, int height);
442    virtual void DoSetWindowVariant( wxWindowVariant variant);
443    virtual wxBorder GetDefaultBorder() const;
444    virtual wxBorder GetDefaultBorderForControl() const;
445    virtual void DoFreeze();
446    virtual void DoThaw();
447    virtual bool HasTransparentBackground();
448    virtual bool TryBefore(wxEvent& event);
449    virtual bool TryAfter(wxEvent& event);
450
451
452    public:
453
454
455    static
456    wxVisualAttributes GetClassDefaultAttributes(
457        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
458    );
459    %Docstring
460        GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes
461    %End
462    %PreMethodCode
463        if (!wxPyCheckForApp()) return NULL;
464    %End
465
466    public:
467
468
469};  // end of class wxRibbonToolBar
470
471
472class wxRibbonToolBarEvent : wxCommandEvent
473{
474    %Docstring
475        RibbonToolBarEvent(command_type=wx.wxEVT_NULL, win_id=0, bar=None)
476    %End
477    %TypeHeaderCode
478        #include <wx/ribbon/toolbar.h>
479    %End
480
481public:
482    wxRibbonToolBarEvent(
483        wxEventType command_type = wxEVT_NULL,
484        int win_id = 0,
485        wxRibbonToolBar * bar = NULL
486    );
487
488    wxRibbonToolBar * GetBar();
489    %Docstring
490        GetBar() -> RibbonToolBar
491    %End
492
493    void SetBar(
494        wxRibbonToolBar * bar
495    );
496    %Docstring
497        SetBar(bar)
498    %End
499
500    bool PopupMenu(
501        wxMenu * menu
502    );
503    %Docstring
504        PopupMenu(menu) -> bool
505    %End
506
507    public:
508    virtual wxEvent* Clone() const /Factory/;
509
510
511    private:
512        wxRibbonToolBarEvent& operator=(const wxRibbonToolBarEvent&);
513
514
515    public:
516
517
518    %Property(name=Bar, get=GetBar, set=SetBar)
519};  // end of class wxRibbonToolBarEvent
520
521
522%Extract(id=pycode_ribbon)
523EVT_RIBBONTOOLBAR_CLICKED = wx.PyEventBinder( wxEVT_RIBBONTOOLBAR_CLICKED, 1 )
524EVT_RIBBONTOOLBAR_DROPDOWN_CLICKED = wx.PyEventBinder( wxEVT_RIBBONTOOLBAR_DROPDOWN_CLICKED, 1 )
525
526%End
527
528
529//---------------------------------------------------------------------------
530
531