![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * G r o u p B o x W i n d o w W i d g e t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1997,2009 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU Lesser General Public License as published by * 00010 * the Free Software Foundation; either version 3 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public License * 00019 * along with this program. If not, see <http://www.gnu.org/licenses/> * 00020 ********************************************************************************* 00021 * $Id: FXGroupBox.h,v 1.27 2009/01/06 13:07:24 fox Exp $ * 00022 ********************************************************************************/ 00023 #ifndef FXGROUPBOX_H 00024 #define FXGROUPBOX_H 00025 00026 #ifndef FXPACKER_H 00027 #include "FXPacker.h" 00028 #endif 00029 00030 namespace FX { 00031 00032 00033 // Group box options 00034 enum { 00035 GROUPBOX_TITLE_LEFT = 0, /// Title is left-justified 00036 GROUPBOX_TITLE_CENTER = 0x00020000, /// Title is centered 00037 GROUPBOX_TITLE_RIGHT = 0x00040000, /// Title is right-justified 00038 GROUPBOX_NORMAL = GROUPBOX_TITLE_LEFT 00039 }; 00040 00041 00042 00043 /** 00044 * A group box widget provides a nice raised or sunken border 00045 * around a group of widgets, providing a visual delineation. 00046 * Typically, a title is placed over the border to provide some 00047 * clarification. 00048 */ 00049 class FXAPI FXGroupBox : public FXPacker { 00050 FXDECLARE(FXGroupBox) 00051 protected: 00052 FXString label; 00053 FXFont *font; 00054 FXColor textColor; 00055 protected: 00056 FXGroupBox(); 00057 private: 00058 FXGroupBox(const FXGroupBox&); 00059 FXGroupBox &operator=(const FXGroupBox&); 00060 public: 00061 long onPaint(FXObject*,FXSelector,void*); 00062 long onCmdSetValue(FXObject*,FXSelector,void*); 00063 long onCmdSetStringValue(FXObject*,FXSelector,void*); 00064 long onCmdGetStringValue(FXObject*,FXSelector,void*); 00065 public: 00066 00067 /// Construct group box layout manager 00068 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); 00069 00070 /// Create server-side resources 00071 virtual void create(); 00072 00073 /// Detach server-side resources 00074 virtual void detach(); 00075 00076 /// Perform layout 00077 virtual void layout(); 00078 00079 /// Enable the window 00080 virtual void enable(); 00081 00082 /// Disable the window 00083 virtual void disable(); 00084 00085 /// Return default width 00086 virtual FXint getDefaultWidth(); 00087 00088 /// Return default height 00089 virtual FXint getDefaultHeight(); 00090 00091 /// Change group box title text 00092 void setText(const FXString& text); 00093 00094 /// Return current groupbox title text 00095 FXString getText() const { return label; } 00096 00097 /// Change group box style 00098 void setGroupBoxStyle(FXuint style); 00099 00100 /// Return current group box style 00101 FXuint getGroupBoxStyle() const; 00102 00103 /// Change title font 00104 void setFont(FXFont* fnt); 00105 00106 /// Return title font 00107 FXFont* getFont() const { return font; } 00108 00109 /// Change title text color 00110 void setTextColor(FXColor clr); 00111 00112 /// Return text color 00113 FXColor getTextColor() const { return textColor; } 00114 00115 /// Save to a stream 00116 virtual void save(FXStream& store) const; 00117 00118 /// Load from a stream 00119 virtual void load(FXStream& store); 00120 }; 00121 00122 } 00123 00124 #endif
![]() |