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

FXGroupBox.h

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,2004 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.20 2004/02/08 17:17:33 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 public:
00064 
00065   /// Construct group box layout manager
00066   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);
00067 
00068   /// Create server-side resources
00069   virtual void create();
00070 
00071   /// Detach server-side resources
00072   virtual void detach();
00073 
00074   /// Perform layout
00075   virtual void layout();
00076 
00077   /// Enable the window
00078   virtual void enable();
00079 
00080   /// Disable the window
00081   virtual void disable();
00082 
00083   /// Return default width
00084   virtual FXint getDefaultWidth();
00085 
00086   /// Return default height
00087   virtual FXint getDefaultHeight();
00088 
00089   /// Change group box title text
00090   void setText(const FXString& text);
00091 
00092   /// Return current groupbox title text
00093   FXString getText() const { return label; }
00094 
00095   /// Change group box style
00096   void setGroupBoxStyle(FXuint style);
00097 
00098   /// Return current group box style
00099   FXuint getGroupBoxStyle() const;
00100 
00101   /// Change title font
00102   void setFont(FXFont* fnt);
00103 
00104   /// Return title font
00105   FXFont* getFont() const { return font; }
00106 
00107   /// Change title text color
00108   void setTextColor(FXColor clr);
00109 
00110   /// Return text color
00111   FXColor getTextColor() const { return textColor; }
00112 
00113   /// Save to a stream
00114   virtual void save(FXStream& store) const;
00115 
00116   /// Load from a stream
00117   virtual void load(FXStream& store);
00118   };
00119 
00120 }
00121 
00122 #endif

Copyright © 1997-2004 Jeroen van der Zijp