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

MenuDialog Class Reference

#include <MenuDialog.h>

List of all members.

Public Member Functions

 MenuDialog (Surface *)
 ~MenuDialog ()
void OnEvent (surface_event_t *)
void Connected (const string &)

Private Attributes

Button m_b1
Button m_b2
Button m_b3
Button m_b4


Constructor & Destructor Documentation

MenuDialog::MenuDialog Surface *  s  ) 
 

File ......... MenuDialog.cpp Published .... 2005-02-07 Author ....... grymse@alhem.net

Definition at line 31 of file MenuDialog.cpp.

References m_b1, m_b2, m_b3, m_b4, MenuDialog(), and UICOMMAND_QUIT.

Referenced by MenuDialog().

00032 :Dialog(s, 160, 140, 320, 200) 00033 ,m_b1(this, 5, 5, 300, 25) 00034 ,m_b2(this, 5, 35, 300, 25) 00035 ,m_b3(this, 5, 65, 300, 25) 00036 ,m_b4(this, 5, 95, 300, 25) 00037 { 00038 Uint32 bgcolor = SDL_MapRGBA(GetScreen() -> format, 192, 192, 192, 128); 00039 Uint32 txtcolor = SDL_MapRGBA(GetScreen() -> format, 255, 192, 64, 255); 00040 00041 SetText("MenuDialog"); 00042 // CreateTemporaryScreen(); 00043 00044 SetTransparent(true); 00045 // SetBgColor(bgcolor); 00046 // SetFgColor(txtcolor); 00047 00048 m_b1.SetText("Connect"); 00049 m_b2.SetText("Options"); 00050 m_b3.SetText("Exit"); 00051 m_b3.SetUICommand(UICOMMAND_QUIT); 00052 m_b4.SetText("Test"); 00053 AddChild(&m_b1); 00054 AddChild(&m_b2); 00055 AddChild(&m_b3); 00056 AddChild(&m_b4); 00057 }

MenuDialog::~MenuDialog  ) 
 

Definition at line 60 of file MenuDialog.cpp.

00061 { 00062 }


Member Function Documentation

void MenuDialog::Connected const string &   ) 
 

Definition at line 107 of file MenuDialog.cpp.

References Connected(), and m_b1.

Referenced by Connected().

00108 { 00109 m_b1.SetText(str); 00110 }

void MenuDialog::OnEvent surface_event_t *   ) 
 

Definition at line 65 of file MenuDialog.cpp.

References m_b1, m_b2, m_b4, OnEvent(), and pprintf().

Referenced by OnEvent().

00066 { 00067 if (pstEvent -> type == GUI_EVENT_BUTTON) 00068 { 00069 if (pstEvent -> local_id == m_b1.GetLocalID()) 00070 { 00071 // connect 00072 MainWindow *pcl = dynamic_cast<MainWindow *>(GetParent()); 00073 if (pcl) 00074 { 00075 SetVisible(false); 00076 InvalidateEv(); 00077 pcl -> Connect(); 00078 } 00079 } 00080 else 00081 if (pstEvent -> local_id == m_b2.GetLocalID()) 00082 { 00083 // options 00084 MainWindow *pcl = dynamic_cast<MainWindow *>(GetParent()); 00085 if (pcl) 00086 { 00087 pcl -> ShowOptions(); 00088 } 00089 } 00090 else 00091 /* 00092 if (pstEvent -> local_id == m_b3.GetLocalID()) 00093 { 00094 // exit 00095 appl -> SetQuit( true ); 00096 } 00097 else 00098 */ 00099 if (pstEvent -> local_id == m_b4.GetLocalID()) 00100 { 00101 pprintf("Test button pressed\n"); 00102 } 00103 } 00104 }


Member Data Documentation

Button MenuDialog::m_b1 [private]
 

Definition at line 43 of file MenuDialog.h.

Referenced by Connected(), MenuDialog(), and OnEvent().

Button MenuDialog::m_b2 [private]
 

Definition at line 44 of file MenuDialog.h.

Referenced by MenuDialog(), and OnEvent().

Button MenuDialog::m_b3 [private]
 

Definition at line 45 of file MenuDialog.h.

Referenced by MenuDialog().

Button MenuDialog::m_b4 [private]
 

Definition at line 46 of file MenuDialog.h.

Referenced by MenuDialog(), and OnEvent().


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