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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXSwitcher.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                  S w i t c h   C o n t a i n e r   W i d g e t                *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXSWITCHER_H
00022 #define FXSWITCHER_H
00023 
00024 #ifndef FXPACKER_H
00025 #include "FXPacker.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00031 enum {
00032   SWITCHER_HCOLLAPSE = 0x00020000,  
00033   SWITCHER_VCOLLAPSE = 0x00040000   
00034   };
00035 
00036 
00052 class FXAPI FXSwitcher : public FXPacker {
00053   FXDECLARE(FXSwitcher)
00054 protected:
00055   FXint  current;
00056 protected:
00057   FXSwitcher();
00058 private:
00059   FXSwitcher(const FXSwitcher&);
00060   FXSwitcher& operator=(const FXSwitcher&);
00061 public:
00062   long onPaint(FXObject*,FXSelector,void*);
00063   long onCmdSetValue(FXObject*,FXSelector,void*);
00064   long onCmdSetIntValue(FXObject*,FXSelector,void*);
00065   long onCmdGetIntValue(FXObject*,FXSelector,void*);
00066   long onCmdOpen(FXObject*,FXSelector,void*);
00067   long onUpdOpen(FXObject*,FXSelector,void*);
00068 public:
00069   enum {
00070     ID_OPEN_FIRST=FXPacker::ID_LAST,
00071     ID_OPEN_SECOND,
00072     ID_OPEN_THIRD,
00073     ID_OPEN_FOURTH,
00074     ID_OPEN_FIFTH,
00075     ID_OPEN_SIXTH,
00076     ID_OPEN_SEVENTH,
00077     ID_OPEN_EIGHTH,
00078     ID_OPEN_NINETH,
00079     ID_OPEN_TENTH,
00080     ID_OPEN_LAST=ID_OPEN_FIRST+100,
00081     ID_LAST
00082     };
00083 public:
00084 
00086   FXSwitcher(FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING);
00087 
00089   virtual FXint getDefaultWidth();
00090 
00092   virtual FXint getDefaultHeight();
00093 
00095   virtual void layout();
00096 
00098   void setCurrent(FXint index,FXbool notify=false);
00099 
00101   FXint getCurrent() const { return current; }
00102 
00104   void setSwitcherStyle(FXuint style);
00105 
00107   FXuint getSwitcherStyle() const;
00108 
00110   virtual void save(FXStream& store) const;
00111 
00113   virtual void load(FXStream& store);
00114   };
00115 
00116 }
00117 
00118 #endif

Copyright © 1997-2011 Jeroen van der Zijp