#include <xprogress.h>
Inheritance diagram for Ars::XProgress:


Public Member Functions | |
| XProgress (void) | |
| ~XProgress (void) | |
| Standard destructor. | |
| virtual void | Init (icstring &aStr) |
| virtual const bool | SetupWindow (const Message &msg) |
| Deregister the setup_window message. | |
| virtual void | SetLimits (const int Min, const int Max) |
| Set the limits of the progress bar. | |
| const int | GetMinLimit (void) const |
| The minimum limit of the progress bar. | |
| const int | GetMaxLimit (void) const |
| The maximum limit of the progress bar. | |
| virtual void | SetProgress (const int iProgress, const bool aNow=false) |
| Set the current progress value. | |
| const int | GetProgress (void) const |
| The current progress value. | |
| virtual void | Draw (void) |
| Draws the progress bar. | |
| virtual const bool | evMouseMove (const MouseMessage &msg) |
Private Attributes | |
| int | m_iMin |
| The minimum value of the progress bar. | |
| int | m_iMax |
| The maximum value of the progress bar. | |
| int | m_iProgress |
| The current value of the progress bar. | |
| RGBColor | BarColor |
| The color of the progress bar. | |
|
|
Constructs a progress bar, initilizes the limits to 0, and 100 with the progress at 0
Definition at line 6 of file xprogress.cpp.
00007 : m_iMin(0),m_iMax(100),m_iProgress(0),BarColor( 0 , 0 , 0 ) 00008 { 00009 } |
|
|
Standard destructor.
Definition at line 12 of file xprogress.cpp.
00013 {
00014
00015 }
|
|
|
Draws the progress bar.
Reimplemented from Ars::XLabel. Definition at line 49 of file xprogress.cpp. References BarColor, Ars::XBox::DrawRaised(), Ars::HPaint::DrawRect(), Ars::XRect::Grow(), m_iMax, m_iMin, and m_iProgress.
00050 {
00051 XRect SubRect( *this );
00052 SubRect.Grow( -1 );
00053 if( m_iProgress > m_iMin )
00054 {
00055 SubRect.w = static_cast<unsigned int>( SubRect.w * (static_cast<double>(m_iProgress - m_iMin) / (m_iMax - m_iMin) ) );
00056 DrawRect( SubRect , true , BarColor , BarColor );
00057 DrawRaised( SubRect , BarColor );
00058 }
00059
00060 XLabel::Draw();
00061 }
|
|
|
Reimplemented from Ars::XLabel. Definition at line 59 of file xprogress.h.
00059 { return false; }
|
|
|
The maximum limit of the progress bar.
Definition at line 47 of file xprogress.h. References m_iMax.
00047 { return m_iMax; }
|
|
|
The minimum limit of the progress bar.
Definition at line 44 of file xprogress.h. References m_iMin.
00044 { return m_iMin; }
|
|
|
The current progress value.
Definition at line 53 of file xprogress.h. References m_iProgress.
00053 { return m_iProgress; }
|
|
|
Initialize the thing object via a string the CAR identifiers used are: min_max: lower and upper bounadry of the progress (default is 0 1) barColor: color to paint the progress bar (default = fgcolor + 32) Reimplemented from Ars::Window. Definition at line 17 of file xprogress.cpp. References BarColor, Ars::Thing::GetFgColor(), icstring, m_iMax, and m_iMin.
00018 {
00019 XLabel::Init( aStr );
00020
00021 icstring tmp = Rsrc::FindCrdOf( aStr , "min_max" );
00022 m_iMin = max( 0 , Rsrc::GetInt( tmp ) );
00023 m_iMax = max( 1 , Rsrc::GetInt( tmp ) );
00024
00025 tmp = Rsrc::FindCrdOf( aStr , "barColor" );
00026 BarColor = Rsrc::GetColor( tmp , GetFgColor().FadeColor( 32 ) );
00027 }
|
|
||||||||||||
|
Set the limits of the progress bar.
Definition at line 41 of file xprogress.h. References m_iMax, and m_iMin.
|
|
||||||||||||
|
Set the current progress value.
Definition at line 38 of file xprogress.cpp. References m_iMax, m_iProgress, Ars::XLabel::SetWndText(), and Ars::Window::UpdateWindow(). Referenced by SetupWindow().
00039 {
00040 m_iProgress = min( m_iMax , iProgress );
00041
00042 char tmp[50];
00043 sprintf( tmp , "%d %%" , (m_iProgress * 100) / m_iMax );
00044 SetWndText( tmp );
00045
00046 UpdateWindow( aNow );
00047 }
|
|
|
Deregister the setup_window message.
Reimplemented from Ars::XLabel. Definition at line 29 of file xprogress.cpp. References SetProgress().
00030 {
00031 XLabel::SetupWindow( msg );
00032
00033 SetProgress( 0 );
00034
00035 return false;
00036 }
|
|
|
The color of the progress bar.
Definition at line 19 of file xprogress.h. |
|
|
The maximum value of the progress bar.
Definition at line 13 of file xprogress.h. Referenced by Draw(), GetMaxLimit(), Init(), SetLimits(), and SetProgress(). |
|
|
The minimum value of the progress bar.
Definition at line 10 of file xprogress.h. Referenced by Draw(), GetMinLimit(), Init(), and SetLimits(). |
|
|
The current value of the progress bar.
Definition at line 16 of file xprogress.h. Referenced by Draw(), GetProgress(), and SetProgress(). |
1.3.3