FXDirSelector.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *              D i r e c t o r y   S e l e c t i o n   W i d g e t              *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXDirSelector.h,v 1.21 2006/01/22 17:58:00 fox Exp $                     *
00023 ********************************************************************************/
00024 #ifndef FX_DISABLEFILEDIRDIALOGS
00025 
00026 #ifndef FXDIRSELECTOR_H
00027 #define FXDIRSELECTOR_H
00028 
00029 #ifndef FXPACKER_H
00030 #include "FXPacker.h"
00031 #endif
00032 
00033 namespace FX {
00034 
00035 
00036 class FXDirList;
00037 class FXTextField;
00038 class FXButton;
00039 
00040 
00048 class FXAPI FXDirSelector : public FXPacker {
00049   FXDECLARE(FXDirSelector)
00050 protected:
00051   FXDirList     *dirbox;        // Directory list widget
00052   FXTextField   *dirname;       // Directory name entry field
00053   FXButton      *accept;        // Accept button
00054   FXButton      *cancel;        // Cancel button
00055   FXIcon        *updiricon;     // Up directory icon
00056   FXIcon        *homeicon;      // Go home icon
00057   FXIcon        *workicon;      // Go home icon
00058   FXIcon        *markicon;      // Book mark icon
00059   FXIcon        *clearicon;     // Book clear icon
00060   FXIcon        *newicon;       // New directory icon
00061   FXIcon        *deleteicon;    // Delete file icon
00062   FXIcon        *moveicon;      // Rename file icon
00063   FXIcon        *copyicon;      // Copy file icon
00064   FXIcon        *linkicon;      // Link file icon
00065   FXRecentFiles  mrufiles;      // Recently visited places
00066 protected:
00067   FXDirSelector(){}
00068 private:
00069   FXDirSelector(const FXDirSelector&);
00070   FXDirSelector &operator=(const FXDirSelector&);
00071 public:
00072   long onCmdName(FXObject*,FXSelector,void*);
00073   long onCmdOpened(FXObject*,FXSelector,void*);
00074   long onCmdHome(FXObject*,FXSelector,void*);
00075   long onCmdWork(FXObject*,FXSelector,void*);
00076   long onCmdDirectoryUp(FXObject*,FXSelector,void*);
00077   long onPopupMenu(FXObject*,FXSelector,void*);
00078   long onCmdBookmark(FXObject*,FXSelector,void*);
00079   long onCmdVisit(FXObject*,FXSelector,void*);
00080   long onCmdNew(FXObject*,FXSelector,void*);
00081   long onUpdNew(FXObject*,FXSelector,void*);
00082   long onCmdMove(FXObject*,FXSelector,void*);
00083   long onCmdCopy(FXObject*,FXSelector,void*);
00084   long onCmdLink(FXObject*,FXSelector,void*);
00085   long onCmdDelete(FXObject*,FXSelector,void*);
00086   long onUpdSelected(FXObject*,FXSelector,void*);
00087 public:
00088   enum {
00089     ID_DIRNAME=FXPacker::ID_LAST,
00090     ID_DIRLIST,
00091     ID_HOME,
00092     ID_WORK,
00093     ID_DIRECTORY_UP,
00094     ID_BOOKMARK,
00095     ID_VISIT,
00096     ID_NEW,
00097     ID_DELETE,
00098     ID_MOVE,
00099     ID_COPY,
00100     ID_LINK,
00101     ID_LAST
00102     };
00103 public:
00104 
00106   FXDirSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00107 
00109   FXButton *acceptButton() const { return accept; }
00110 
00112   FXButton *cancelButton() const { return cancel; }
00113 
00115   void setDirectory(const FXString& path);
00116 
00118   FXString getDirectory() const;
00119 
00121   FXbool showFiles() const;
00122 
00124   void showFiles(FXbool showing);
00125 
00127   FXbool showHiddenFiles() const;
00128 
00130   void showHiddenFiles(FXbool showing);
00131 
00133   FXuint getMatchMode() const;
00134 
00136   void setMatchMode(FXuint mode);
00137 
00139   void setDirBoxStyle(FXuint style);
00140 
00142   FXuint getDirBoxStyle() const;
00143 
00145   virtual void save(FXStream& store) const;
00146 
00148   virtual void load(FXStream& store);
00149 
00151   virtual ~FXDirSelector();
00152   };
00153 
00154 }
00155 
00156 #endif
00157 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:20 2009 for TnFOX by doxygen v1.4.7