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