#include <starsystemobject.h>
Collaboration diagram for StarSystemObject:
Public Member Functions | |
StarSystemObject (void) | |
virtual | ~StarSystemObject (void) |
Protected Member Functions | |
virtual const bool | SetupWindow (const Message &msg) |
virtual const bool | evMouseMove (const MouseMessage &msg) |
virtual const bool | evMouseLClick (const CtrlMessage &msg) |
virtual const bool | evValueChange (const CtrlMessage &msg) |
virtual void | Draw (void) |
Private Attributes | |
StarSystem * | curSS |
|
Definition at line 3 of file starsystemobject.cpp.
00004 : curSS( 0 ) 00005 { 00006 } |
|
Definition at line 9 of file starsystemobject.cpp.
00010 { 00011 } |
|
Definition at line 27 of file starsystemobject.cpp. References curSS, and StarSystem::DrawStarSystem().
00028 { 00029 XBox::Draw(); 00030 00031 if( curSS ) 00032 { 00033 int size = (int)(Height() - GetFontSize() * 4); 00034 XRect r( x , y + (Height() - size) / 2 , w , size ); 00035 00036 curSS->DrawStarSystem( GetGDI() , r , id ); 00037 } 00038 } |
|
Definition at line 52 of file starsystemobject.cpp. References ArsPostMessage, Planet::ClickedOn(), StarSystem::ClickedOn(), curSS, ePlayGame, PlanetInfoDlg::MainLoop(), StarInfoDlg::MainLoop(), and PlanetInfoDlg::SetupInfo().
00053 { 00054 bool ans = XImage::evMouseLClick( msg ); 00055 00056 if( curSS ) 00057 { 00058 Form *f = Rsrc::GetAddr( ePlayGame ); 00059 00060 if( curSS->ClickedOn( &ArsApplication::mousexy ) ) 00061 { 00062 StarInfoDlg sidlg( id , curSS , this ); 00063 if( !sidlg.MainLoop() ) 00064 { 00065 ArsPostMessage( CtrlMessage( Message::CTRL_LCLICK, this, this, 0 ) ); 00066 return true; 00067 } 00068 } 00069 else 00070 { 00071 vector<Planet *>::iterator pos = find_if( curSS->begin() , curSS->end() , bind2nd( mem_fun( &Planet::ClickedOn ) , &ArsApplication::mousexy ) ); 00072 if( pos != curSS->end() ) 00073 { 00074 PlanetInfoDlg pidlg( curSS , this ); 00075 pidlg.SetupInfo( (*pos) ); 00076 if( !pidlg.MainLoop() ) 00077 { 00078 ArsPostMessage( CtrlMessage( Message::CTRL_LCLICK, this, this, 0 ) ); 00079 return true; 00080 } 00081 } 00082 } 00083 00084 f->GetArsObject( 20 )->SetDirty(); 00085 ArsPostMessage( Message( Message::APP_PAINT , (*f)[0] ) ); 00086 00087 ans = true; 00088 } 00089 return ans; 00090 } |
|
Definition at line 40 of file starsystemobject.cpp. References curSS.
00041 { 00042 bool ans = XImage::evMouseMove( msg ); 00043 00044 if( HitTest( msg.Point ) == RELPOS_INSIDE && curSS != 0 ) 00045 { 00046 ans = true; 00047 } 00048 00049 return ans; 00050 } |
|
Definition at line 92 of file starsystemobject.cpp. References curSS.
00093 { 00094 bool ans = XImage::evValueChange( msg ); 00095 00096 if( ((Window *)msg.source)->GetId() == 20 ) 00097 { 00098 curSS = (StarSystem *)msg.value; 00099 SetDirty( true ); 00100 ans = true; 00101 } 00102 return ans; 00103 } |
|
Definition at line 13 of file starsystemobject.cpp. References curSS.
00014 { 00015 XImage::SetupWindow( msg ); 00016 00017 MessageServer::Instance().RegisterMessageClient( this , Message::MOUSE_MOVE ); 00018 MessageServer::Instance().RegisterMessageClient( this , Message::CTRL_LCLICK ); 00019 MessageServer::Instance().RegisterMessageClient( this , Message::CTRL_VALUECHANGE ); 00020 MessageServer::Instance().RegisterMessageClient( this , Message::MOUSE_BUTTONUP ); 00021 MessageServer::Instance().RegisterMessageClient( this , Message::MOUSE_BUTTONDOWN ); 00022 00023 curSS = 0; 00024 return true; 00025 } |
|
Definition at line 21 of file starsystemobject.h. Referenced by Draw(), evMouseLClick(), evMouseMove(), evValueChange(), and SetupWindow(). |