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

LoginDialog Class Reference

#include <LoginDialog.h>

Inheritance diagram for LoginDialog:

Inheritance graph
[legend]
Collaboration diagram for LoginDialog:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LoginDialog (Surface *)
 ~LoginDialog ()
void OnEvent (surface_event_t *)
void Draw ()
void UpdateData (bool dlg2vars=true)

Private Attributes

Static m_st1
Edit m_login
Static m_st2
Edit m_passwd
Button m_ok
Button m_cancel

Constructor & Destructor Documentation

LoginDialog::LoginDialog Surface *   ) 
 

Definition at line 35 of file LoginDialog.cpp.

References LoginDialog(), m_cancel, m_login, m_ok, m_passwd, m_st1, m_st2, and UpdateData().

Referenced by LoginDialog().

00036 :FormSurface(s, 220, 140, 200, 200) 00037 ,m_st1 (this, 5, 5, 150, 25) 00038 ,m_login(this, 5, 35, 150, 25) 00039 ,m_st2 (this, 5, 65, 150, 25) 00040 ,m_passwd(this, 5, 95, 150, 25) 00041 ,m_ok (this, 5, 125, 90, 25) 00042 ,m_cancel(this,105,125, 90, 25) 00043 { 00044 Uint32 bgcolor = SDL_MapRGBA(GetScreen() -> format, 192, 192, 192, 128); 00045 Uint32 txtcolor = SDL_MapRGBA(GetScreen() -> format, 255, 192, 64, 255); 00046 00047 SetText("LoginDialog"); 00048 CreateTemporaryScreen(); 00049 00050 // SetBgColor(bgcolor); 00051 // SetFgColor(txtcolor); 00052 SetMoveable(true); 00053 00054 m_st1.SetText("Login"); 00055 m_st2.SetText("Password"); 00056 m_passwd.SetEcho('*'); 00057 m_ok.SetText("OK"); 00058 m_cancel.SetText("Cancel"); 00059 00060 UpdateData(false); 00061 00062 AddChild(&m_st1); 00063 AddChild(&m_login); 00064 AddChild(&m_st2); 00065 AddChild(&m_passwd); 00066 AddChild(&m_ok); 00067 AddChild(&m_cancel); 00068 }

LoginDialog::~LoginDialog  ) 
 

Definition at line 71 of file LoginDialog.cpp.

00072 { 00073 }


Member Function Documentation

void LoginDialog::Draw  ) 
 

Definition at line 103 of file LoginDialog.cpp.

00104 { 00105 SDL_Rect *area = GetClientRectPtr(); 00106 Uint32 color = GetBgColor(); 00107 00108 SDL_FillRect(m_screen, area, color); 00109 }

void LoginDialog::OnEvent surface_event_t *   ) 
 

Definition at line 76 of file LoginDialog.cpp.

References FormSurface::GetForm(), m_cancel, m_ok, OnEvent(), and UpdateData().

Referenced by OnEvent().

00077 { 00078 if (pstEvent -> type == GUI_EVENT_BUTTON) 00079 { 00080 Login *pclForm = dynamic_cast<Login *>(GetForm()); 00081 if (pstEvent -> local_id == m_ok.GetLocalID()) 00082 { 00083 UpdateData(); 00084 if (pclForm) 00085 { 00086 pclForm -> SetFormDoneOK(); 00087 } 00088 OnClose(); 00089 } 00090 else 00091 if (pstEvent -> local_id == m_cancel.GetLocalID()) 00092 { 00093 if (pclForm) 00094 { 00095 pclForm -> SetFormDoneCancel(); 00096 } 00097 OnClose(); 00098 } 00099 } 00100 }

void LoginDialog::UpdateData bool  dlg2vars = true  ) 
 

Definition at line 112 of file LoginDialog.cpp.

References DEB, FormSurface::GetForm(), m_login, m_passwd, and UpdateData().

Referenced by LoginDialog(), OnEvent(), and UpdateData().

00113 { 00114 if (dlg2vars) 00115 { 00116 Login *pclForm = dynamic_cast<Login *>(GetForm()); 00117 00118 if (pclForm) 00119 { 00120 pclForm -> SetLogin(m_login.GetLine()); 00121 DEB( printf("Login '%s'\n",m_login.GetLine());) 00122 pclForm -> SetPassword(m_passwd.GetLine()); 00123 DEB( printf("Password '%s'\n",m_passwd.GetLine());) 00124 } 00125 else 00126 { 00127 DEB( printf("Not a Login Form???\n");) 00128 } 00129 // Globals::m_login = m_login.GetLine(); 00130 // Globals::m_passwd = atoi(m_passwd.GetLine()); 00131 } 00132 else 00133 { 00134 m_login.SetLine(""); 00135 m_passwd.SetLine(""); 00136 } 00137 }


Member Data Documentation

Button LoginDialog::m_cancel [private]
 

Definition at line 52 of file LoginDialog.h.

Referenced by LoginDialog(), and OnEvent().

Edit LoginDialog::m_login [private]
 

Definition at line 48 of file LoginDialog.h.

Referenced by LoginDialog(), and UpdateData().

Button LoginDialog::m_ok [private]
 

Definition at line 51 of file LoginDialog.h.

Referenced by LoginDialog(), and OnEvent().

Edit LoginDialog::m_passwd [private]
 

Definition at line 50 of file LoginDialog.h.

Referenced by LoginDialog(), and UpdateData().

Static LoginDialog::m_st1 [private]
 

Definition at line 47 of file LoginDialog.h.

Referenced by LoginDialog().

Static LoginDialog::m_st2 [private]
 

Definition at line 49 of file LoginDialog.h.

Referenced by LoginDialog().


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