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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXFrame.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                       F r a m e   W i n d o w   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 FXFRAME_H
00022 #define FXFRAME_H
00023 
00024 #ifndef FXWINDOW_H
00025 #include "FXWindow.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00032 enum {
00033   JUSTIFY_NORMAL       = 0,           
00034   JUSTIFY_CENTER_X     = 0,           
00035   JUSTIFY_LEFT         = 0x00008000,          
00036   JUSTIFY_RIGHT        = 0x00010000,          
00037   JUSTIFY_HZ_APART     = JUSTIFY_LEFT|JUSTIFY_RIGHT,  
00038   JUSTIFY_CENTER_Y     = 0,           
00039   JUSTIFY_TOP          = 0x00020000,          
00040   JUSTIFY_BOTTOM       = 0x00040000,          
00041   JUSTIFY_VT_APART     = JUSTIFY_TOP|JUSTIFY_BOTTOM   
00042   };
00043 
00044 
00046 enum { DEFAULT_PAD = 2 };
00047 
00048 
00058 class FXAPI FXFrame : public FXWindow {
00059   FXDECLARE(FXFrame)
00060 protected:
00061   FXColor baseColor;    // Base color
00062   FXColor hiliteColor;  // Highlight color
00063   FXColor shadowColor;  // Shadow color
00064   FXColor borderColor;  // Border color
00065   FXint   padtop;       // Top padding
00066   FXint   padbottom;    // Bottom padding
00067   FXint   padleft;      // Left padding
00068   FXint   padright;     // right padding
00069   FXint   border;       // Border size
00070 protected:
00071   FXFrame();
00072   void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00073   void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00074   void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00075   void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00076   void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00077   void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00078   void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00079   void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00080 private:
00081   FXFrame(const FXFrame&);
00082   FXFrame &operator=(const FXFrame&);
00083 public:
00084   long onPaint(FXObject*,FXSelector,void*);
00085 public:
00086 
00088   FXFrame(FXComposite* p,FXuint opts=FRAME_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);
00089 
00091   virtual FXint getDefaultWidth();
00092 
00094   virtual FXint getDefaultHeight();
00095 
00097   void setFrameStyle(FXuint style);
00098 
00100   FXuint getFrameStyle() const;
00101 
00103   FXint getBorderWidth() const { return border; }
00104 
00106   void setPadTop(FXint pt);
00107 
00109   FXint getPadTop() const { return padtop; }
00110 
00112   void setPadBottom(FXint pb);
00113 
00115   FXint getPadBottom() const { return padbottom; }
00116 
00118   void setPadLeft(FXint pl);
00119 
00121   FXint getPadLeft() const { return padleft; }
00122 
00124   void setPadRight(FXint pr);
00125 
00127   FXint getPadRight() const { return padright; }
00128 
00130   void setHiliteColor(FXColor clr);
00131 
00133   FXColor getHiliteColor() const { return hiliteColor; }
00134 
00136   void setShadowColor(FXColor clr);
00137 
00139   FXColor getShadowColor() const { return shadowColor; }
00140 
00142   void setBorderColor(FXColor clr);
00143 
00145   FXColor getBorderColor() const { return borderColor; }
00146 
00148   void setBaseColor(FXColor clr);
00149 
00151   FXColor getBaseColor() const { return baseColor; }
00152 
00154   virtual void save(FXStream& store) const;
00155 
00157   virtual void load(FXStream& store);
00158   };
00159 
00160 }
00161 
00162 #endif

Copyright © 1997-2011 Jeroen van der Zijp