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

FXDockTitle.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         D o c k T i t l e   W i d g e t                       *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2005,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: FXDockTitle.h,v 1.3 2006/01/22 17:58:01 fox Exp $                        *
00023 ********************************************************************************/
00024 #ifndef FXDOCKTITLE_H
00025 #define FXDOCKTITLE_H
00026 
00027 #ifndef FXDOCKHANDLER_H
00028 #include "FXDockHandler.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 /**
00035 * A dock title is used to move its container, a dock bar.
00036 * The dock title is also used simultaneously to provide a
00037 * caption above the dock bar.
00038 */
00039 class FXAPI FXDockTitle : public FXDockHandler {
00040   FXDECLARE(FXDockTitle)
00041 protected:
00042   FXString  caption;            // Caption text
00043   FXFont   *font;               // Caption font
00044   FXColor   captionColor;       // Caption color
00045 protected:
00046   FXDockTitle();
00047 private:
00048   FXDockTitle(const FXDockTitle&);
00049   FXDockTitle& operator=(const FXDockTitle&);
00050 public:
00051   long onPaint(FXObject*,FXSelector,void*);
00052   long onCmdSetValue(FXObject*,FXSelector,void*);
00053   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00054   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00055 public:
00056 
00057   /// Construct dock bar title widget
00058   FXDockTitle(FXComposite* p,const FXString& text,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_NORMAL|JUSTIFY_CENTER_X|JUSTIFY_CENTER_Y,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0);
00059 
00060   /// Create server-side resources
00061   virtual void create();
00062 
00063   /// Detach server-side resources
00064   virtual void detach();
00065 
00066   /// Return default width
00067   virtual FXint getDefaultWidth();
00068 
00069   /// Return default height
00070   virtual FXint getDefaultHeight();
00071 
00072   /// Set the caption for the grip
00073   void setCaption(const FXString& text);
00074 
00075   /// Get the caption for the grip
00076   FXString getCaption() const { return caption; }
00077 
00078   /// Set caption font
00079   void setFont(FXFont *fnt);
00080 
00081   /// Get caption font
00082   FXFont* getFont() const { return font; }
00083 
00084   /// Get the current caption color
00085   FXColor getCaptionColor() const { return captionColor; }
00086 
00087   /// Set the current caption color
00088   void setCaptionColor(FXColor clr);
00089 
00090   /// Set the current justification mode.
00091   void setJustify(FXuint mode);
00092 
00093   /// Get the current justification mode.
00094   FXuint getJustify() const;
00095 
00096   /// Save to stream
00097   virtual void save(FXStream& store) const;
00098 
00099   /// Load from stream
00100   virtual void load(FXStream& store);
00101 
00102   /// Destroy
00103   virtual ~FXDockTitle();
00104   };
00105 
00106 }
00107 
00108 #endif

Copyright © 1997-2005 Jeroen van der Zijp