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

FXDirSelector.h

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,2004 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.16 2004/02/08 17:17:33 fox Exp $                     *
00023 ********************************************************************************/
00024 #ifndef FXDIRSELECTOR_H
00025 #define FXDIRSELECTOR_H
00026 
00027 #ifndef FXPACKER_H
00028 #include "FXPacker.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 class FXDirList;
00035 class FXTextField;
00036 class FXButton;
00037 
00038 
00039 /// Directory selection widget
00040 class FXAPI FXDirSelector : public FXPacker {
00041   FXDECLARE(FXDirSelector)
00042 protected:
00043   FXDirList     *dirbox;          // Directory list widget
00044   FXTextField   *dirname;         // Directory name entry field
00045   FXButton      *accept;          // Accept button
00046   FXButton      *cancel;          // Cancel button
00047 protected:
00048   FXDirSelector(){}
00049 private:
00050   FXDirSelector(const FXDirSelector&);
00051   FXDirSelector &operator=(const FXDirSelector&);
00052 public:
00053   long onCmdName(FXObject*,FXSelector,void*);
00054   long onCmdOpened(FXObject*,FXSelector,void*);
00055   long onCmdHome(FXObject*,FXSelector,void*);
00056   long onCmdWork(FXObject*,FXSelector,void*);
00057   long onCmdDirectoryUp(FXObject*,FXSelector,void*);
00058 public:
00059   enum {
00060     ID_DIRNAME=FXPacker::ID_LAST,
00061     ID_DIRLIST,
00062     ID_HOME,
00063     ID_WORK,
00064     ID_DIRECTORY_UP,
00065     ID_LAST
00066     };
00067 public:
00068 
00069   /// Constructor
00070   FXDirSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00071 
00072   /// Return a pointer to the "Accept" button
00073   FXButton *acceptButton() const { return accept; }
00074 
00075   /// Return a pointer to the "Cancel" button
00076   FXButton *cancelButton() const { return cancel; }
00077 
00078   /// Change directory
00079   void setDirectory(const FXString& path);
00080 
00081   /// Return directory
00082   FXString getDirectory() const;
00083 
00084   /// Change Directory List style
00085   void setDirBoxStyle(FXuint style);
00086 
00087   /// Return Directory List style
00088   FXuint getDirBoxStyle() const;
00089 
00090   /// Save to stream
00091   virtual void save(FXStream& store) const;
00092 
00093   /// Load from stream
00094   virtual void load(FXStream& store);
00095 
00096   /// Destructor
00097   virtual ~FXDirSelector();
00098   };
00099 
00100 }
00101 
00102 #endif

Copyright © 1997-2004 Jeroen van der Zijp