/*==DIALOGS.CPP=======================================================*/ /* */ /* Module : DIALOGS */ /* */ /* Project : ENTERVU */ /* */ /* Description: About dialog box with copyright notice */ /* Client dialog box with user name and host name */ /* Server dialog box with finger message */ /* */ /*--------------------------------------------------------------------*/ /* */ /* (c) Enter AG, Zrich, 1993 */ /* */ /*--------------------------------------------------------------------*/ /* */ /* Author(s) : Hartwig Thomas */ /* */ /* Started : 25. March 1993 */ /* */ /* Finished : */ /* */ /*--------------------------------------------------------------------*/ /* */ /* Modifications: */ /* */ /* AUTHOR | DATE | COMMENT */ /* ----------------|--------------|-------------------------------- */ /* | | */ /* | | */ /* */ /*====================================================================*/ #ifndef __WINDOWS_H #include #endif #ifndef __OWL_H #include #endif #pragma hdrstop #ifndef __STRING_H #include #endif #ifndef __STATIC_H #include #endif #ifndef FINGER_DEF #include "finger.h" #endif #ifndef DIALOGS_DEF #include "dialogs.h" #endif /*====================================================================*/ /* AboutDlg class is for filling about box with version, author and */ /* copyright */ /*====================================================================*/ TAboutDlg::TAboutDlg(PTWindowsObject pParent, LPSTR lpDialogName) : TDialog(pParent, lpDialogName) { // allocate version string and copy it pVersionStatic = new TStatic(this,IDC_AVERSION,strlen(VERSION)+1); pVersionStatic->EnableTransfer(); pAuthorStatic = new TStatic(this,IDC_AAUTHOR,strlen(AUTHOR)+1); pAuthorStatic->EnableTransfer(); pCopyrightStatic = new TStatic(this,IDC_ACOPYRIGHT,strlen(COPYRIGHT)+1); pCopyrightStatic->EnableTransfer(); } // TAboutDlg constructor /*--------------------------------------------------------------------*/ TAboutDlg::~TAboutDlg() { // free everything delete pVersionStatic; delete pAuthorStatic; delete pCopyrightStatic; } // Destructor /*--------------------------------------------------------------------*/ void TAboutDlg::SetupWindow() { // call dialog method for creation of dialog and all children TDialog::SetupWindow(); // initialize empty fields pVersionStatic->SetText((LPSTR)VERSION); pAuthorStatic->SetText((LPSTR)AUTHOR); pCopyrightStatic->SetText((LPSTR)COPYRIGHT); } // SetupWindow /*====================================================================*/ /* ClientDlg class is for prompting for user name and for host name */ /*====================================================================*/ TClientDlg::TClientDlg(PTWindowsObject pParent, LPSTR lpDialogName, LPSTR lpUser, LPSTR lpHost) : TDialog(pParent, lpDialogName) { // copy parameters lpUserName = lpUser; lpHostName = lpHost; // make edit controls pUserNameEdit = new TEdit(this, IDC_CUSERNAME, STRSIZELONG); pHostNameEdit = new TEdit(this, IDC_CHOSTNAME, STRSIZELONG); } // constructor TClientDlg /*--------------------------------------------------------------------*/ TClientDlg::~TClientDlg() { // clean up edit controls delete pUserNameEdit; delete pHostNameEdit; } // destructor ~TClientDlg /*--------------------------------------------------------------------*/ void TClientDlg::SetupWindow() { // call dialog method for creation of dialog and all children TDialog::SetupWindow(); // set texts in edit controls pUserNameEdit->SetText(lpUserName); pHostNameEdit->SetText(lpHostName); } // SetupWindow /*--------------------------------------------------------------------*/ void TClientDlg::Ok(RTMessage Msg) { // get texts from edit controls pUserNameEdit->GetText(lpUserName,STRSIZELONG); pHostNameEdit->GetText(lpHostName,STRSIZELONG); // terminate gracefully TDialog::Ok(Msg); } // Ok /*====================================================================*/ /* ServerDlg class is for prompting for finger message */ /*====================================================================*/ TServerDlg::TServerDlg(PTWindowsObject pParent, LPSTR lpDialogName, LPSTR lpMsg) : TDialog(pParent, lpDialogName) { // copy parameters lpMessage = lpMsg; // make edit control pMessageEdit = new TEdit(this, IDC_SFINGERMSG, STRSIZELONG); } // constructor TServerDlg /*--------------------------------------------------------------------*/ TServerDlg::~TServerDlg() { // clean up edit control delete pMessageEdit; } // destructor ~TServerDlg /*--------------------------------------------------------------------*/ void TServerDlg::SetupWindow() { // call dialog method for creation of dialog and all children TDialog::SetupWindow(); // set the initial text pMessageEdit->SetText(lpMessage); } // SetupWindow /*--------------------------------------------------------------------*/ void TServerDlg::Ok(RTMessage Msg) { // get the text from the edit control pMessageEdit->GetText(lpMessage,STRSIZELONG); // terminate gracefully TDialog::Ok(Msg); } // Ok /*-End of DIALOGS.CPP-------------------------------------------------*/