Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

StarSystemObject Class Reference

#include <starsystemobject.h>

Collaboration diagram for StarSystemObject:

Collaboration graph
[legend]

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

StarSystemcurSS

Constructor & Destructor Documentation

StarSystemObject::StarSystemObject void   ) 
 

Definition at line 3 of file starsystemobject.cpp.

00004 : curSS( 0 )
00005 {
00006 }

StarSystemObject::~StarSystemObject void   )  [virtual]
 

Definition at line 9 of file starsystemobject.cpp.

00010 {
00011 }


Member Function Documentation

void StarSystemObject::Draw void   )  [protected, virtual]
 

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 }

const bool StarSystemObject::evMouseLClick const CtrlMessage &  msg  )  [protected, virtual]
 

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 }

const bool StarSystemObject::evMouseMove const MouseMessage &  msg  )  [protected, virtual]
 

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 }

const bool StarSystemObject::evValueChange const CtrlMessage &  msg  )  [protected, virtual]
 

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 }

const bool StarSystemObject::SetupWindow const Message &  msg  )  [protected, virtual]
 

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 }


Field Documentation

StarSystem* StarSystemObject::curSS [private]
 

Definition at line 21 of file starsystemobject.h.

Referenced by Draw(), evMouseLClick(), evMouseMove(), evValueChange(), and SetupWindow().


The documentation for this class was generated from the following files:
Generated on Fri Dec 5 04:06:37 2003 for Borqueror by doxygen 1.3.3