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%ModuleHeaderCode
12#include <wx/dirctrl.h>
13%End
14
15
16//---------------------------------------------------------------------------
17
18enum
19{
20    wxDIRCTRL_DIR_ONLY,
21    wxDIRCTRL_SELECT_FIRST,
22    wxDIRCTRL_SHOW_FILTERS,
23    wxDIRCTRL_3D_INTERNAL,
24    wxDIRCTRL_EDIT_LABELS,
25    wxDIRCTRL_MULTIPLE
26};
27
28wxEventType wxEVT_DIRCTRL_SELECTIONCHANGED   /PyName=wxEVT_DIRCTRL_SELECTIONCHANGED/;
29
30wxEventType wxEVT_DIRCTRL_FILEACTIVATED   /PyName=wxEVT_DIRCTRL_FILEACTIVATED/;
31
32class wxGenericDirCtrl : wxControl
33{
34    %Docstring
35        GenericDirCtrl()
36        GenericDirCtrl(parent, id=ID_ANY, dir=DirDialogDefaultFolderStr, pos=DefaultPosition, size=DefaultSize, style=DIRCTRL_3D_INTERNAL, filter=EmptyString, defaultFilter=0, name=TreeCtrlNameStr)
37
38        This control can be used to place a directory listing (with optional
39        files) on an arbitrary window.
40    %End
41    %TypeHeaderCode
42        #include <wx/dirctrl.h>
43    %End
44
45public:
46    wxGenericDirCtrl();
47    %PreMethodCode
48        if (!wxPyCheckForApp()) return NULL;
49    %End
50
51    wxGenericDirCtrl(
52        wxWindow * parent,
53        const wxWindowID id = wxID_ANY,
54        const wxString & dir = wxDirDialogDefaultFolderStr,
55        const wxPoint & pos = wxDefaultPosition,
56        const wxSize & size = wxDefaultSize,
57        long style = wxDIRCTRL_3D_INTERNAL,
58        const wxString & filter = wxEmptyString,
59        int defaultFilter = 0,
60        const wxString & name = wxTreeCtrlNameStr
61    )   /Transfer/;
62    %PreMethodCode
63        if (!wxPyCheckForApp()) return NULL;
64    %End
65
66    ~wxGenericDirCtrl();
67
68    bool CollapsePath(
69        const wxString & path
70    );
71    %Docstring
72        CollapsePath(path) -> bool
73
74        Collapse the given path.
75    %End
76
77    void CollapseTree();
78    %Docstring
79        CollapseTree()
80
81        Collapses the entire tree.
82    %End
83
84    bool Create(
85        wxWindow * parent,
86        const wxWindowID id = wxID_ANY,
87        const wxString & dir = wxDirDialogDefaultFolderStr,
88        const wxPoint & pos = wxDefaultPosition,
89        const wxSize & size = wxDefaultSize,
90        long style = wxDIRCTRL_3D_INTERNAL,
91        const wxString & filter = wxEmptyString,
92        int defaultFilter = 0,
93        const wxString & name = wxTreeCtrlNameStr
94    )   /TransferThis/;
95    %Docstring
96        Create(parent, id=ID_ANY, dir=DirDialogDefaultFolderStr, pos=DefaultPosition, size=DefaultSize, style=DIRCTRL_3D_INTERNAL, filter=EmptyString, defaultFilter=0, name=TreeCtrlNameStr) -> bool
97
98        Create function for two-step construction.
99    %End
100
101    bool ExpandPath(
102        const wxString & path
103    );
104    %Docstring
105        ExpandPath(path) -> bool
106
107        Tries to expand as much of the given path as possible, so that the
108        filename or directory is visible in the tree control.
109    %End
110
111    wxString GetDefaultPath() const;
112    %Docstring
113        GetDefaultPath() -> String
114
115        Gets the default path.
116    %End
117
118    wxString GetFilePath() const;
119    %Docstring
120        GetFilePath() -> String
121
122        Gets selected filename path only (else empty string).
123    %End
124
125    void GetFilePaths(
126        wxArrayString & paths
127    ) const;
128    %Docstring
129        GetFilePaths(paths)
130
131        Fills the array paths with the currently selected filepaths.
132    %End
133
134    wxString GetFilter() const;
135    %Docstring
136        GetFilter() -> String
137
138        Returns the filter string.
139    %End
140
141    int GetFilterIndex() const;
142    %Docstring
143        GetFilterIndex() -> int
144
145        Returns the current filter index (zero-based).
146    %End
147
148    wxDirFilterListCtrl * GetFilterListCtrl() const;
149    %Docstring
150        GetFilterListCtrl() -> DirFilterListCtrl
151
152        Returns a pointer to the filter list control (if present).
153    %End
154
155    wxString GetPath() const;
156    %Docstring
157        GetPath() -> String
158        GetPath(itemId) -> String
159
160        Gets the currently-selected directory or filename.
161    %End
162
163    wxString GetPath(
164        wxTreeItemId itemId
165    ) const;
166
167    void GetPaths(
168        wxArrayString & paths
169    ) const;
170    %Docstring
171        GetPaths(paths)
172
173        Fills the array paths with the selected directories and filenames.
174    %End
175
176    wxTreeItemId GetRootId();
177    %Docstring
178        GetRootId() -> TreeItemId
179
180        Returns the root id for the tree control.
181    %End
182
183    wxTreeCtrl * GetTreeCtrl() const;
184    %Docstring
185        GetTreeCtrl() -> TreeCtrl
186
187        Returns a pointer to the tree control.
188    %End
189
190    void Init();
191    %Docstring
192        Init()
193
194        Initializes variables.
195    %End
196
197    void ReCreateTree();
198    %Docstring
199        ReCreateTree()
200
201        Collapse and expand the tree, thus re-creating it from scratch.
202    %End
203
204    void SetDefaultPath(
205        const wxString & path
206    );
207    %Docstring
208        SetDefaultPath(path)
209
210        Sets the default path.
211    %End
212
213    void SetFilter(
214        const wxString & filter
215    );
216    %Docstring
217        SetFilter(filter)
218
219        Sets the filter string.
220    %End
221
222    void SetFilterIndex(
223        int n
224    );
225    %Docstring
226        SetFilterIndex(n)
227
228        Sets the current filter index (zero-based).
229    %End
230
231    void SetPath(
232        const wxString & path
233    );
234    %Docstring
235        SetPath(path)
236
237        Sets the current path.
238    %End
239
240    void ShowHidden(
241        bool show
242    );
243    %Docstring
244        ShowHidden(show)
245    %End
246
247    void SelectPath(
248        const wxString & path,
249        bool select = true
250    );
251    %Docstring
252        SelectPath(path, select=True)
253
254        Selects the given item.
255    %End
256
257    void SelectPaths(
258        const wxArrayString & paths
259    );
260    %Docstring
261        SelectPaths(paths)
262
263        Selects only the specified paths, clearing any previous selection.
264    %End
265
266    void UnselectAll();
267    %Docstring
268        UnselectAll()
269
270        Removes the selection from all currently selected items.
271    %End
272
273    public:
274    virtual wxPoint GetClientAreaOrigin() const;
275    virtual bool Validate();
276    virtual bool TransferDataToWindow();
277    virtual bool TransferDataFromWindow();
278    virtual void InitDialog();
279    virtual bool AcceptsFocus() const;
280    virtual bool AcceptsFocusRecursively() const;
281    virtual bool AcceptsFocusFromKeyboard() const;
282    virtual void AddChild( wxWindowBase *child );
283    virtual void RemoveChild( wxWindowBase *child );
284    virtual void InheritAttributes();
285    virtual bool ShouldInheritColours() const;
286    virtual void OnInternalIdle();
287    virtual wxWindow *GetMainWindowOfCompositeControl();
288    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
289    virtual void SetCanFocus(bool canFocus);
290    virtual bool Destroy();
291    virtual void SetValidator( const wxValidator &validator );
292    virtual wxValidator* GetValidator();
293
294
295    protected:
296    virtual bool ProcessEvent(wxEvent & event);
297    virtual void DoEnable(bool enable);
298    virtual void DoGetPosition(int *x, int *y) const;
299    virtual void DoGetSize(int *width, int *height) const;
300    virtual void DoGetClientSize(int *width, int *height) const;
301    virtual wxSize DoGetBestSize() const;
302    virtual wxSize DoGetBestClientSize() const;
303    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
304    virtual void DoSetClientSize(int width, int height);
305    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
306    virtual wxSize DoGetBorderSize() const;
307    virtual void DoMoveWindow(int x, int y, int width, int height);
308    virtual void DoSetWindowVariant( wxWindowVariant variant);
309    virtual wxBorder GetDefaultBorder() const;
310    virtual wxBorder GetDefaultBorderForControl() const;
311    virtual void DoFreeze();
312    virtual void DoThaw();
313    virtual bool HasTransparentBackground();
314    virtual bool TryBefore(wxEvent& event);
315    virtual bool TryAfter(wxEvent& event);
316
317
318    public:
319
320
321    static
322    wxVisualAttributes GetClassDefaultAttributes(
323        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
324    );
325    %Docstring
326        GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
327    %End
328    %PreMethodCode
329        if (!wxPyCheckForApp()) return NULL;
330    %End
331
332    public:
333
334
335    %Property(name=DefaultPath, get=GetDefaultPath, set=SetDefaultPath)
336    %Property(name=FilePath, get=GetFilePath)
337    %Property(name=Filter, get=GetFilter, set=SetFilter)
338    %Property(name=FilterIndex, get=GetFilterIndex, set=SetFilterIndex)
339    %Property(name=FilterListCtrl, get=GetFilterListCtrl)
340    %Property(name=Path, get=GetPath, set=SetPath)
341    %Property(name=RootId, get=GetRootId)
342    %Property(name=TreeCtrl, get=GetTreeCtrl)
343};  // end of class wxGenericDirCtrl
344
345
346class wxDirFilterListCtrl : wxChoice
347{
348    %Docstring
349        DirFilterListCtrl()
350        DirFilterListCtrl(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0)
351    %End
352    %TypeHeaderCode
353        #include <wx/dirctrl.h>
354    %End
355
356public:
357    wxDirFilterListCtrl();
358
359    wxDirFilterListCtrl(
360        wxGenericDirCtrl * parent,
361        const wxWindowID id = wxID_ANY,
362        const wxPoint & pos = wxDefaultPosition,
363        const wxSize & size = wxDefaultSize,
364        long style = 0
365    );
366
367    virtual
368    ~wxDirFilterListCtrl();
369
370    bool Create(
371        wxGenericDirCtrl * parent,
372        const wxWindowID id = wxID_ANY,
373        const wxPoint & pos = wxDefaultPosition,
374        const wxSize & size = wxDefaultSize,
375        long style = 0
376    );
377    %Docstring
378        Create(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0) -> bool
379    %End
380
381    void Init();
382    %Docstring
383        Init()
384    %End
385
386    void FillFilterList(
387        const wxString & filter,
388        int defaultFilter
389    );
390    %Docstring
391        FillFilterList(filter, defaultFilter)
392    %End
393
394};  // end of class wxDirFilterListCtrl
395
396
397%Extract(id=pycode_core)
398EVT_DIRCTRL_SELECTIONCHANGED = wx.PyEventBinder( wxEVT_DIRCTRL_SELECTIONCHANGED, 1 )
399EVT_DIRCTRL_FILEACTIVATED = wx.PyEventBinder( wxEVT_DIRCTRL_FILEACTIVATED, 1 )
400
401%End
402
403
404//---------------------------------------------------------------------------
405
406