Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

StatusBar related classes and routines

 

InfoCtrl

 

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>

 

 

Constructor Detail

 

InfoCtrl()

Constructor. Sets ThinInsetFrame as Frame 0 and "Ready" as the default text.

 

 

Public Method List

 

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.

tab

Index of section.

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.

info

Content of section.

 


 

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.

info

Content.

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.

d

Default text.

Return value

*this for chaining.

 


 

InfoCtrl& Left(int w)

Sets up InfoCtrl to be placed left when added as Frame with defined width.

w

Width of InfoCtrl.

Return value

*this for chaining.

 


 

InfoCtrl& Right(int w)

Sets up InfoCtrl to be placed right when added as Frame with defined width.

w

Width of InfoCtrl.

Return value

*this for chaining.

 

 

 

 

StatusBar

 

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

 

 

Constructor Detail

 

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.

 

 

 

Public Method List

 

virtual void operator=(const String& s)

Same as Set(s).

s

Content of StatusBar.

 


 

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.

_cy

The height.

Return value

*this for chaining.

 


 

StatusBar& NoSizeGrip()

Do not display "size grip".

Return value

*this for chaining.

 

 

 

 

ProgressInfo

 

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.

 

 

Constructor Detail

 

ProgressInfo()

Constructor.

 


 

ProgressInfo(InfoCtrl& f)

Constructor.

f

Target InfoCtrl.

 


 

~ProgressInfo()

Destructor. Sets the Null to target InfoCtrl.

 

 

Public Method List

 

ProgressInfo& Text(const String& s)

Sets the text to be displayed as the label of progress indicator.

s

Text.

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.

cx

Width in pixels.

Return value

*this for chaining.

 


 

ProgressInfo& Width(int _cx)

Sets the width of progress indicator. Default is 200.

_cx

Width in pixels.

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.

_total

Total number.

Return value

*this for chaining.

 


 

ProgressInfo& Set(int _pos, int _total)

Sets the new progress information.

_pos

Current progress.

_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()

Return value

Get().

 

 

Last edit by cxl on 11/29/2016. Do you want to contribute?. T++