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

FXGroupBox.h

Go to the documentation of this file.
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,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXGroupBox.h,v 1.23 2006/01/22 17:58:04 fox Exp $                        *
00023 ********************************************************************************/
00024 #ifndef FXGROUPBOX_H
00025 #define FXGROUPBOX_H
00026 
00027 #ifndef FXPACKER_H
00028 #include "FXPacker.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 // Group box options
00035 enum {
00036   GROUPBOX_TITLE_LEFT   = 0,          /// Title is left-justified
00037   GROUPBOX_TITLE_CENTER = 0x00020000, /// Title is centered
00038   GROUPBOX_TITLE_RIGHT  = 0x00040000, /// Title is right-justified
00039   GROUPBOX_NORMAL       = GROUPBOX_TITLE_LEFT
00040   };
00041 
00042 
00043 
00044 /**
00045 * A group box widget provides a nice raised or sunken border
00046 * around a group of widgets, providing a visual delineation.
00047 * Typically, a title is placed over the border to provide some
00048 * clarification.
00049 */
00050 class FXAPI FXGroupBox : public FXPacker {
00051   FXDECLARE(FXGroupBox)
00052 protected:
00053   FXString  label;
00054   FXFont   *font;
00055   FXColor   textColor;
00056 protected:
00057   FXGroupBox();
00058 private:
00059   FXGroupBox(const FXGroupBox&);
00060   FXGroupBox &operator=(const FXGroupBox&);
00061 public:
00062   long onPaint(FXObject*,FXSelector,void*);
00063   long onCmdSetValue(FXObject*,FXSelector,void*);
00064   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00065   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00066 public:
00067 
00068   /// Construct group box layout manager
00069   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);
00070 
00071   /// Create server-side resources
00072   virtual void create();
00073 
00074   /// Detach server-side resources
00075   virtual void detach();
00076 
00077   /// Perform layout
00078   virtual void layout();
00079 
00080   /// Enable the window
00081   virtual void enable();
00082 
00083   /// Disable the window
00084   virtual void disable();
00085 
00086   /// Return default width
00087   virtual FXint getDefaultWidth();
00088 
00089   /// Return default height
00090   virtual FXint getDefaultHeight();
00091 
00092   /// Change group box title text
00093   void setText(const FXString& text);
00094 
00095   /// Return current groupbox title text
00096   FXString getText() const { return label; }
00097 
00098   /// Change group box style
00099   void setGroupBoxStyle(FXuint style);
00100 
00101   /// Return current group box style
00102   FXuint getGroupBoxStyle() const;
00103 
00104   /// Change title font
00105   void setFont(FXFont* fnt);
00106 
00107   /// Return title font
00108   FXFont* getFont() const { return font; }
00109 
00110   /// Change title text color
00111   void setTextColor(FXColor clr);
00112 
00113   /// Return text color
00114   FXColor getTextColor() const { return textColor; }
00115 
00116   /// Save to a stream
00117   virtual void save(FXStream& store) const;
00118 
00119   /// Load from a stream
00120   virtual void load(FXStream& store);
00121   };
00122 
00123 }
00124 
00125 #endif

Copyright © 1997-2005 Jeroen van der Zijp