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,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 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=nullptr,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
FXButton * cancelButton() const
Return a pointer to the "Cancel" button.
Definition: FXDirSelector.h:113
The Directory Selector widget is the reusable mega-widget component which is the core of the Director...
Definition: FXDirSelector.h:44
A button provides a push button, with optional icon and/or text label.
Definition: FXButton.h:70
FXButton * acceptButton() const
Return a pointer to the "Accept" button.
Definition: FXDirSelector.h:110
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
Packer is a layout manager which automatically places child windows inside its area against the left...
Definition: FXPacker.h:48
A text field is a single-line text entry widget.
Definition: FXTextField.h:63
The FileAssociations object manages file associations between a file extension and a FileAssoc record...
Definition: FXFileAssociations.h:101
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
The Recent Files group manages a most recently used (MRU) file list by means of the standard system r...
Definition: FXRecentFiles.h:49
A Directory List widget provides a tree-structured view of the file system.
Definition: FXDirList.h:124
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp