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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXPacker.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                P a c k e r   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 FXPACKER_H
00022 #define FXPACKER_H
00023 
00024 #ifndef FXCOMPOSITE_H
00025 #include "FXComposite.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00032 enum { DEFAULT_SPACING = 4 };
00033 
00034 
00048 class FXAPI FXPacker : public FXComposite {
00049   FXDECLARE(FXPacker)
00050 protected:
00051   FXColor baseColor;        // Base color
00052   FXColor hiliteColor;      // Highlight color
00053   FXColor shadowColor;      // Shadow color
00054   FXColor borderColor;      // Border color
00055   FXint   padtop;           // Top margin
00056   FXint   padbottom;        // Bottom margin
00057   FXint   padleft;          // Left margin
00058   FXint   padright;         // Right margin
00059   FXint   hspacing;         // Horizontal child spacing
00060   FXint   vspacing;         // Vertical child spacing
00061   FXint   border;           // Border width
00062 protected:
00063   FXPacker();
00064   void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00065   void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00066   void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00067   void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00068   void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00069   void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00070   void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00071   void drawFocusRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00072   void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00073 private:
00074   FXPacker(const FXPacker&);
00075   FXPacker &operator=(const FXPacker&);
00076 public:
00077   long onPaint(FXObject*,FXSelector,void*);
00078   long onFocusUp(FXObject*,FXSelector,void*);
00079   long onFocusDown(FXObject*,FXSelector,void*);
00080   long onFocusLeft(FXObject*,FXSelector,void*);
00081   long onFocusRight(FXObject*,FXSelector,void*);
00082 public:
00083 
00085   FXPacker(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,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
00086 
00088   virtual FXint getDefaultWidth();
00089 
00091   virtual FXint getDefaultHeight();
00092 
00094   virtual void layout();
00095 
00097   void setFrameStyle(FXuint style);
00098 
00100   FXuint getFrameStyle() const;
00101 
00103   void setPackingHints(FXuint ph);
00104 
00106   FXuint getPackingHints() const;
00107 
00109   FXint getBorderWidth() const { return border; }
00110 
00112   void setPadTop(FXint pt);
00113 
00115   FXint getPadTop() const { return padtop; }
00116 
00118   void setPadBottom(FXint pb);
00119 
00121   FXint getPadBottom() const { return padbottom; }
00122 
00124   void setPadLeft(FXint pl);
00125 
00127   FXint getPadLeft() const { return padleft; }
00128 
00130   void setPadRight(FXint pr);
00131 
00133   FXint getPadRight() const { return padright; }
00134 
00136   void setHiliteColor(FXColor clr);
00137 
00139   FXColor getHiliteColor() const { return hiliteColor; }
00140 
00142   void setShadowColor(FXColor clr);
00143 
00145   FXColor getShadowColor() const { return shadowColor; }
00146 
00148   void setBorderColor(FXColor clr);
00149 
00151   FXColor getBorderColor() const { return borderColor; }
00152 
00154   void setBaseColor(FXColor clr);
00155 
00157   FXColor getBaseColor() const { return baseColor; }
00158 
00160   void setHSpacing(FXint hs);
00161 
00163   FXint getHSpacing() const { return hspacing; }
00164 
00166   void setVSpacing(FXint vs);
00167 
00169   FXint getVSpacing() const { return vspacing; }
00170 
00172   virtual void save(FXStream& store) const;
00173 
00175   virtual void load(FXStream& store);
00176   };
00177 
00178 }
00179 
00180 #endif

Copyright © 1997-2011 Jeroen van der Zijp