Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXFileDialog.h
1 /********************************************************************************
2 * *
3 * F i l e S e l e c t i o n D i a l o g *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2024 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXFILEDIALOG_H
22 #define FXFILEDIALOG_H
23 
24 #ifndef FXDIALOGBOX_H
25 #include "FXDialogBox.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXFileSelector;
32 class FXIconSource;
33 class FXFileAssociations;
34 
35 
37 class FXAPI FXFileDialog : public FXDialogBox {
38  FXDECLARE(FXFileDialog)
39 protected:
40  FXFileSelector *filebox;
41 protected:
42  static const FXchar sectionName[];
43 protected:
44  FXFileDialog(){}
45  void readRegistry();
46  void writeRegistry();
47 private:
48  FXFileDialog(const FXFileDialog&);
49  FXFileDialog &operator=(const FXFileDialog&);
50 public:
51 
53  FXFileDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=500,FXint h=300);
54 
56  FXFileDialog(FXApp* a,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=500,FXint h=300);
57 
59  virtual void create();
60 
62  virtual void destroy();
63 
65  void setFilename(const FXString& path);
66 
68  FXString getFilename() const;
69 
71  FXString* getFilenames() const;
72 
74  void setDirectory(const FXString& path);
75 
77  FXString getDirectory() const;
78 
80  void setSelectMode(FXuint mode);
81 
83  FXuint getSelectMode() const;
84 
86  void setPattern(const FXString& ptrn);
87 
89  FXString getPattern() const;
90 
92  void setMatchMode(FXuint mode);
93 
95  FXuint getMatchMode() const;
96 
111  void setPatternList(const FXString& patterns);
112 
114  FXString getPatternList() const;
115 
120  void setCurrentPattern(FXint patno);
121 
123  FXint getCurrentPattern() const;
124 
126  void setPatternText(FXint patno,const FXString& text);
127 
129  FXString getPatternText(FXint patno) const;
130 
132  FXint getNumPatterns() const;
133 
135  void allowPatternEntry(FXbool flag);
136 
138  FXbool allowPatternEntry() const;
139 
141  void setItemSpace(FXint s);
142 
144  FXint getItemSpace() const;
145 
147  FXbool showHiddenFiles() const;
148 
150  void showHiddenFiles(FXbool flag);
151 
153  FXbool showImages() const;
154 
156  void showImages(FXbool flag);
157 
159  FXint getImageSize() const;
160 
162  void setImageSize(FXint size);
163 
165  void showReadOnly(FXbool flag);
166 
168  FXbool shownReadOnly() const;
169 
171  void setReadOnly(FXbool flag);
172 
174  FXbool getReadOnly() const;
175 
177  void setFileBoxStyle(FXuint style);
178 
180  FXuint getFileBoxStyle() const;
181 
183  void allowNavigation(FXbool flag);
184 
186  FXbool allowNavigation() const;
187 
189  void setDraggableFiles(FXbool flag);
190 
192  FXbool getDraggableFiles() const;
193 
195  void setTimeFormat(const FXString& fmt);
196 
198  FXString getTimeFormat() const;
199 
201  void setAssociations(FXFileAssociations* assoc,FXbool owned=false);
202 
204  FXFileAssociations* getAssociations() const;
205 
207  void setIconSource(FXIconSource* src);
208 
210  FXIconSource* getIconSource() const;
211 
218  static FXString getOpenFilename(FXWindow* owner,const FXString& caption,const FXString& path,const FXString& patterns="*",FXint initial=0);
219 
228  static FXString* getOpenFilenames(FXWindow* owner,const FXString& caption,const FXString& path,const FXString& patterns="*",FXint initial=0);
229 
236  static FXString getSaveFilename(FXWindow* owner,const FXString& caption,const FXString& path,const FXString& patterns="*",FXint initial=0);
237 
244  static FXString getOpenDirectory(FXWindow* owner,const FXString& caption,const FXString& path);
245 
247  virtual void save(FXStream& store) const;
248 
250  virtual void load(FXStream& store);
251 
253  virtual ~FXFileDialog();
254  };
255 
256 }
257 
258 #endif
DialogBox window.
Definition: FXDialogBox.h:37
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
An icon source is a class that loads an icon of any type.
Definition: FXIconSource.h:47
File selection dialog.
Definition: FXFileDialog.h:37
The Application object is the central point of a FOX user-interface.
Definition: FXApp.h:134
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Definition: FX4Splitter.h:28
The FileAssociations object manages file associations between a file extension and a FileAssoc record...
Definition: FXFileAssociations.h:101
File selection widget.
Definition: FXFileSelector.h:57
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp