File: _dirctrl.i

package info (click to toggle)
wxwidgets2.6 2.6.3.2.1.5%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 83,228 kB
  • ctags: 130,941
  • sloc: cpp: 820,043; ansic: 113,030; python: 107,485; makefile: 42,996; sh: 10,305; lex: 194; yacc: 128; xml: 95; pascal: 74
file content (167 lines) | stat: -rw-r--r-- 5,474 bytes parent folder | download | duplicates (6)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/////////////////////////////////////////////////////////////////////////////
// Name:        _ditctrl.i
// Purpose:     SWIG interface file for wxGenericDirCtrl
//
// Author:      Robin Dunn
//
// Created:     10-June-1998
// RCS-ID:      $Id: _dirctrl.i,v 1.9 2004/12/23 20:43:53 RD Exp $
// Copyright:   (c) 2002 by Total Control Software
// Licence:     wxWindows license
/////////////////////////////////////////////////////////////////////////////

// Not a %module


//---------------------------------------------------------------------------

MAKE_CONST_WXSTRING(DirDialogDefaultFolderStr);

//---------------------------------------------------------------------------
%newgroup

// Extra styles for wxGenericDirCtrl
enum
{
    // Only allow directory viewing/selection, no files
    wxDIRCTRL_DIR_ONLY       = 0x0010,
    // When setting the default path, select the first file in the directory
    wxDIRCTRL_SELECT_FIRST   = 0x0020,
    // Show the filter list
    wxDIRCTRL_SHOW_FILTERS   = 0x0040,
    // Use 3D borders on internal controls
    wxDIRCTRL_3D_INTERNAL    = 0x0080,
    // Editable labels
    wxDIRCTRL_EDIT_LABELS    = 0x0100
};



#if 0
class wxDirItemData : public wxObject // wxTreeItemData
{
public:
  wxDirItemData(const wxString& path, const wxString& name, bool isDir);
//  ~wxDirItemDataEx();
  void SetNewDirName( wxString path );
  wxString m_path, m_name;
  bool m_isHidden;
  bool m_isExpanded;
  bool m_isDir;
};
#endif




MustHaveApp(wxGenericDirCtrl);

class wxGenericDirCtrl: public wxControl
{
public:
    %pythonAppend wxGenericDirCtrl         "self._setOORInfo(self)"
    %pythonAppend wxGenericDirCtrl()       ""

    wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1,
                     const wxString& dir = wxPyDirDialogDefaultFolderStr,
                     const wxPoint& pos = wxDefaultPosition,
                     const wxSize& size = wxDefaultSize,
                     long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER,
                     const wxString& filter = wxPyEmptyString,
                     int defaultFilter = 0,
                     const wxString& name = wxPyTreeCtrlNameStr);
    %RenameCtor(PreGenericDirCtrl, wxGenericDirCtrl());


    bool Create(wxWindow *parent, const wxWindowID id = -1,
                const wxString& dir = wxPyDirDialogDefaultFolderStr,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER,
                const wxString& filter = wxPyEmptyString,
                int defaultFilter = 0,
                const wxString& name = wxPyTreeCtrlNameStr);


    
    // Try to expand as much of the given path as possible.
    virtual bool ExpandPath(const wxString& path);


    virtual inline wxString GetDefaultPath() const;
    virtual void SetDefaultPath(const wxString& path);

    // Get dir or filename
    virtual wxString GetPath() const;
    
    // Get selected filename path only (else empty string).
    // I.e. don't count a directory as a selection
    virtual wxString GetFilePath() const;
    virtual void SetPath(const wxString& path);
    
    virtual void ShowHidden( bool show );
    virtual bool GetShowHidden();

    virtual wxString GetFilter() const;
    virtual void SetFilter(const wxString& filter);

    virtual int GetFilterIndex() const;
    virtual void SetFilterIndex(int n);

    virtual wxTreeItemId GetRootId();

    virtual wxPyTreeCtrl* GetTreeCtrl() const;
    virtual wxDirFilterListCtrl* GetFilterListCtrl() const;

    
    // Parse the filter into an array of filters and an array of descriptions
//     virtual int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions);
    
    DocDeclAStr(
        virtual wxTreeItemId, FindChild(wxTreeItemId parentId, const wxString& path, bool& OUTPUT),
        "FindChild(wxTreeItemId parentId, wxString path) -> (item, done)",
        "Find the child that matches the first part of 'path'.  E.g. if a child
path is \"/usr\" and 'path' is \"/usr/include\" then the child for
/usr is returned.  If the path string has been used (we're at the
leaf), done is set to True.
", "");
        
    
    // Resize the components of the control
    virtual void DoResize();
    
    // Collapse & expand the tree, thus re-creating it from scratch:
    virtual void ReCreateTree();

};




MustHaveApp(wxDirFilterListCtrl);

class wxDirFilterListCtrl: public wxChoice
{
public:
    %pythonAppend wxDirFilterListCtrl         "self._setOORInfo(self)"
    %pythonAppend wxDirFilterListCtrl()       ""

    wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = -1,
                        const wxPoint& pos = wxDefaultPosition,
                        const wxSize& size = wxDefaultSize,
                        long style = 0);
    %RenameCtor(PreDirFilterListCtrl, wxDirFilterListCtrl());

    bool Create(wxGenericDirCtrl* parent, const wxWindowID id = -1,
              const wxPoint& pos = wxDefaultPosition,
              const wxSize& size = wxDefaultSize,
              long style = 0);

//// Operations
    void FillFilterList(const wxString& filter, int defaultFilter);
};


//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------