Back to index

lightning-sunbird  0.9+nobinonly
WebProgDlg.cpp
Go to the documentation of this file.
00001 // WebProgDlg.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "testembed.h"
00006 #include "WebProgDlg.h"
00007 #include "QaUtils.h"
00008 
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014 
00016 // CWebProgDlg dialog
00017 
00018 
00019 CWebProgDlg::CWebProgDlg(CWnd* pParent /*=NULL*/)
00020        : CDialog(CWebProgDlg::IDD, pParent)
00021 {
00022        //{{AFX_DATA_INIT(CWebProgDlg)
00023        m_wpFlagValue = 0;
00024        m_wpFlagIndex = -1;
00025        //}}AFX_DATA_INIT
00026 }
00027 
00028 
00029 void CWebProgDlg::DoDataExchange(CDataExchange* pDX)
00030 {
00031        CDialog::DoDataExchange(pDX);
00032        //{{AFX_DATA_MAP(CWebProgDlg)
00033        DDX_Control(pDX, IDC_WPCOMBO, m_webProgFlags);
00034        DDX_CBIndex(pDX, IDC_WPCOMBO, m_wpFlagIndex);
00035        //}}AFX_DATA_MAP
00036 }
00037 
00038 
00039 BEGIN_MESSAGE_MAP(CWebProgDlg, CDialog)
00040        //{{AFX_MSG_MAP(CWebProgDlg)
00041        ON_CBN_SELCHANGE(IDC_WPCOMBO, OnSelectWPCombo)
00042        //}}AFX_MSG_MAP
00043 END_MESSAGE_MAP()
00044 
00046 // CWebProgDlg message handlers
00047 
00048 BOOL CWebProgDlg::OnInitWPDialog()
00049 {
00050        CDialog::OnInitDialog();
00051 
00052        m_wpFlagIndex = 0;
00053        m_webProgFlags.SetCurSel(m_wpFlagIndex);
00054 
00055        return TRUE;
00056 }
00057 void CWebProgDlg::OnSelectWPCombo()
00058 {
00059        m_wpFlagIndex = m_webProgFlags.GetCurSel();      
00060 
00061        if (m_wpFlagIndex == 0) {
00062               m_wpFlagValue = nsIWebProgress::NOTIFY_STATE_REQUEST;
00063               QAOutput("Selected NOTIFY_STATE_REQUEST flag.", 1);
00064        }
00065        else if (m_wpFlagIndex == 1) {
00066               m_wpFlagValue = nsIWebProgress::NOTIFY_STATE_DOCUMENT;
00067               QAOutput("Selected NOTIFY_STATE_DOCUMENT flag.", 1);
00068        }
00069        else if (m_wpFlagIndex == 2) {
00070               m_wpFlagValue = nsIWebProgress::NOTIFY_STATE_NETWORK;
00071               QAOutput("Selected NOTIFY_STATE_NETWORK flag.", 1);
00072        }
00073        else if (m_wpFlagIndex == 3) {
00074               m_wpFlagValue = nsIWebProgress::NOTIFY_STATE_WINDOW;
00075               QAOutput("Selected NOTIFY_STATE_WINDOW flag.", 1);
00076        }
00077        else if (m_wpFlagIndex == 4) {
00078               m_wpFlagValue = nsIWebProgress::NOTIFY_STATE_ALL;
00079               QAOutput("Selected NOTIFY_STATE_ALL flag.", 1);
00080        }
00081        else if (m_wpFlagIndex == 5) {
00082               m_wpFlagValue = nsIWebProgress::NOTIFY_PROGRESS;
00083               QAOutput("Selected NOTIFY_PROGRESS flag.", 1);
00084        }
00085        else if (m_wpFlagIndex == 6) {
00086               m_wpFlagValue = nsIWebProgress::NOTIFY_STATUS;
00087               QAOutput("Selected NOTIFY_STATUS flag.", 1);
00088        }
00089        else if (m_wpFlagIndex == 7) {
00090               m_wpFlagValue = nsIWebProgress::NOTIFY_SECURITY;
00091               QAOutput("Selected NOTIFY_SECURITY flag.", 1);
00092        }
00093        else if (m_wpFlagIndex == 8) {
00094               m_wpFlagValue = nsIWebProgress::NOTIFY_LOCATION;
00095               QAOutput("Selected NOTIFY_LOCATION flag.", 1);
00096        }
00097        else if (m_wpFlagIndex == 9) {
00098               m_wpFlagValue = nsIWebProgress::NOTIFY_ALL;
00099               QAOutput("Selected NOTIFY_ALL flag.", 1);
00100        }
00101        else
00102               QAOutput("NO FLAG!!!.", 1);
00103 }