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

FXGroupBox.h
Go to the documentation of this file.
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,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (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 GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXGroupBox.h,v 1.23 2006/01/22 17:58:04 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXGROUPBOX_H
25 #define FXGROUPBOX_H
26 
27 #ifndef FXPACKER_H
28 #include "FXPacker.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 // Group box options
35 enum {
36  GROUPBOX_TITLE_LEFT = 0, /// Title is left-justified
37  GROUPBOX_TITLE_CENTER = 0x00020000, /// Title is centered
38  GROUPBOX_TITLE_RIGHT = 0x00040000, /// Title is right-justified
40  };
41 
42 
43 
44 /**
45 * A group box widget provides a nice raised or sunken border
46 * around a group of widgets, providing a visual delineation.
47 * Typically, a title is placed over the border to provide some
48 * clarification.
49 */
50 class FXAPI FXGroupBox : public FXPacker {
52 protected:
53  FXString label;
54  FXFont *font;
55  FXColor textColor;
56 protected:
58 private:
59  FXGroupBox(const FXGroupBox&);
60  FXGroupBox &operator=(const FXGroupBox&);
61 public:
62  long onPaint(FXObject*,FXSelector,void*);
63  long onCmdSetValue(FXObject*,FXSelector,void*);
64  long onCmdSetStringValue(FXObject*,FXSelector,void*);
65  long onCmdGetStringValue(FXObject*,FXSelector,void*);
66 public:
67 
68  /// Construct group box layout manager
70 
71  /// Create server-side resources
72  virtual void create();
73 
74  /// Detach server-side resources
75  virtual void detach();
76 
77  /// Perform layout
78  virtual void layout();
79 
80  /// Enable the window
81  virtual void enable();
82 
83  /// Disable the window
84  virtual void disable();
85 
86  /// Return default width
87  virtual FXint getDefaultWidth();
88 
89  /// Return default height
90  virtual FXint getDefaultHeight();
91 
92  /// Change group box title text
93  void setText(const FXString& text);
94 
95  /// Return current groupbox title text
96  FXString getText() const { return label; }
97 
98  /// Change group box style
99  void setGroupBoxStyle(FXuint style);
100 
101  /// Return current group box style
102  FXuint getGroupBoxStyle() const;
103 
104  /// Change title font
105  void setFont(FXFont* fnt);
107  /// Return title font
108  FXFont* getFont() const { return font; }
109 
110  /// Change title text color
111  void setTextColor(FXColor clr);
113  /// Return text color
114  FXColor getTextColor() const { return textColor; }
115 
116  /// Save to a stream
117  virtual void save(FXStream& store) const;
118 
119  /// Load from a stream
120  virtual void load(FXStream& store);
121  };
122 
123 }
124 
125 #endif
unsigned int FXuint
Definition: fxdefs.h:396
Title is right-justified.
Definition: FXGroupBox.h:41
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
Base composite.
Definition: FXComposite.h:35
FXuint FXColor
Definition: fxdefs.h:454
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
Title is centered.
Definition: FXGroupBox.h:40
int FXint
Definition: fxdefs.h:397
Packer is a layout manager which automatically places child windows inside its area against the left...
Definition: FXPacker.h:58
Definition: FXPacker.h:38
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
Title is left-justified.
Definition: FXGroupBox.h:39
A group box widget provides a nice raised or sunken border around a group of widgets, providing a visual delineation.
Definition: FXGroupBox.h:57
Definition: FXGroupBox.h:42
Font class.
Definition: FXFont.h:142
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp