FXPacker.h

Go to the documentation of this file.
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,2006 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: FXPacker.h,v 1.21 2006/01/22 17:58:07 fox Exp $                          *
00023 ********************************************************************************/
00024 #ifndef FXPACKER_H
00025 #define FXPACKER_H
00026 
00027 #ifndef FXCOMPOSITE_H
00028 #include "FXComposite.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00035 #define DEFAULT_SPACING FXWindow::defaultSpacing()
00036 
00037 
00051 class FXAPI FXPacker : public FXComposite {
00052   FXDECLARE(FXPacker)
00053 protected:
00054   FXColor baseColor;        // Base color
00055   FXColor hiliteColor;      // Highlight color
00056   FXColor shadowColor;      // Shadow color
00057   FXColor borderColor;      // Border color
00058   FXint   padtop;           // Top margin
00059   FXint   padbottom;        // Bottom margin
00060   FXint   padleft;          // Left margin
00061   FXint   padright;         // Right margin
00062   FXint   hspacing;         // Horizontal child spacing
00063   FXint   vspacing;         // Vertical child spacing
00064   FXint   border;           // Border width
00065 protected:
00066   FXPacker();
00067   void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00068   void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00069   void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00070   void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00071   void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00072   void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00073   void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00074   void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00075 private:
00076   FXPacker(const FXPacker&);
00077   FXPacker &operator=(const FXPacker&);
00078 public:
00079   long onPaint(FXObject*,FXSelector,void*);
00080   long onFocusUp(FXObject*,FXSelector,void*);
00081   long onFocusDown(FXObject*,FXSelector,void*);
00082   long onFocusLeft(FXObject*,FXSelector,void*);
00083   long onFocusRight(FXObject*,FXSelector,void*);
00084 public:
00085 
00087   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);
00088 
00090   virtual FXint getDefaultWidth();
00091 
00093   virtual FXint getDefaultHeight();
00094 
00096   virtual void layout();
00097 
00099   void setFrameStyle(FXuint style);
00100 
00102   FXuint getFrameStyle() const;
00103 
00105   void setPackingHints(FXuint ph);
00106 
00108   FXuint getPackingHints() const;
00109 
00111   FXint getBorderWidth() const { return border; }
00112 
00114   void setPadTop(FXint pt);
00115 
00117   FXint getPadTop() const { return padtop; }
00118 
00120   void setPadBottom(FXint pb);
00121 
00123   FXint getPadBottom() const { return padbottom; }
00124 
00126   void setPadLeft(FXint pl);
00127 
00129   FXint getPadLeft() const { return padleft; }
00130 
00132   void setPadRight(FXint pr);
00133 
00135   FXint getPadRight() const { return padright; }
00136 
00138   void setHiliteColor(FXColor clr);
00139 
00141   FXColor getHiliteColor() const { return hiliteColor; }
00142 
00144   void setShadowColor(FXColor clr);
00145 
00147   FXColor getShadowColor() const { return shadowColor; }
00148 
00150   void setBorderColor(FXColor clr);
00151 
00153   FXColor getBorderColor() const { return borderColor; }
00154 
00156   void setBaseColor(FXColor clr);
00157 
00159   FXColor getBaseColor() const { return baseColor; }
00160 
00162   void setHSpacing(FXint hs);
00163 
00165   FXint getHSpacing() const { return hspacing; }
00166 
00168   void setVSpacing(FXint vs);
00169 
00171   FXint getVSpacing() const { return vspacing; }
00172 
00174   virtual void save(FXStream& store) const;
00175 
00177   virtual void load(FXStream& store);
00178   };
00179 
00180 }
00181 
00182 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:23 2009 for TnFOX by doxygen v1.4.7