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

FXPacker.h
1 /********************************************************************************
2 * *
3 * P a c k e r C o n t a i n e r 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 FXPACKER_H
22 #define FXPACKER_H
23 
24 #ifndef FXCOMPOSITE_H
25 #include "FXComposite.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum { DEFAULT_SPACING = 4 };
33 
34 
48 class FXAPI FXPacker : public FXComposite {
49  FXDECLARE(FXPacker)
50 protected:
51  FXColor baseColor; // Base color
52  FXColor hiliteColor; // Highlight color
53  FXColor shadowColor; // Shadow color
54  FXColor borderColor; // Border color
55  FXint padtop; // Top margin
56  FXint padbottom; // Bottom margin
57  FXint padleft; // Left margin
58  FXint padright; // Right margin
59  FXint hspacing; // Horizontal child spacing
60  FXint vspacing; // Vertical child spacing
61  FXint border; // Border width
62 protected:
63  FXPacker();
64  void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
65  void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
66  void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
67  void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
68  void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
69  void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
70  void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
71  void drawFocusRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
72  void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
73 private:
74  FXPacker(const FXPacker&);
75  FXPacker &operator=(const FXPacker&);
76 public:
77  long onPaint(FXObject*,FXSelector,void*);
78  long onFocusUp(FXObject*,FXSelector,void*);
79  long onFocusDown(FXObject*,FXSelector,void*);
80  long onFocusLeft(FXObject*,FXSelector,void*);
81  long onFocusRight(FXObject*,FXSelector,void*);
82 public:
83 
85  FXPacker(FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
86 
88  virtual FXint getDefaultWidth();
89 
91  virtual FXint getDefaultHeight();
92 
94  virtual void layout();
95 
97  void setFrameStyle(FXuint style);
98 
100  FXuint getFrameStyle() const;
101 
103  void setPackingHints(FXuint ph);
104 
106  FXuint getPackingHints() const;
107 
109  FXint getBorderWidth() const { return border; }
110 
112  void setPadTop(FXint pt);
113 
115  FXint getPadTop() const { return padtop; }
116 
118  void setPadBottom(FXint pb);
119 
121  FXint getPadBottom() const { return padbottom; }
122 
124  void setPadLeft(FXint pl);
125 
127  FXint getPadLeft() const { return padleft; }
128 
130  void setPadRight(FXint pr);
131 
133  FXint getPadRight() const { return padright; }
134 
136  void setHiliteColor(FXColor clr);
137 
139  FXColor getHiliteColor() const { return hiliteColor; }
140 
142  void setShadowColor(FXColor clr);
143 
145  FXColor getShadowColor() const { return shadowColor; }
146 
148  void setBorderColor(FXColor clr);
149 
151  FXColor getBorderColor() const { return borderColor; }
152 
154  void setBaseColor(FXColor clr);
155 
157  FXColor getBaseColor() const { return baseColor; }
158 
160  void setHSpacing(FXint hs);
161 
163  FXint getHSpacing() const { return hspacing; }
164 
166  void setVSpacing(FXint vs);
167 
169  FXint getVSpacing() const { return vspacing; }
170 
172  virtual void save(FXStream& store) const;
173 
175  virtual void load(FXStream& store);
176  };
177 
178 }
179 
180 #endif
FXint getPadTop() const
Get top interior padding.
Definition: FXPacker.h:115
FXint getPadLeft() const
Get left interior padding.
Definition: FXPacker.h:127
FXint getHSpacing() const
Return current horizontal inter-child spacing.
Definition: FXPacker.h:163
FXint getPadBottom() const
Get bottom interior padding.
Definition: FXPacker.h:121
FXColor getBorderColor() const
Get border color.
Definition: FXPacker.h:151
Base composite.
Definition: FXComposite.h:32
FXColor getHiliteColor() const
Get highlight color.
Definition: FXPacker.h:139
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXColor getShadowColor() const
Get shadow color.
Definition: FXPacker.h:145
Definition: FX4Splitter.h:28
FXint getPadRight() const
Get right interior padding.
Definition: FXPacker.h:133
Packer is a layout manager which automatically places child windows inside its area against the left...
Definition: FXPacker.h:48
FXint getBorderWidth() const
Get border width.
Definition: FXPacker.h:109
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
Window Device Context.
Definition: FXDCWindow.h:48
FXint getVSpacing() const
Return current vertical inter-child spacing.
Definition: FXPacker.h:169
FXColor getBaseColor() const
Get base gui color.
Definition: FXPacker.h:157

Copyright © 1997-2022 Jeroen van der Zijp