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,2022 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
FXint getPadBottom() const
Get bottom interior padding.
Definition: FXFrame.h:115
FXint getPadTop() const
Get top interior padding.
Definition: FXFrame.h:109
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
The Frame widget provides borders around some contents.
Definition: FXFrame.h:58
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Definition: FX4Splitter.h:28
FXColor getHiliteColor() const
Get highlight color.
Definition: FXFrame.h:133
FXint getBorderWidth() const
Get border width.
Definition: FXFrame.h:103
FXint getPadRight() const
Get right interior padding.
Definition: FXFrame.h:127
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXColor getShadowColor() const
Get shadow color.
Definition: FXFrame.h:139
Window Device Context.
Definition: FXDCWindow.h:48
FXint getPadLeft() const
Get left interior padding.
Definition: FXFrame.h:121
FXColor getBaseColor() const
Get base gui color.
Definition: FXFrame.h:151
FXColor getBorderColor() const
Get border color.
Definition: FXFrame.h:145

Copyright © 1997-2022 Jeroen van der Zijp