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,2005 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.6 2005/01/16 16:06:06 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 static const FXchar defaultMessage[]; 00059 private: 00060 FXStatusLine(const FXStatusLine&); 00061 FXStatusLine& operator=(const FXStatusLine&); 00062 public: 00063 long onPaint(FXObject*,FXSelector,void*); 00064 long onUpdate(FXObject*,FXSelector,void*); 00065 long onCmdGetStringValue(FXObject*,FXSelector,void*); 00066 long onCmdSetStringValue(FXObject*,FXSelector,void*); 00067 public: 00068 00069 /// Constructor 00070 FXStatusLine(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0); 00071 00072 /// Create server-side resources 00073 virtual void create(); 00074 00075 /// Detach server-side resources 00076 virtual void detach(); 00077 00078 /// Return default width 00079 virtual FXint getDefaultWidth(); 00080 00081 /// Return default height 00082 virtual FXint getDefaultHeight(); 00083 00084 /// Change the temporary status message 00085 void setText(const FXString& text); 00086 00087 /// Return the temporary status message 00088 FXString getText() const { return status; } 00089 00090 /// Change the permanent status message 00091 void setNormalText(const FXString& text); 00092 00093 /// Return the permanent status message 00094 FXString getNormalText() const { return normal; } 00095 00096 /// Change the font 00097 void setFont(FXFont* fnt); 00098 00099 /// Return the current font 00100 FXFont* getFont() const { return font; } 00101 00102 /// Return the text color 00103 FXColor getTextColor() const { return textColor; } 00104 00105 /// Change the text color 00106 void setTextColor(FXColor clr); 00107 00108 /// Return the highlight text color 00109 FXColor getTextHighlightColor() const { return textHighlightColor; } 00110 00111 /// Change the highlight text color 00112 void setTextHighlightColor(FXColor clr); 00113 00114 /// Save status line to stream 00115 virtual void save(FXStream& store) const; 00116 00117 /// Load status line from stream 00118 virtual void load(FXStream& store); 00119 00120 /// Destroy 00121 virtual ~FXStatusLine(); 00122 }; 00123 00124 } 00125 00126 #endif
Copyright © 1997-2005 Jeroen van der Zijp |