Statistics
| Revision:

root / trunk / install / launcher / izpack-launcher-1.3_linux / src / wx / include / wx / generic / filedlgg.h @ 6834

History | View | Annotate | Download (5.48 KB)

1
/////////////////////////////////////////////////////////////////////////////
2
// Name:        filedlgg.h
3
// Purpose:     wxFileDialog
4
// Author:      Robert Roebling
5
// Modified by:
6
// Created:     8/17/99
7
// Copyright:   (c) Robert Roebling
8
// RCS-ID:      $Id: filedlgg.h 6834 2006-08-24 08:23:24Z jmvivo $
9
// Licence:     wxWindows licence
10
/////////////////////////////////////////////////////////////////////////////
11

    
12
#ifndef _WX_FILEDLGG_H_
13
#define _WX_FILEDLGG_H_
14

    
15
#include "wx/dialog.h"
16

    
17
//-----------------------------------------------------------------------------
18
// data
19
//-----------------------------------------------------------------------------
20

    
21
WXDLLEXPORT_DATA(extern const wxChar *)wxFileSelectorPromptStr;
22
WXDLLEXPORT_DATA(extern const wxChar *)wxFileSelectorDefaultWildcardStr;
23

    
24
//-----------------------------------------------------------------------------
25
// classes
26
//-----------------------------------------------------------------------------
27

    
28
class wxCheckBox;
29
class wxChoice;
30
class wxFileData;
31
class wxFileCtrl;
32
class wxFileDialog;
33
class wxListEvent;
34
class wxStaticText;
35
class wxTextCtrl;
36

    
37
//-------------------------------------------------------------------------
38
// File selector
39
//-------------------------------------------------------------------------
40

    
41
class wxFileDialog: public wxDialog
42
{
43
public:
44
    wxFileDialog() { }
45

    
46
    wxFileDialog(wxWindow *parent,
47
                 const wxString& message = wxFileSelectorPromptStr,
48
                 const wxString& defaultDir = _T(""),
49
                 const wxString& defaultFile = _T(""),
50
                 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
51
                 long style = 0,
52
                 const wxPoint& pos = wxDefaultPosition);
53
    virtual ~wxFileDialog();
54

    
55
    void SetMessage(const wxString& message) { SetTitle(message); }
56
    void SetPath(const wxString& path);
57
    void SetDirectory(const wxString& dir) { m_dir = dir; }
58
    void SetFilename(const wxString& name) { m_fileName = name; }
59
    void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
60
    void SetStyle(long style) { m_dialogStyle = style; }
61
    void SetFilterIndex(int filterIndex);
62

    
63
    wxString GetMessage() const { return m_message; }
64
    wxString GetPath() const { return m_path; }
65
    wxString GetDirectory() const { return m_dir; }
66
    wxString GetFilename() const { return m_fileName; }
67
    wxString GetWildcard() const { return m_wildCard; }
68
    long GetStyle() const { return m_dialogStyle; }
69
    int GetFilterIndex() const { return m_filterIndex; }
70

    
71
    // for multiple file selection
72
    void GetPaths(wxArrayString& paths) const;
73
    void GetFilenames(wxArrayString& files) const;
74

    
75
    // implementation only from now on
76
    // -------------------------------
77

    
78
    virtual int ShowModal();
79

    
80
    void OnSelected( wxListEvent &event );
81
    void OnActivated( wxListEvent &event );
82
    void OnList( wxCommandEvent &event );
83
    void OnReport( wxCommandEvent &event );
84
    void OnUp( wxCommandEvent &event );
85
    void OnHome( wxCommandEvent &event );
86
    void OnListOk( wxCommandEvent &event );
87
    void OnNew( wxCommandEvent &event );
88
    void OnChoiceFilter( wxCommandEvent &event );
89
    void OnTextEnter( wxCommandEvent &event );
90
    void OnTextChange( wxCommandEvent &event );
91
    void OnCheck( wxCommandEvent &event );
92

    
93
    void HandleAction( const wxString &fn );
94

    
95
protected:
96
    // use the filter with the given index
97
    void DoSetFilterIndex(int filterindex);
98

    
99
    wxString       m_message;
100
    long           m_dialogStyle;
101
    wxString       m_dir;
102
    wxString       m_path; // Full path
103
    wxString       m_fileName;
104
    wxString       m_wildCard;
105
    int            m_filterIndex;
106
    wxString       m_filterExtension;
107
    wxChoice      *m_choice;
108
    wxTextCtrl    *m_text;
109
    wxFileCtrl    *m_list;
110
    wxCheckBox    *m_check;
111
    wxStaticText  *m_static;
112

    
113
private:
114
    DECLARE_DYNAMIC_CLASS(wxFileDialog)
115
    DECLARE_EVENT_TABLE()
116

    
117
    // these variables are preserved between wxFileDialog calls
118
    static long ms_lastViewStyle;     // list or report?
119
    static bool ms_lastShowHidden;    // did we show hidden files?
120
};
121

    
122
// File selector - backward compatibility
123
WXDLLEXPORT wxString
124
wxFileSelector(const wxChar *message = wxFileSelectorPromptStr,
125
               const wxChar *default_path = NULL,
126
               const wxChar *default_filename = NULL,
127
               const wxChar *default_extension = NULL,
128
               const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
129
               int flags = 0,
130
               wxWindow *parent = NULL,
131
               int x = -1, int y = -1);
132

    
133
// An extended version of wxFileSelector
134
WXDLLEXPORT wxString
135
wxFileSelectorEx(const wxChar *message = wxFileSelectorPromptStr,
136
                 const wxChar *default_path = NULL,
137
                 const wxChar *default_filename = NULL,
138
                 int *indexDefaultExtension = NULL,
139
                 const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
140
                 int flags = 0,
141
                 wxWindow *parent = NULL,
142
                 int x = -1, int y = -1);
143

    
144
// Ask for filename to load
145
WXDLLEXPORT wxString
146
wxLoadFileSelector(const wxChar *what,
147
                   const wxChar *extension,
148
                   const wxChar *default_name = (const wxChar *)NULL,
149
                   wxWindow *parent = (wxWindow *) NULL);
150

    
151
// Ask for filename to save
152
WXDLLEXPORT wxString
153
wxSaveFileSelector(const wxChar *what,
154
                   const wxChar *extension,
155
                   const wxChar *default_name = (const wxChar *) NULL,
156
                   wxWindow *parent = (wxWindow *) NULL);
157

    
158

    
159

    
160
#endif
161
    // _WX_DIRDLGG_H_
162

    
163