#include <arsobject.h>
Inheritance diagram for Ars::Thing:


Public Member Functions | |
| Thing (void) | |
| ~Thing (void) | |
| virtual void | Init (icstring &aStr) |
| virtual void | SetWindowRect (const XRect &WindowRect) |
| XRect | GetWindowRect (void) |
| A copy of the CRect that the window represents. | |
| const bool | IsVisible (void) const |
| void | SetFgColor (const RGBColor &c) |
| Assign a new foreground color (text color) to the object. | |
| const RGBColor & | GetFgColor (void) const |
| void | SetBgColor (const RGBColor &c) |
| Assign a new background color to the object. | |
| const RGBColor & | GetBgColor (void) const |
| const unsigned long | GetFlags (void) const |
| void | SetFlags (const unsigned long aFlg) |
| void | ResetFlags (const unsigned long aFlg) |
| virtual const unsigned long | GetStates (void) const |
| bool | SetState (const unsigned long aNewState) |
| const bool | ResetState (const unsigned long aNewState) |
| void | EnableWindow (const bool enable) |
| const int | GetId (void) const |
| const bool | IsDirty (void) const |
| void | SetDirty (const bool aDirty=true) |
Private Attributes | |
| unsigned long | flags |
| Flags of the object: determine how the object reacts. | |
| unsigned long | states |
| State of the object: determine how the object is displayed. | |
| RGBColor | fg |
| Foreground color by default black. | |
| RGBColor | bg |
| Background color by default light grey. | |
| int | obId |
| Identifier of the thing nice if unique - initialized with a unique id. | |
|
|
Definition at line 47 of file arsobject.cpp. References bg, F_NONE, fg, Cfg::GetCfg(), Cfg::Handler::GetCfgColorHex(), Ars::idCnt, and S_NONE.
00048 : XRect( 0 , 0 , 0 , 0 ) , obId( ++idCnt ) , states( S_NONE ) , flags( F_NONE ) 00049 , fg( 0 ,0 ,0 ) , bg( 0xd0 , 0xd0 , 0xd0 ) 00050 { 00051 Cfg::Handler &h = Cfg::GetCfg(); 00052 fg = h.GetCfgColorHex( "Ars" , "text_color" , fg ); 00053 bg = h.GetCfgColorHex( "Ars" , "back_color" , bg ); 00054 } |
|
|
Definition at line 68 of file arsobject.h.
00068 {};
|
|
|
Definition at line 127 of file arsobject.h. References ResetState(), S_DISABLED, and SetState().
00128 { if( enable )
00129 ResetState( S_DISABLED );
00130 else
00131 SetState( S_DISABLED );
00132 }
|
|
|
Definition at line 94 of file arsobject.h. References bg. Referenced by Ars::XLabel::AdjustColors(), Ars::XListBox::Draw(), Ars::XGroupBox::Draw(), Ars::XEditBox::Draw(), Ars::XCheckBox::Draw(), Ars::XBox::Draw(), Ars::Window::DrawBG(), Ars::XTextBox::Init(), Ars::XScrollBar::Init(), Ars::XListBox::Init(), Ars::XDropDown::Init(), Ars::XLabel::RestoreColors(), and Ars::XEditBox::SetReadOnly().
00094 { return bg; }
|
|
|
Definition at line 90 of file arsobject.h. References fg. Referenced by Ars::XListBox::AddItem(), Ars::XLabel::AdjustColors(), Ars::XTextBox::Draw(), Ars::XScrollBar::Draw(), Ars::XListBox::Draw(), Ars::XLabel::Draw(), Ars::XGroupBox::Draw(), Ars::XEditBox::Draw(), Ars::XCheckBox::Draw(), Ars::XBox::GetBorderColor(), Ars::XTextBox::Init(), Ars::XScrollBar::Init(), Ars::XProgress::Init(), Ars::XListBox::Init(), Ars::XDropDown::Init(), and Ars::XLabel::RestoreColors().
00090 { return fg; }
|
|
|
Definition at line 96 of file arsobject.h. References flags. Referenced by Ars::Window::evMouseButtonDown(), Ars::XListBox::Init(), Init(), Ars::Window::IsVisible(), IsVisible(), Ars::XListBox::SetAllSelections(), Ars::XListBox::SetSelection(), and Ars::XEditBox::SetupWindow().
00096 { return flags; }
|
|
|
Definition at line 134 of file arsobject.h. References obId.
00134 { return obId; }
|
|
|
Reimplemented in Ars::Painter. Definition at line 100 of file arsobject.h. References states. Referenced by Init().
00100 { return states; }
|
|
|
A copy of the CRect that the window represents.
Definition at line 84 of file arsobject.h. Referenced by Ars::XLabel::Draw(), Ars::XImage::Draw(), Ars::XGroupBox::Draw(), Ars::XCheckBox::Draw(), Ars::XButtonImage::Draw(), Ars::XBox::Draw(), Ars::Window::DrawBG(), Ars::Form::FindWindowParent(), and Ars::Window::GetClientRect().
00084 { return *static_cast<XRect *>( this ); }
|
|
|
Initialize the thing object via a string the CAR identifiers used are: fg: foreground color (default is GetCfgColorHex( "Ars" , "text_color" )) bg: background color (default is GetCfgColorHex( "Ars" , "back_colors" )) flags: object flags - use mnemonics F_XXX|F_XXX (default is 0) states: object states - use mnemonics S_XXX|S_XXX (default is 0) id: object identifier (default is -1) Reimplemented in Ars::Painter, Ars::Window, Ars::XButtonImage, Ars::XDropDown, Ars::XImage, Ars::XListBox, Ars::XMPEG, Ars::XProgress, Ars::XScrollBar, and Ars::XTextBox. Definition at line 56 of file arsobject.cpp. References Ars::ExprIntParser::Apply(), bg, Ars::XRect::Bottom(), Ars::ExprIntParser::Eval(), fg, Cfg::GetCfg(), GetFlags(), GetStates(), icstring, obId, Ars::XRect::Right(), Ars::ArsApplication::scrH, Ars::ArsApplication::scrW, SetBgColor(), SetFgColor(), SetFlags(), SetState(), and SetWindowRect().
00057 {
00058 XRect r;
00059
00060 icstring coordStr = Rsrc::FindCrdOf( aStr , "coord" );
00061 if( !coordStr.empty() )
00062 {
00063 ExprIntParser p;
00064 string buffer = Rsrc::FindCrdOf( coordStr , "x" ).c_str();
00065 if( buffer.empty() )
00066 r.x = Rsrc::GetInt( aStr , 0 );
00067 else
00068 r.x = p.Apply( p.Eval( buffer ) );
00069 buffer = Rsrc::FindCrdOf( coordStr , "y" ).c_str();
00070 if( buffer.empty() )
00071 r.y = Rsrc::GetInt( aStr , 0 );
00072 else
00073 r.y = p.Apply( p.Eval( buffer ) );
00074 buffer = Rsrc::FindCrdOf( coordStr , "w" ).c_str();
00075 if( buffer.empty() )
00076 r.w = Rsrc::GetInt( aStr , 0 );
00077 else
00078 r.w = p.Apply( p.Eval( buffer ) );
00079 buffer = Rsrc::FindCrdOf( coordStr , "h" ).c_str();
00080 if( buffer.empty() )
00081 r.h = Rsrc::GetInt( aStr , 0 );
00082 else
00083 r.h = p.Apply( p.Eval( buffer ) );
00084 }
00085 else
00086 {
00087 r.x = Rsrc::GetInt( aStr , 0 );
00088 r.y = Rsrc::GetInt( aStr , 0 );
00089 r.w = Rsrc::GetInt( aStr , 0 );
00090 r.h = Rsrc::GetInt( aStr , 0 );
00091 }
00092
00093 if( r.Right() >= Ars::ArsApplication::scrW )
00094 r.w = (Ars::ArsApplication::scrW - 1) - r.x;
00095 if( r.Bottom() >= Ars::ArsApplication::scrH )
00096 r.h = (Ars::ArsApplication::scrH - 1) - r.y;
00097
00098 SetWindowRect( r );
00099
00100 Cfg::Handler &h = Cfg::GetCfg();
00101
00102 // Get the foreground (tex color) and the background color
00103 icstring tmp = Rsrc::FindCrdOf( aStr , "fg" );
00104 SetFgColor( Rsrc::GetColor( tmp , fg ) );
00105 tmp = Rsrc::FindCrdOf( aStr , "bg" );
00106 SetBgColor( Rsrc::GetColor( tmp , bg ) );
00107
00108 // Get the flags and the states...
00109 tmp = Rsrc::FindCrdOf( aStr , "flags" );
00110 SetFlags( Rsrc::GetMnemo( tmp , ArsApplication::Mnemo_f , GetFlags() ) );
00111 tmp = Rsrc::FindCrdOf( aStr , "states" );
00112 SetState( Rsrc::GetMnemo( tmp , ArsApplication::Mnemo_s , GetStates() ) );
00113
00114 tmp = Rsrc::FindCrdOf( aStr , "id" );
00115 obId = Rsrc::GetInt( tmp , obId );
00116 }
|
|
|
Definition at line 136 of file arsobject.h. References F_DIRTY, and flags. Referenced by Ars::Window::HandleMessage(), ResetState(), and SetState().
|
|
|
Reimplemented from Ars::MessageClient. Reimplemented in Ars::Window. Definition at line 86 of file arsobject.h. References F_HIDETREE, and GetFlags().
00086 { return (GetFlags() & F_HIDETREE) == F_HIDETREE; }
|
|
|
Definition at line 98 of file arsobject.h. References flags, and SetDirty(). Referenced by Ars::Window::ShowWindow().
|
|
|
Definition at line 117 of file arsobject.h. References IsDirty(), SetDirty(), and states. Referenced by Ars::XGroupBox::Draw(), Ars::XCheckBox::Draw(), Ars::XButtonImage::Draw(), EnableWindow(), Ars::XButton::evMouseButtonUp(), Ars::XLabel::evMouseMove(), Ars::XEditBox::evMouseMove(), Ars::XButton::evMouseMove(), Ars::Painter::SetTextAlign(), and Ars::XCheckBox::ToggleCheck().
|
|
|
Assign a new background color to the object.
Definition at line 93 of file arsobject.h. References bg. Referenced by Ars::XLabel::AdjustColors(), Ars::XTextBox::Init(), Ars::XScrollBar::Init(), Ars::XListBox::Init(), Ars::XDropDown::Init(), Init(), Ars::XLabel::RestoreColors(), and Ars::XEditBox::SetReadOnly().
00093 { bg = c; }
|
|
|
|
Assign a new foreground color (text color) to the object.
Definition at line 89 of file arsobject.h. References fg. Referenced by Ars::XLabel::AdjustColors(), Ars::XTextBox::Init(), Ars::XScrollBar::Init(), Ars::XListBox::Init(), Ars::XDropDown::Init(), Init(), and Ars::XLabel::RestoreColors().
00089 { fg = c; }
|
|
|
Definition at line 97 of file arsobject.h. References flags, and SetDirty(). Referenced by Ars::Window::HideWindow(), Ars::XTextBox::Init(), Ars::XScrollBar::Init(), Ars::XListBox::Init(), Ars::XDropDown::Init(), and Init().
|
|
|
Definition at line 101 of file arsobject.h. References IsDirty(), S_NONE, SetDirty(), and states. Referenced by Ars::XGroupBox::Draw(), Ars::XCheckBox::Draw(), Ars::XButtonImage::Draw(), EnableWindow(), Ars::XButton::evMouseButtonDown(), Ars::XButton::evMouseButtonUp(), Ars::XLabel::evMouseMove(), Ars::XEditBox::evMouseMove(), Ars::XTextBox::Init(), Ars::XScrollBar::Init(), Ars::XListBox::Init(), Ars::XDropDown::Init(), Init(), Ars::Painter::SetTextAlign(), and Ars::XCheckBox::ToggleCheck().
|
|
|
Giving a control a new WindowRect will move and resize the control
Reimplemented in Ars::Window, Ars::XListBox, Ars::XScrollBar, and Ars::XTextBox. Definition at line 81 of file arsobject.h. Referenced by Init().
00081 { static_cast<XRect &>( *this ) = WindowRect; }
|
|
|
Background color by default light grey.
Definition at line 58 of file arsobject.h. Referenced by GetBgColor(), Init(), SetBgColor(), and Thing(). |
|
|
Foreground color by default black.
Definition at line 57 of file arsobject.h. Referenced by GetFgColor(), Init(), SetFgColor(), and Thing(). |
|
|
Flags of the object: determine how the object reacts.
Definition at line 54 of file arsobject.h. Referenced by GetFlags(), IsDirty(), ResetFlags(), SetDirty(), and SetFlags(). |
|
|
Identifier of the thing nice if unique - initialized with a unique id.
Definition at line 60 of file arsobject.h. |
|
|
State of the object: determine how the object is displayed.
Definition at line 55 of file arsobject.h. Referenced by GetStates(), ResetState(), and SetState(). |
1.3.3