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

FXDirSelector.h
1 /********************************************************************************
2 * *
3 * D i r e c t o r y S e l e c t i o n W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2017 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 FXDIRSELECTOR_H
22 #define FXDIRSELECTOR_H
23 
24 #ifndef FXPACKER_H
25 #include "FXPacker.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXButton;
32 class FXDirList;
33 class FXTextField;
34 class FXFileAssociations;
35 
36 
44 class FXAPI FXDirSelector : public FXPacker {
45  FXDECLARE(FXDirSelector)
46 protected:
47  FXDirList *dirbox; // Directory list widget
48  FXTextField *dirname; // Directory name entry field
49  FXButton *accept; // Accept button
50  FXButton *cancel; // Cancel button
51  FXIcon *updiricon; // Up directory icon
52  FXIcon *homeicon; // Go home icon
53  FXIcon *workicon; // Go home icon
54  FXIcon *bookmarkicon; // Book mark icon
55  FXIcon *bookaddicon; // Book add icon
56  FXIcon *bookdelicon; // Book delete icon
57  FXIcon *bookclricon; // Book clear icon
58  FXIcon *sortingicon; // Sorting icon
59  FXIcon *newicon; // New directory icon
60  FXIcon *deleteicon; // Delete file icon
61  FXIcon *moveicon; // Rename file icon
62  FXIcon *copyicon; // Copy file icon
63  FXIcon *linkicon; // Link file icon
64  FXRecentFiles mrufiles; // Recently visited places
65 protected:
66  FXDirSelector(){}
67 private:
69  FXDirSelector &operator=(const FXDirSelector&);
70 public:
71  long onCmdName(FXObject*,FXSelector,void*);
72  long onCmdOpened(FXObject*,FXSelector,void*);
73  long onCmdHome(FXObject*,FXSelector,void*);
74  long onCmdWork(FXObject*,FXSelector,void*);
75  long onCmdDirectoryUp(FXObject*,FXSelector,void*);
76  long onPopupMenu(FXObject*,FXSelector,void*);
77  long onCmdBookmark(FXObject*,FXSelector,void*);
78  long onCmdUnBookmark(FXObject*,FXSelector,void*);
79  long onCmdVisit(FXObject*,FXSelector,void*);
80  long onCmdNew(FXObject*,FXSelector,void*);
81  long onUpdNew(FXObject*,FXSelector,void*);
82  long onCmdMove(FXObject*,FXSelector,void*);
83  long onCmdCopy(FXObject*,FXSelector,void*);
84  long onCmdLink(FXObject*,FXSelector,void*);
85  long onCmdRemove(FXObject*,FXSelector,void*);
86  long onUpdSelected(FXObject*,FXSelector,void*);
87 public:
88  enum {
89  ID_DIRNAME=FXPacker::ID_LAST,
90  ID_DIRLIST,
91  ID_HOME,
92  ID_WORK,
93  ID_DIRECTORY_UP,
94  ID_BOOKMARK,
95  ID_UNBOOKMARK,
96  ID_VISIT,
97  ID_NEW,
98  ID_REMOVE,
99  ID_MOVE,
100  ID_COPY,
101  ID_LINK,
102  ID_LAST
103  };
104 public:
105 
107  FXDirSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
108 
110  FXButton *acceptButton() const { return accept; }
111 
113  FXButton *cancelButton() const { return cancel; }
114 
116  void setDirectory(const FXString& path);
117 
119  FXString getDirectory() const;
120 
122  void setPattern(const FXString& ptrn);
123 
125  FXString getPattern() const;
126 
128  FXuint getMatchMode() const;
129 
131  void setMatchMode(FXuint mode);
132 
134  FXbool showFiles() const;
135 
137  void showFiles(FXbool showing);
138 
140  FXbool showHiddenFiles() const;
141 
143  void showHiddenFiles(FXbool showing);
144 
146  void setDirBoxStyle(FXuint style);
147 
149  FXuint getDirBoxStyle() const;
150 
152  void setAssociations(FXFileAssociations* assoc,FXbool owned=false);
153 
155  FXFileAssociations* getAssociations() const;
156 
158  virtual void save(FXStream& store) const;
159 
161  virtual void load(FXStream& store);
162 
164  virtual ~FXDirSelector();
165  };
166 
167 }
168 
169 #endif

Copyright © 1997-2016 Jeroen van der Zijp