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

FXStatusLine.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * S t a t u s L i n e W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXStatusLine.h,v 1.8 2006/01/22 17:58:10 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXSTATUSLINE_H
25 #define FXSTATUSLINE_H
26 
27 #ifndef FXFRAME_H
28 #include "FXFrame.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /**
35 * The status line normally shows its permanent message; when
36 * moving the mouse over a Widget which has status-line help, the status line
37 * temporarily replaces its normal message with the help information; the status
38 * line obtains the help message by sending the Widget a ID_QUERY_HELP message
39 * with type SEL_UPDATE.
40 * If this query does not result in a new status string, the target of
41 * the status line is tried via an ordinary SEL_UPDATE message.
42 * If none of the above work then the status line will display the normal text,
43 * i.e. the string set via setNormalText().
44 * If the message contains a newline (\n), then the part before the newline
45 * will be displayed in the highlight color, while the part after the newline
46 * is shown using the normal text color.
47 */
48 class FXAPI FXStatusLine : public FXFrame {
50 protected:
51  FXString status; // Current status message
52  FXString normal; // Normally displayed message
53  FXFont *font; // Font
54  FXColor textColor; // Status text color
55  FXColor textHighlightColor; // Status text highlight color
56 protected:
57  FXStatusLine();
58 private:
59  FXStatusLine(const FXStatusLine&);
60  FXStatusLine& operator=(const FXStatusLine&);
61 public:
62  long onPaint(FXObject*,FXSelector,void*);
63  long onUpdate(FXObject*,FXSelector,void*);
64  long onCmdGetStringValue(FXObject*,FXSelector,void*);
65  long onCmdSetStringValue(FXObject*,FXSelector,void*);
66 public:
67 
68  /// Constructor
70 
71  /// Create server-side resources
72  virtual void create();
73 
74  /// Detach server-side resources
75  virtual void detach();
76 
77  /// Return default width
78  virtual FXint getDefaultWidth();
79 
80  /// Return default height
81  virtual FXint getDefaultHeight();
82 
83  /// Change the temporary status message
84  void setText(const FXString& text);
85 
86  /// Return the temporary status message
87  FXString getText() const { return status; }
88 
89  /// Change the permanent status message
90  void setNormalText(const FXString& text);
91 
92  /// Return the permanent status message
93  FXString getNormalText() const { return normal; }
94 
95  /// Change the font
96  void setFont(FXFont* fnt);
97 
98  /// Return the current font
99  FXFont* getFont() const { return font; }
100 
101  /// Return the text color
102  FXColor getTextColor() const { return textColor; }
103 
104  /// Change the text color
105  void setTextColor(FXColor clr);
106 
107  /// Return the highlight text color
108  FXColor getTextHighlightColor() const { return textHighlightColor; }
109 
110  /// Change the highlight text color
111  void setTextHighlightColor(FXColor clr);
112 
113  /// Save status line to stream
114  virtual void save(FXStream& store) const;
115 
116  /// Load status line from stream
117  virtual void load(FXStream& store);
118 
119  /// Destroy
120  virtual ~FXStatusLine();
121  };
122 
123 }
124 
125 #endif
The Frame widget provides borders around some contents.
Definition: FXFrame.h:73
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
Base composite.
Definition: FXComposite.h:35
FXVec3d normal(const FXVec3d &a, const FXVec3d &b, const FXVec3d &c)
#define NULL
Definition: fxdefs.h:41
FXuint FXColor
Definition: fxdefs.h:454
int FXint
Definition: fxdefs.h:397
The status line normally shows its permanent message; when moving the mouse over a Widget which has s...
Definition: FXStatusLine.h:48
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
Font class.
Definition: FXFont.h:142
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp