StatusBar related classes and routines
class InfoCtrl : public FrameLR<Ctrl>
InfoCtrl is a simple static Ctrl that represents information field. It is supposed to be used as Frame of StatusBar - multiple InfoCtrls can be added as Frames to the StatusBar, filling it from the left or right.
InfoCtrl is capable of displaying several sections with defined width, defined either as Value or as PaintRect. It is also able to display temporary content for the defined amount of time.
Derived from FrameLR<Ctrl>
InfoCtrl()
Constructor. Sets ThinInsetFrame as Frame 0 and "Ready" as the default text.
void Set(int tab, const PaintRect& info, int width)
void Set(int tab, const Value& info, int width)
Sets (creates if needed) the section of the InfoCtrl.
|
info |
Content of section. Value content is converted to the text using AsString, unless it is Image, which is displayed as is. |
|
width |
Width of section in pixels. Negative value indicates that section should be placed given number of pixels from the right border of the InfoCtrl. |
void Set(const PaintRect& info)
void Set(const Value& info)
Sets the single section that covers the whole InfoCtrl.
void Temporary(const PaintRect& info, int timeoout = 2000)
void Temporary(const Value& info, int timeout = 2000)
Sets the temporary content, displayed instead of defined sections.
|
timeoout |
Timespan of temporary content. |
void EndTemporary()
Immediately stops displaying temporary content.
int GetTabCount() const
|
Return value |
The number of sections. |
void operator=(const String& s)
Same as Set(s).
|
s |
Content of single section covering the whole InfoCtrl. |
InfoCtrl& SetDefault(const String& d)
Sets the default text - this value is used instead of Null values passed to the Set method.
|
Return value |
*this for chaining. |
InfoCtrl& Left(int w)
Sets up InfoCtrl to be placed left when added as Frame with defined width.
|
Return value |
*this for chaining. |
InfoCtrl& Right(int w)
Sets up InfoCtrl to be placed right when added as Frame with defined width.
|
Return value |
*this for chaining. |
class StatusBar : public InfoCtrl
StatusBar is a Frame Ctrl intended to be used as informational bar at the bottom of the main application window.
StatusBar is inherited from InfoCtrl and retains all the functionality of the base class. It adds "size-grip" for resizing of the window (if supported by the platform) and changes its Frame behaviour to be placed at the bottom of its parent window. To add more fields to the StatusBar, use InfoCtrl widgets.
Derived from InfoCtrl
StatusBar()
Constructor. Sets the height based on the current system default font. If there is no global WhenHelpDefault() callback defined for the Bar, defines it so that Bar will use StatusBar to display Menu and ToolBar informational texts.
~StatusBar()
Default destructor.
virtual void operator=(const String& s)
Same as Set(s).
operator Callback1<const String&>()
|
Return value |
A callback that, when invoked, calls Set for the StatusBar. |
StatusBar& Height(int _cy)
Sets the height of the StatusBar.
|
Return value |
*this for chaining. |
StatusBar& NoSizeGrip()
Do not display "size grip".
|
Return value |
*this for chaining. |
class ProgressInfo
This class provides simple tool for displaying progress information in the StatusBar (or generally, in InfoCtrl). It connects to InfoCtrl object and replaces its content with progress indicator.
ProgressInfo()
Constructor.
ProgressInfo(InfoCtrl& f)
Constructor.
~ProgressInfo()
Destructor. Sets the Null to target InfoCtrl.
ProgressInfo& Text(const String& s)
Sets the text to be displayed as the label of progress indicator.
|
Return value |
*this for chaining. |
ProgressInfo& TextWidth(int cx)
Sets the width of text. Zero means that the width has to be determined based on text.
|
Return value |
*this for chaining. |
ProgressInfo& Width(int _cx)
Sets the width of progress indicator. Default is 200.
|
Return value |
*this for chaining. |
ProgressInfo& Placement(int _tabi)
Can be used to place progress indicator to specific section of InfoCtrl.
|
_tabi |
Section index. Progress label is placed at _tabi, progress indicator at _tabi + 1. |
|
Return value |
*this for chaining. |
ProgressInfo& Info(InfoCtrl& _info)
Specifies the target InfoCtrl.
|
_info |
InfoCtrl. Must exists during the lifetime of ProgressInfo. |
|
Return value |
*this for chaining. |
ProgressInfo& Total(int _total)
Sets the total number of progress steps.
|
Return value |
*this for chaining. |
ProgressInfo& Set(int _pos, int _total)
Sets the new progress information.
|
_total |
Total number of progress steps. |
|
Return value |
*this for chaining. |
void Set(int _pos)
Sets the new progress information.
|
_pos |
Current progress. Total number of steps is set by Total method. |
int Get() const
|
Return value |
Current progress. |
void operator=(int p)
Same as Set(p).
void operator++()
Same as Set(Get() + 1)
operator int()
|