Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Public Attributes | Protected Member Functions
CPromptDialog Class Reference

#include <Dialogs.h>

Collaboration diagram for CPromptDialog:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { IDD = IDD_PROMPT_DIALOG }
enum  { IDD = IDD_PROMPT_DIALOG }

Public Member Functions

 CPromptDialog (CWnd *pParent, const char *pTitle, const char *pText, const char *pInitPromptText, BOOL bHasCheck, const char *pCheckText, int initCheckVal)
 CPromptDialog (CWnd *pParent, const TCHAR *pTitle, const TCHAR *pText, const TCHAR *pInitPromptText, BOOL bHasCheck, const TCHAR *pCheckText, int initCheckVal)

Public Attributes

CString m_csPromptAnswer
CString m_csDialogTitle
CString m_csPromptText
BOOL m_bHasCheckBox
CString m_csCheckBoxText
int m_bCheckBoxValue

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)
virtual BOOL OnInitDialog ()
virtual void DoDataExchange (CDataExchange *pDX)
virtual BOOL OnInitDialog ()

Detailed Description

Definition at line 44 of file Dialogs.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
IDD 

Definition at line 52 of file Dialogs.h.

anonymous enum
Enumerator:
IDD 

Definition at line 45 of file Dialogs.h.


Constructor & Destructor Documentation

CPromptDialog::CPromptDialog ( CWnd *  pParent,
const char *  pTitle,
const char *  pText,
const char *  pInitPromptText,
BOOL  bHasCheck,
const char *  pCheckText,
int  initCheckVal 
)

Definition at line 52 of file Dialogs.cpp.

    : CDialog(CPromptDialog::IDD, pParent),
    m_bHasCheckBox(bHasCheck)
{   
    if(pTitle)
        m_csDialogTitle = pTitle;
    if(pText)
        m_csPromptText = pText;
    if(pInitPromptText)
        m_csPromptAnswer = pInitPromptText;
    if(pCheckText)
        m_csCheckBoxText = pCheckText; 
}
CPromptDialog::CPromptDialog ( CWnd *  pParent,
const TCHAR pTitle,
const TCHAR pText,
const TCHAR pInitPromptText,
BOOL  bHasCheck,
const TCHAR pCheckText,
int  initCheckVal 
)

Definition at line 45 of file Dialogs.cpp.

    : CDialog(CPromptDialog::IDD, pParent),
    m_bHasCheckBox(bHasCheck)
{   
    if(pTitle)
        m_csDialogTitle = pTitle;
    if(pText)
        m_csPromptText = pText;
    if(pInitPromptText)
        m_csPromptAnswer = pInitPromptText;
    if(pCheckText)
        m_csCheckBoxText = pCheckText; 
}

Member Function Documentation

virtual void CPromptDialog::DoDataExchange ( CDataExchange *  pDX) [protected, virtual]
void CPromptDialog::DoDataExchange ( CDataExchange *  pDX) [protected, virtual]

Definition at line 68 of file Dialogs.cpp.

{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CPromptDialog)
    DDX_Text(pDX, IDC_PROMPT_ANSWER, m_csPromptAnswer);
    DDX_Check(pDX, IDC_CHECK_SAVE_PASSWORD, m_bCheckBoxValue);
    //}}AFX_DATA_MAP
}
virtual BOOL CPromptDialog::OnInitDialog ( ) [protected, virtual]
int CPromptDialog::OnInitDialog ( ) [protected, virtual]

Definition at line 83 of file Dialogs.cpp.

{   
    SetWindowText(m_csDialogTitle);
  
    CWnd *pWnd = GetDlgItem(IDC_PROMPT_TEXT);
    if(pWnd)
        pWnd->SetWindowText(m_csPromptText);

    CButton *pChk = (CButton *)GetDlgItem(IDC_CHECK_SAVE_PASSWORD);
    if(pChk)
    {
        if (m_bHasCheckBox)
        {
            if(!m_csCheckBoxText.IsEmpty())
                pChk->SetWindowText(m_csCheckBoxText);
            pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
        }
        else
        {
            // Hide the check box control if there's no label text
            // This will be the case when we're not using single sign-on
            pChk->ShowWindow(SW_HIDE); 
        }
    }

    CEdit *pEdit = (CEdit *)GetDlgItem(IDC_PROMPT_ANSWER);
    if(pEdit) 
    {
        pEdit->SetWindowText(m_csPromptAnswer);
        pEdit->SetFocus();
        pEdit->SetSel(0, -1);

        return 0; // Returning "0" since we're explicitly setting focus
    }

    return TRUE;
}

Member Data Documentation

Definition at line 59 of file Dialogs.h.

Definition at line 57 of file Dialogs.h.

Definition at line 58 of file Dialogs.h.

Definition at line 55 of file Dialogs.h.

Definition at line 53 of file Dialogs.h.

Definition at line 56 of file Dialogs.h.


The documentation for this class was generated from the following files: