Google
Web alhem.net
Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

PlayerDialog Class Reference

#include <PlayerDialog.h>

Inheritance diagram for PlayerDialog:

Inheritance graph
[legend]
Collaboration diagram for PlayerDialog:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PlayerDialog (Surface *)
 ~PlayerDialog ()
void OnEvent (surface_event_t *)
void Draw ()
void AddButton (const string &)
void Clear ()

Private Attributes

int y

Constructor & Destructor Documentation

PlayerDialog::PlayerDialog Surface *   ) 
 

Definition at line 32 of file PlayerDialog.cpp.

References PlayerDialog().

Referenced by PlayerDialog().

00033 :FormSurface(s,220,100,200,200) 00034 ,y(5) 00035 { 00036 Uint32 bgcolor = SDL_MapRGBA(GetScreen() -> format,192,192,192,SDL_ALPHA_OPAQUE); 00037 Uint32 fgcolor = SDL_MapRGBA(GetScreen() -> format,255,192,64,SDL_ALPHA_OPAQUE); 00038 00039 SetText("PlayerDialog"); 00040 CreateTemporaryScreen(); 00041 SetMoveable(true); 00042 00043 // SetBgColor(bgcolor); 00044 // SetFgColor(fgcolor); 00045 }

PlayerDialog::~PlayerDialog  ) 
 

Definition at line 48 of file PlayerDialog.cpp.

00049 { 00050 surfacevector_t::iterator it; 00051 for (it = m_ChildList.begin(); it != m_ChildList.end(); it++) 00052 { 00053 delete *it; 00054 } 00055 }


Member Function Documentation

void PlayerDialog::AddButton const string &   ) 
 

Definition at line 80 of file PlayerDialog.cpp.

References AddButton(), and y.

Referenced by AddButton().

00081 { 00082 Button *pclButton; 00083 00084 pclButton = new Button(this, 5, y, 190, 25); 00085 pclButton -> SetText(str); 00086 pclButton -> SetBgColor( 160, 160, 160 ); 00087 pclButton -> SetMustBeDeleted(true); 00088 AddChild(pclButton); 00089 y += 30; 00090 }

void PlayerDialog::Clear  ) 
 

Definition at line 93 of file PlayerDialog.cpp.

References y.

00094 { 00095 surfacevector_t::iterator it; 00096 Surface *s; 00097 bool repeat = true; 00098 00099 while (repeat) 00100 { 00101 repeat = false; 00102 for (it = m_ChildList.begin(); it != m_ChildList.end(); it++) 00103 { 00104 s = *it; 00105 if (dynamic_cast<Button *>(s)) 00106 { 00107 Remove(s); 00108 repeat = true; 00109 break; 00110 } 00111 } 00112 } 00113 y = 5; 00114 }

void PlayerDialog::Draw  ) 
 

Definition at line 71 of file PlayerDialog.cpp.

00072 { 00073 SDL_Rect *area = GetClientRectPtr(); 00074 Uint32 color = GetBgColor(); 00075 00076 SDL_FillRect(m_screen, area, color); 00077 }

void PlayerDialog::OnEvent surface_event_t *   ) 
 

Definition at line 58 of file PlayerDialog.cpp.

References FormSurface::GetForm(), and OnEvent().

Referenced by OnEvent().

00059 { 00060 PlayerSelect *pcf = dynamic_cast<PlayerSelect *>(GetForm()); 00061 Button *pcb = dynamic_cast<Button *>(pstEvent -> ptr); 00062 00063 if (pcf && pcb) 00064 { 00065 pcf -> SelectPlayer(pcb -> GetText()); 00066 } 00067 OnClose(); 00068 }


Member Data Documentation

int PlayerDialog::y [private]
 

Definition at line 50 of file PlayerDialog.h.

Referenced by AddButton(), and Clear().


The documentation for this class was generated from the following files:
Generated for SDL C++ GUI by doxygen 1.3.6