FXFrame.h

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

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