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

FXFrame.h
1 /********************************************************************************
2 * *
3 * F r a m e W i n d o w W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXFRAME_H
22 #define FXFRAME_H
23 
24 #ifndef FXWINDOW_H
25 #include "FXWindow.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum {
33  JUSTIFY_NORMAL = 0,
34  JUSTIFY_CENTER_X = 0,
35  JUSTIFY_LEFT = 0x00008000,
36  JUSTIFY_RIGHT = 0x00010000,
37  JUSTIFY_HZ_APART = JUSTIFY_LEFT|JUSTIFY_RIGHT,
38  JUSTIFY_CENTER_Y = 0,
39  JUSTIFY_TOP = 0x00020000,
40  JUSTIFY_BOTTOM = 0x00040000,
41  JUSTIFY_VT_APART = JUSTIFY_TOP|JUSTIFY_BOTTOM
42  };
43 
44 
46 enum { DEFAULT_PAD = 2 };
47 
48 
58 class FXAPI FXFrame : public FXWindow {
59  FXDECLARE(FXFrame)
60 protected:
61  FXColor baseColor; // Base color
62  FXColor hiliteColor; // Highlight color
63  FXColor shadowColor; // Shadow color
64  FXColor borderColor; // Border color
65  FXint padtop; // Top padding
66  FXint padbottom; // Bottom padding
67  FXint padleft; // Left padding
68  FXint padright; // right padding
69  FXint border; // Border size
70 protected:
71  FXFrame();
72  void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
73  void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
74  void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
75  void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
76  void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
77  void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
78  void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
79  void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
80 private:
81  FXFrame(const FXFrame&);
82  FXFrame &operator=(const FXFrame&);
83 public:
84  long onPaint(FXObject*,FXSelector,void*);
85 public:
86 
88  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);
89 
91  virtual FXint getDefaultWidth();
92 
94  virtual FXint getDefaultHeight();
95 
97  void setFrameStyle(FXuint style);
98 
100  FXuint getFrameStyle() const;
101 
103  FXint getBorderWidth() const { return border; }
104 
106  void setPadTop(FXint pt);
107 
109  FXint getPadTop() const { return padtop; }
110 
112  void setPadBottom(FXint pb);
113 
115  FXint getPadBottom() const { return padbottom; }
116 
118  void setPadLeft(FXint pl);
119 
121  FXint getPadLeft() const { return padleft; }
122 
124  void setPadRight(FXint pr);
125 
127  FXint getPadRight() const { return padright; }
128 
130  void setHiliteColor(FXColor clr);
131 
133  FXColor getHiliteColor() const { return hiliteColor; }
134 
136  void setShadowColor(FXColor clr);
137 
139  FXColor getShadowColor() const { return shadowColor; }
140 
142  void setBorderColor(FXColor clr);
143 
145  FXColor getBorderColor() const { return borderColor; }
146 
148  void setBaseColor(FXColor clr);
149 
151  FXColor getBaseColor() const { return baseColor; }
152 
154  virtual void save(FXStream& store) const;
155 
157  virtual void load(FXStream& store);
158  };
159 
160 }
161 
162 #endif

Copyright © 1997-2016 Jeroen van der Zijp