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

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,2002 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.16 2002/03/12 07:11:30 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 
00034 /// Default padding
00035 const FXint DEFAULT_PAD = 2;
00036 
00037 
00038 /// Base Frame
00039 class FXAPI FXFrame : public FXWindow {
00040   FXDECLARE(FXFrame)
00041 protected:
00042   FXColor baseColor;
00043   FXColor hiliteColor;
00044   FXColor shadowColor;
00045   FXColor borderColor;
00046   FXint   padtop;
00047   FXint   padbottom;
00048   FXint   padleft;
00049   FXint   padright;
00050   FXint   border;
00051 protected:
00052   FXFrame();
00053   void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00054   void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00055   void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00056   void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00057   void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00058   void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00059   void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00060   void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00061 private:
00062   FXFrame(const FXFrame&);
00063   FXFrame &operator=(const FXFrame&);
00064 public:
00065   long onPaint(FXObject*,FXSelector,void*);
00066 public:
00067 
00068   /// Construct frame window
00069   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);
00070 
00071   /// Return default width
00072   virtual FXint getDefaultWidth();
00073 
00074   /// Return default height
00075   virtual FXint getDefaultHeight();
00076 
00077   /// Change frame style
00078   void setFrameStyle(FXuint style);
00079 
00080   /// Get current frame style
00081   FXuint getFrameStyle() const;
00082 
00083   /// Get border width
00084   FXint getBorderWidth() const { return border; }
00085 
00086   /// Change top padding
00087   void setPadTop(FXint pt);
00088 
00089   /// Get top interior padding
00090   FXint getPadTop() const { return padtop; }
00091 
00092   /// Change bottom padding
00093   void setPadBottom(FXint pb);
00094 
00095   /// Get bottom interior padding
00096   FXint getPadBottom() const { return padbottom; }
00097 
00098   /// Change left padding
00099   void setPadLeft(FXint pl);
00100 
00101   /// Get left interior padding
00102   FXint getPadLeft() const { return padleft; }
00103 
00104   /// Change right padding
00105   void setPadRight(FXint pr);
00106 
00107   /// Get right interior padding
00108   FXint getPadRight() const { return padright; }
00109 
00110   /// Change highlight color
00111   void setHiliteColor(FXColor clr);
00112 
00113   /// Get highlight color
00114   FXColor getHiliteColor() const { return hiliteColor; }
00115 
00116   /// Change shadow color
00117   void setShadowColor(FXColor clr);
00118 
00119   /// Get shadow color
00120   FXColor getShadowColor() const { return shadowColor; }
00121 
00122   /// Change border color
00123   void setBorderColor(FXColor clr);
00124 
00125   /// Get border color
00126   FXColor getBorderColor() const { return borderColor; }
00127 
00128   /// Change base gui color
00129   void setBaseColor(FXColor clr);
00130 
00131   /// Get base gui color
00132   FXColor getBaseColor() const { return baseColor; }
00133 
00134   /// Save to stream
00135   virtual void save(FXStream& store) const;
00136 
00137   /// Load from stream
00138   virtual void load(FXStream& store);
00139 
00140   /// Destructor
00141   virtual ~FXFrame();
00142   };
00143 
00144 }
00145 
00146 #endif