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

FXGroupBox.h
1 /********************************************************************************
2 * *
3 * G r o u p B o x 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 FXGROUPBOX_H
22 #define FXGROUPBOX_H
23 
24 #ifndef FXPACKER_H
25 #include "FXPacker.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 // Group box options
32 enum {
33  GROUPBOX_TITLE_LEFT = 0,
34  GROUPBOX_TITLE_CENTER = 0x00020000,
35  GROUPBOX_TITLE_RIGHT = 0x00040000,
36  GROUPBOX_NORMAL = GROUPBOX_TITLE_LEFT
37  };
38 
39 
40 
47 class FXAPI FXGroupBox : public FXPacker {
48  FXDECLARE(FXGroupBox)
49 protected:
50  FXString label;
51  FXFont *font;
52  FXColor textColor;
53 protected:
54  FXGroupBox();
55 private:
56  FXGroupBox(const FXGroupBox&);
57  FXGroupBox &operator=(const FXGroupBox&);
58 public:
59  long onPaint(FXObject*,FXSelector,void*);
60  long onCmdSetValue(FXObject*,FXSelector,void*);
61  long onCmdSetStringValue(FXObject*,FXSelector,void*);
62  long onCmdGetStringValue(FXObject*,FXSelector,void*);
63 public:
64 
66  FXGroupBox(FXComposite* p,const FXString& text,FXuint opts=GROUPBOX_NORMAL,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);
67 
69  virtual void create();
70 
72  virtual void detach();
73 
75  virtual void layout();
76 
78  virtual void enable();
79 
81  virtual void disable();
82 
84  virtual FXint getDefaultWidth();
85 
87  virtual FXint getDefaultHeight();
88 
90  void setText(const FXString& text);
91 
93  FXString getText() const { return label; }
94 
96  void setGroupBoxStyle(FXuint style);
97 
99  FXuint getGroupBoxStyle() const;
100 
102  void setFont(FXFont* fnt);
103 
105  FXFont* getFont() const { return font; }
106 
108  void setTextColor(FXColor clr);
109 
111  FXColor getTextColor() const { return textColor; }
112 
114  virtual void save(FXStream& store) const;
115 
117  virtual void load(FXStream& store);
118  };
119 
120 }
121 
122 #endif

Copyright © 1997-2016 Jeroen van der Zijp