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