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,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: FXDockTitle.h,v 1.7 2009/01/06 13:07:23 fox Exp $                        *
00022 ********************************************************************************/
00023 #ifndef FXDOCKTITLE_H
00024 #define FXDOCKTITLE_H
00025 
00026 #ifndef FXDOCKHANDLER_H
00027 #include "FXDockHandler.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 /**
00034 * A dock title is used to move its container, a dock bar.
00035 * The dock title is also used simultaneously to provide a
00036 * caption above the dock bar.
00037 */
00038 class FXAPI FXDockTitle : public FXDockHandler {
00039   FXDECLARE(FXDockTitle)
00040 protected:
00041   FXString  caption;            // Caption text
00042   FXFont   *font;               // Caption font
00043   FXColor   captionColor;       // Caption color
00044 protected:
00045   FXDockTitle();
00046 private:
00047   FXDockTitle(const FXDockTitle&);
00048   FXDockTitle& operator=(const FXDockTitle&);
00049 public:
00050   long onPaint(FXObject*,FXSelector,void*);
00051   long onCmdSetValue(FXObject*,FXSelector,void*);
00052   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00053   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00054 public:
00055 
00056   /// Construct dock bar title widget
00057   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);
00058 
00059   /// Create server-side resources
00060   virtual void create();
00061 
00062   /// Detach server-side resources
00063   virtual void detach();
00064 
00065   /// Return default width
00066   virtual FXint getDefaultWidth();
00067 
00068   /// Return default height
00069   virtual FXint getDefaultHeight();
00070 
00071   /// Set the caption for the grip
00072   void setCaption(const FXString& text);
00073 
00074   /// Get the caption for the grip
00075   FXString getCaption() const { return caption; }
00076 
00077   /// Set caption font
00078   void setFont(FXFont *fnt);
00079 
00080   /// Get caption font
00081   FXFont* getFont() const { return font; }
00082 
00083   /// Get the current caption color
00084   FXColor getCaptionColor() const { return captionColor; }
00085 
00086   /// Set the current caption color
00087   void setCaptionColor(FXColor clr);
00088 
00089   /// Set the current justification mode.
00090   void setJustify(FXuint mode);
00091 
00092   /// Get the current justification mode.
00093   FXuint getJustify() const;
00094 
00095   /// Save to stream
00096   virtual void save(FXStream& store) const;
00097 
00098   /// Load from stream
00099   virtual void load(FXStream& store);
00100 
00101   /// Destroy
00102   virtual ~FXDockTitle();
00103   };
00104 
00105 }
00106 
00107 #endif

Copyright © 1997-2009 Jeroen van der Zijp