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

FXDirBox.h

00001 /********************************************************************************
00002 *                                                                               *
00003 *                    D i r e c t o r y   B o x   W i d g e t                    *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,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: FXDirBox.h,v 1.15 2002/03/12 07:11:30 fox Exp $                          *
00023 ********************************************************************************/
00024 #ifndef FXDIRBOX_H
00025 #define FXDIRBOX_H
00026 
00027 #ifndef FXTREELISTBOX_H
00028 #include "FXTreeListBox.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 class FXIcon;
00035 
00036 
00037 /// Directory Box
00038 class FXAPI FXDirBox : public FXTreeListBox {
00039   FXDECLARE(FXDirBox)
00040 protected:
00041   FXString    directory;              // Current directory
00042   FXIcon     *foldericon;             // Folder icons
00043   FXIcon     *cdromicon;
00044   FXIcon     *desktopicon;
00045   FXIcon     *harddiskicon;
00046   FXIcon     *networkicon;
00047   FXIcon     *floppyicon;
00048   FXIcon     *computericon;
00049   FXIcon     *nethoodicon;
00050   FXIcon     *zipdiskicon;
00051 protected:
00052   FXDirBox(){}
00053   FXString itempath(FXTreeItem *item);
00054 private:
00055   FXDirBox(const FXDirBox&);
00056   FXDirBox &operator=(const FXDirBox&);
00057 public:
00058   long onChanged(FXObject*,FXSelector,void*);
00059   long onCommand(FXObject*,FXSelector,void*);
00060   long onCmdSetValue(FXObject*,FXSelector,void*);
00061   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00062   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00063 public:
00064 
00065   /// Constructor
00066   FXDirBox(FXComposite *p,FXint nvis,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00067 
00068   /// Create server-side resources
00069   virtual void create();
00070 
00071   /// Detach server-side resources
00072   virtual void detach();
00073 
00074   /// Destroy server-side resources
00075   virtual void destroy();
00076 
00077   /// Save to stream
00078   virtual void save(FXStream& store) const;
00079 
00080   /// Load from stream
00081   virtual void load(FXStream& store);
00082 
00083   /// Set current directory
00084   void setDirectory(const FXString& pathname);
00085 
00086   /// Return current directory
00087   FXString getDirectory() const { return directory; }
00088 
00089   /// Destructor
00090   virtual ~FXDirBox();
00091   };
00092 
00093 }
00094 
00095 #endif