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

Copyright © 1997-2010 Jeroen van der Zijp