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 _core.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13const int wxDEFAULT_FRAME_STYLE;
14enum
15{
16    wxUSER_ATTENTION_INFO,
17    wxUSER_ATTENTION_ERROR
18};
19
20enum
21{
22    wxFULLSCREEN_NOMENUBAR,
23    wxFULLSCREEN_NOTOOLBAR,
24    wxFULLSCREEN_NOSTATUSBAR,
25    wxFULLSCREEN_NOBORDER,
26    wxFULLSCREEN_NOCAPTION,
27    wxFULLSCREEN_ALL
28};
29
30const char* wxFrameNameStr;
31
32class wxTopLevelWindow : wxNonOwnedWindow
33{
34    %Docstring
35        TopLevelWindow()
36        TopLevelWindow(parent, id=ID_ANY, title=EmptyString, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)
37
38        wxTopLevelWindow is a common base class for wxDialog and wxFrame.
39    %End
40    %TypeHeaderCode
41        #include <wx/toplevel.h>
42    %End
43
44public:
45    wxTopLevelWindow();
46    %PreMethodCode
47        if (!wxPyCheckForApp()) return NULL;
48    %End
49
50    wxTopLevelWindow(
51        wxWindow * parent,
52        wxWindowID id = wxID_ANY,
53        const wxString & title = wxEmptyString,
54        const wxPoint & pos = wxDefaultPosition,
55        const wxSize & size = wxDefaultSize,
56        long style = wxDEFAULT_FRAME_STYLE,
57        const wxString & name = wxFrameNameStr
58    )   /Transfer/;
59    %PreMethodCode
60        if (!wxPyCheckForApp()) return NULL;
61    %End
62
63    ~wxTopLevelWindow();
64
65    bool Create(
66        wxWindow * parent,
67        wxWindowID id = wxID_ANY,
68        const wxString & title = wxEmptyString,
69        const wxPoint & pos = wxDefaultPosition,
70        const wxSize & size = wxDefaultSize,
71        long style = wxDEFAULT_FRAME_STYLE,
72        const wxString & name = wxFrameNameStr
73    )   /TransferThis/;
74    %Docstring
75        Create(parent, id=ID_ANY, title=EmptyString, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr) -> bool
76
77        Creates the top level window.
78    %End
79
80    bool CanSetTransparent();
81    %Docstring
82        CanSetTransparent() -> bool
83
84        Returns true if the platform supports making the window translucent.
85    %End
86
87    void CenterOnScreen(
88        int direction = wxBOTH
89    );
90    %Docstring
91        CenterOnScreen(direction=BOTH)
92
93        A synonym for CentreOnScreen().
94    %End
95
96    void CentreOnScreen(
97        int direction = wxBOTH
98    );
99    %Docstring
100        CentreOnScreen(direction=BOTH)
101
102        Centres the window on screen.
103    %End
104
105    bool EnableCloseButton(
106        bool enable = true
107    );
108    %Docstring
109        EnableCloseButton(enable=True) -> bool
110
111        Enables or disables the Close button (most often in the right upper
112        corner of a dialog) and the Close entry of the system menu (most often
113        in the left upper corner of the dialog).
114    %End
115
116    wxWindow * GetDefaultItem() const;
117    %Docstring
118        GetDefaultItem() -> Window
119
120        Returns a pointer to the button which is the default for this window,
121        or  NULL.
122    %End
123
124    wxIcon GetIcon() const;
125    %Docstring
126        GetIcon() -> Icon
127
128        Returns the standard icon of the window.
129    %End
130
131    const wxIconBundle & GetIcons() const;
132    %Docstring
133        GetIcons() -> IconBundle
134
135        Returns all icons associated with the window, there will be none of
136        them if neither SetIcon() nor SetIcons() had been called before.
137    %End
138
139    wxString GetTitle() const;
140    %Docstring
141        GetTitle() -> String
142
143        Gets a string containing the window title.
144    %End
145
146    void Iconize(
147        bool iconize = true
148    );
149    %Docstring
150        Iconize(iconize=True)
151
152        Iconizes or restores the window.
153    %End
154
155    bool IsActive();
156    %Docstring
157        IsActive() -> bool
158
159        Returns true if this window is currently active, i.e. if the user is
160        currently working with it.
161    %End
162
163    bool IsAlwaysMaximized() const;
164    %Docstring
165        IsAlwaysMaximized() -> bool
166
167        Returns true if this window is expected to be always maximized, either
168        due to platform policy or due to local policy regarding particular
169        class.
170    %End
171
172    bool IsFullScreen() const;
173    %Docstring
174        IsFullScreen() -> bool
175
176        Returns true if the window is in fullscreen mode.
177    %End
178
179    bool IsIconized() const;
180    %Docstring
181        IsIconized() -> bool
182
183        Returns true if the window is iconized.
184    %End
185
186    bool IsMaximized() const;
187    %Docstring
188        IsMaximized() -> bool
189
190        Returns true if the window is maximized.
191    %End
192
193    bool Layout();
194    %Docstring
195        Layout() -> bool
196
197        See wxWindow::SetAutoLayout(): when auto layout is on, this function
198        gets called automatically when the window is resized.
199    %End
200
201    void Maximize(
202        bool maximize = true
203    );
204    %Docstring
205        Maximize(maximize=True)
206
207        Maximizes or restores the window.
208    %End
209
210    void RequestUserAttention(
211        int flags = wxUSER_ATTENTION_INFO
212    );
213    %Docstring
214        RequestUserAttention(flags=USER_ATTENTION_INFO)
215
216        Use a system-dependent way to attract users attention to the window
217        when it is in background.
218    %End
219
220    void Restore();
221    %Docstring
222        Restore()
223
224        Restore a previously iconized or maximized window to its normal state.
225    %End
226
227    wxWindow * SetDefaultItem(
228        wxWindow * win
229    );
230    %Docstring
231        SetDefaultItem(win) -> Window
232
233        Changes the default item for the panel, usually win is a button.
234    %End
235
236    wxWindow * SetTmpDefaultItem(
237        wxWindow * win
238    );
239    %Docstring
240        SetTmpDefaultItem(win) -> Window
241    %End
242
243    wxWindow * GetTmpDefaultItem() const;
244    %Docstring
245        GetTmpDefaultItem() -> Window
246    %End
247
248    void SetIcon(
249        const wxIcon & icon
250    );
251    %Docstring
252        SetIcon(icon)
253
254        Sets the icon for this window.
255    %End
256
257    void SetIcons(
258        const wxIconBundle & icons
259    );
260    %Docstring
261        SetIcons(icons)
262
263        Sets several icons of different sizes for this window: this allows
264        using different icons for different situations (e.g.
265    %End
266
267    void SetMaxSize(
268        const wxSize & size
269    );
270    %Docstring
271        SetMaxSize(size)
272
273        A simpler interface for setting the size hints than SetSizeHints().
274    %End
275
276    void SetMinSize(
277        const wxSize & size
278    );
279    %Docstring
280        SetMinSize(size)
281
282        A simpler interface for setting the size hints than SetSizeHints().
283    %End
284
285    void SetSizeHints(
286        int minW,
287        int minH,
288        int maxW = -1,
289        int maxH = -1,
290        int incW = -1,
291        int incH = -1
292    );
293    %Docstring
294        SetSizeHints(minW, minH, maxW=-1, maxH=-1, incW=-1, incH=-1)
295        SetSizeHints(minSize, maxSize=DefaultSize, incSize=DefaultSize)
296
297        Allows specification of minimum and maximum window sizes, and window
298        size increments.
299    %End
300
301    void SetSizeHints(
302        const wxSize & minSize,
303        const wxSize & maxSize = wxDefaultSize,
304        const wxSize & incSize = wxDefaultSize
305    );
306
307    void SetTitle(
308        const wxString & title
309    );
310    %Docstring
311        SetTitle(title)
312
313        Sets the window title.
314    %End
315
316    bool SetTransparent(
317        wxByte alpha
318    );
319    %Docstring
320        SetTransparent(alpha) -> bool
321
322        If the platform supports it will set the window to be translucent.
323    %End
324
325    virtual
326    bool ShouldPreventAppExit() const;
327    %Docstring
328        ShouldPreventAppExit() -> bool
329
330        This virtual function is not meant to be called directly but can be
331        overridden to return false (it returns true by default) to allow the
332        application to close even if this, presumably not very important,
333        window is still opened.
334    %End
335
336    void OSXSetModified(
337        bool modified
338    );
339    %Docstring
340        OSXSetModified(modified)
341
342        This function sets the wxTopLevelWindow's modified state on OS X,
343        which currently draws a black dot in the wxTopLevelWindow's close
344        button.
345    %End
346
347    bool OSXIsModified() const;
348    %Docstring
349        OSXIsModified() -> bool
350
351        Returns the current modified state of the wxTopLevelWindow on OS X.
352    %End
353
354    void SetRepresentedFilename(
355        const wxString & filename
356    );
357    %Docstring
358        SetRepresentedFilename(filename)
359
360        Sets the file name represented by this wxTopLevelWindow.
361    %End
362
363    void ShowWithoutActivating();
364    %Docstring
365        ShowWithoutActivating()
366
367        Show the wxTopLevelWindow, but do not give it keyboard focus.
368    %End
369
370    bool ShowFullScreen(
371        bool show,
372        long style = wxFULLSCREEN_ALL
373    );
374    %Docstring
375        ShowFullScreen(show, style=FULLSCREEN_ALL) -> bool
376
377        Depending on the value of show parameter the window is either shown
378        full screen or restored to its normal state.
379    %End
380
381    static
382    wxSize GetDefaultSize();
383    %Docstring
384        GetDefaultSize() -> Size
385
386        Get the default size for a new top level window.
387    %End
388
389    void MacSetMetalAppearance(bool on);
390    %Docstring
391        MacSetMetalAppearance(on)
392    %End
393    %MethodCode
394        PyErr_Clear();
395        Py_BEGIN_ALLOW_THREADS
396        _wxTopLevelWindow_MacSetMetalAppearance(sipCpp, on);
397        Py_END_ALLOW_THREADS
398        if (PyErr_Occurred()) sipIsErr = 1;
399    %End
400    %TypeCode
401    void _wxTopLevelWindow_MacSetMetalAppearance(wxTopLevelWindow* self, bool on)
402    {
403        int style = self->GetExtraStyle();
404        if ( on )
405            style |= wxFRAME_EX_METAL;
406        else
407            style &= ~wxFRAME_EX_METAL;
408        self->SetExtraStyle(style);
409    }
410    %End
411
412    bool MacGetMetalAppearance();
413    %Docstring
414        MacGetMetalAppearance() -> bool
415    %End
416    %MethodCode
417        PyErr_Clear();
418        Py_BEGIN_ALLOW_THREADS
419        sipRes = _wxTopLevelWindow_MacGetMetalAppearance(sipCpp);
420        Py_END_ALLOW_THREADS
421        if (PyErr_Occurred()) sipIsErr = 1;
422    %End
423    %TypeCode
424    bool _wxTopLevelWindow_MacGetMetalAppearance(wxTopLevelWindow* self)
425    {
426        return self->GetExtraStyle() & wxFRAME_EX_METAL;
427    }
428    %End
429
430    bool MacGetUnifiedAppearance();
431    %Docstring
432        MacGetUnifiedAppearance() -> bool
433    %End
434    %MethodCode
435        PyErr_Clear();
436        Py_BEGIN_ALLOW_THREADS
437        sipRes = _wxTopLevelWindow_MacGetUnifiedAppearance(sipCpp);
438        Py_END_ALLOW_THREADS
439        if (PyErr_Occurred()) sipIsErr = 1;
440    %End
441    %TypeCode
442    bool _wxTopLevelWindow_MacGetUnifiedAppearance(wxTopLevelWindow* self)
443    {
444        return true;
445    }
446    %End
447
448    void* MacGetTopLevelWindowRef();
449    %Docstring
450        MacGetTopLevelWindowRef() -> void
451    %End
452    %MethodCode
453        PyErr_Clear();
454        Py_BEGIN_ALLOW_THREADS
455        sipRes = _wxTopLevelWindow_MacGetTopLevelWindowRef(sipCpp);
456        Py_END_ALLOW_THREADS
457        if (PyErr_Occurred()) sipIsErr = 1;
458    %End
459    %TypeCode
460    void* _wxTopLevelWindow_MacGetTopLevelWindowRef(wxTopLevelWindow* self)
461    {
462        #ifdef __WXMAC__
463            return (void*)(self->MacGetTopLevelWindowRef());
464        #else
465            return 0;
466        #endif
467    }
468    %End
469
470    %Property(name=DefaultItem, get=GetDefaultItem, set=SetDefaultItem)
471    %Property(name=Icon, get=GetIcon, set=SetIcon)
472    %Property(name=Title, get=GetTitle, set=SetTitle)
473    %Property(name=TmpDefaultItem, get=GetTmpDefaultItem, set=SetTmpDefaultItem)
474    %Property(name=OSXModified, get=OSXIsModified, set=OSXSetModified)
475    %Property(name=MacMetalAppearance, get=MacGetMetalAppearance, set=MacSetMetalAppearance)
476    public:
477    virtual wxPoint GetClientAreaOrigin() const;
478    virtual bool Validate();
479    virtual bool TransferDataToWindow();
480    virtual bool TransferDataFromWindow();
481    virtual void InitDialog();
482    virtual bool AcceptsFocus() const;
483    virtual bool AcceptsFocusRecursively() const;
484    virtual bool AcceptsFocusFromKeyboard() const;
485    virtual void AddChild( wxWindowBase *child );
486    virtual void RemoveChild( wxWindowBase *child );
487    virtual void InheritAttributes();
488    virtual bool ShouldInheritColours() const;
489    virtual void OnInternalIdle();
490    virtual wxWindow *GetMainWindowOfCompositeControl();
491    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
492    virtual void SetCanFocus(bool canFocus);
493    virtual bool Destroy();
494    virtual void SetValidator( const wxValidator &validator );
495    virtual wxValidator* GetValidator();
496
497
498    protected:
499    virtual bool ProcessEvent(wxEvent & event);
500    virtual void DoEnable(bool enable);
501    virtual void DoGetPosition(int *x, int *y) const;
502    virtual void DoGetSize(int *width, int *height) const;
503    virtual void DoGetClientSize(int *width, int *height) const;
504    virtual wxSize DoGetBestSize() const;
505    virtual wxSize DoGetBestClientSize() const;
506    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
507    virtual void DoSetClientSize(int width, int height);
508    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
509    virtual wxSize DoGetBorderSize() const;
510    virtual void DoMoveWindow(int x, int y, int width, int height);
511    virtual void DoSetWindowVariant( wxWindowVariant variant);
512    virtual wxBorder GetDefaultBorder() const;
513    virtual wxBorder GetDefaultBorderForControl() const;
514    virtual void DoFreeze();
515    virtual void DoThaw();
516    virtual bool HasTransparentBackground();
517    virtual bool TryBefore(wxEvent& event);
518    virtual bool TryAfter(wxEvent& event);
519
520
521    public:
522
523
524    static
525    wxVisualAttributes GetClassDefaultAttributes(
526        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
527    );
528    %Docstring
529        GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
530    %End
531    %PreMethodCode
532        if (!wxPyCheckForApp()) return NULL;
533    %End
534
535};  // end of class wxTopLevelWindow
536
537
538
539//---------------------------------------------------------------------------
540
541