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

FXStatusLine.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                       S t a t u s L i n e   W i d g e t                       *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,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: FXStatusLine.h,v 1.12 2009/01/06 13:07:27 fox Exp $                      *
00022 ********************************************************************************/
00023 #ifndef FXSTATUSLINE_H
00024 #define FXSTATUSLINE_H
00025 
00026 #ifndef FXFRAME_H
00027 #include "FXFrame.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 /**
00034 * The status line normally shows its permanent message; when
00035 * moving the mouse over a Widget which has status-line help, the status line
00036 * temporarily replaces its normal message with the help information; the status
00037 * line obtains the help message by sending the Widget a ID_QUERY_HELP message
00038 * with type SEL_UPDATE.
00039 * If this query does not result in a new status string, the target of
00040 * the status line is tried via an ordinary SEL_UPDATE message.
00041 * If none of the above work then the status line will display the normal text,
00042 * i.e. the string set via setNormalText().
00043 * If the message contains a newline (\n), then the part before the newline
00044 * will be displayed in the highlight color, while the part after the newline
00045 * is shown using the normal text color.
00046 */
00047 class FXAPI FXStatusLine : public FXFrame {
00048   FXDECLARE(FXStatusLine)
00049 protected:
00050   FXString  status;             // Current status message
00051   FXString  normal;             // Normally displayed message
00052   FXFont   *font;               // Font
00053   FXColor   textColor;          // Status text color
00054   FXColor   textHighlightColor; // Status text highlight color
00055 protected:
00056   FXStatusLine();
00057 private:
00058   FXStatusLine(const FXStatusLine&);
00059   FXStatusLine& operator=(const FXStatusLine&);
00060 public:
00061   long onPaint(FXObject*,FXSelector,void*);
00062   long onUpdate(FXObject*,FXSelector,void*);
00063   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00064   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00065 public:
00066 
00067   /// Constructor
00068   FXStatusLine(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0);
00069 
00070   /// Create server-side resources
00071   virtual void create();
00072 
00073   /// Detach server-side resources
00074   virtual void detach();
00075 
00076   /// Return default width
00077   virtual FXint getDefaultWidth();
00078 
00079   /// Return default height
00080   virtual FXint getDefaultHeight();
00081 
00082   /// Change the temporary status message
00083   void setText(const FXString& text);
00084 
00085   /// Return the temporary status message
00086   FXString getText() const { return status; }
00087 
00088   /// Change the permanent status message
00089   void setNormalText(const FXString& text);
00090 
00091   /// Return the permanent status message
00092   FXString getNormalText() const { return normal; }
00093 
00094   /// Change the font
00095   void setFont(FXFont* fnt);
00096 
00097   /// Return the current font
00098   FXFont* getFont() const { return font; }
00099 
00100   /// Return the text color
00101   FXColor getTextColor() const { return textColor; }
00102 
00103   /// Change the text color
00104   void setTextColor(FXColor clr);
00105 
00106   /// Return the highlight text color
00107   FXColor getTextHighlightColor() const { return textHighlightColor; }
00108 
00109   /// Change the highlight text color
00110   void setTextHighlightColor(FXColor clr);
00111 
00112   /// Save status line to stream
00113   virtual void save(FXStream& store) const;
00114 
00115   /// Load status line from stream
00116   virtual void load(FXStream& store);
00117 
00118   /// Destroy
00119   virtual ~FXStatusLine();
00120   };
00121 
00122 }
00123 
00124 #endif

Copyright © 1997-2009 Jeroen van der Zijp