1 // UrlDialog.cpp : implementation file
12 static char THIS_FILE
[] = __FILE__
;
15 /////////////////////////////////////////////////////////////////////////////
19 CUrlDialog::CUrlDialog(CWnd
* pParent
/*=NULL*/)
20 : CDialog(CUrlDialog::IDD
, pParent
)
22 //{{AFX_DATA_INIT(CUrlDialog)
31 void CUrlDialog::DoDataExchange(CDataExchange
* pDX
)
33 CDialog::DoDataExchange(pDX
);
34 //{{AFX_DATA_MAP(CUrlDialog)
35 DDX_Control(pDX
, IDC_CHKURLFLAG
, m_chkFlags
);
36 DDX_Control(pDX
, IDC_COMBO1
, m_urlflags
);
37 DDX_Text(pDX
, IDC_URLFIELD
, m_urlfield
);
38 DDX_CBIndex(pDX
, IDC_COMBO1
, m_flagIndex
);
39 DDX_Check(pDX
, IDC_CHKURLFLAG
, m_chkValue
);
40 DDX_Control(pDX
, IDC_COMBO2
, m_protocol
);
45 BEGIN_MESSAGE_MAP(CUrlDialog
, CDialog
)
46 //{{AFX_MSG_MAP(CUrlDialog)
47 ON_EN_CHANGE(IDC_URLFIELD
, OnChangeUrlfield
)
48 ON_BN_CLICKED(IDC_CHKURLFLAG
, OnChkurlflag
)
49 ON_EN_CHANGE(IDC_COMBO1
, OnChangeUrlfield
)
50 ON_CBN_SELCHANGE(IDC_COMBO1
, OnSelchangeCombo1
)
51 ON_CBN_SELCHANGE(IDC_COMBO2
, OnSelchangeCombo2
)
55 /////////////////////////////////////////////////////////////////////////////
56 // CUrlDialog message handlers
58 void CUrlDialog::OnChangeUrlfield()
60 // TODO: If this is a RICHEDIT control, the control will not
61 // send this notification unless you override the CDialog::OnInitDialog()
62 // function and call CRichEditCtrl().SetEventMask()
63 // with the ENM_CHANGE flag ORed into the mask.
65 // TODO: Add your control notification handler code here
69 void CUrlDialog::OnChkurlflag()
71 m_chkValue
= ! m_chkValue
;
72 m_urlflags
.EnableWindow(m_chkValue
);
75 BOOL
CUrlDialog::OnInitDialog()
77 CDialog::OnInitDialog();
80 m_urlflags
.SetCurSel(m_flagIndex
);
81 m_urlflags
.EnableWindow(m_chkValue
);
84 return TRUE
; // return TRUE unless you set the focus to a control
85 // EXCEPTION: OCX Property Pages should return FALSE
88 void CUrlDialog::OnSelchangeCombo1()
91 // m_urlflags.GetLBText(m_flagIndex,flagvalue);
92 m_flagIndex
= m_urlflags
.GetCurSel();
94 // if (flagvalue == "NONE") {
95 if (m_flagIndex
== 0) {
96 QAOutput("Selected NONE flag.", 1);
97 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_NONE
;
99 else if (m_flagIndex
== 1) {
100 QAOutput("Selected MASK flag.", 1);
101 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_MASK
;
103 else if (m_flagIndex
== 2) {
104 QAOutput("Selected IS_LINK flag.", 1);
105 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_IS_LINK
;
107 else if (m_flagIndex
== 3) {
108 QAOutput("Selected BYPASS_HISTORY flag.", 1);
109 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY
;
111 else if (m_flagIndex
== 4) {
112 QAOutput("Selected REPLACE_HISTORY flag.", 1);
113 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY
;
115 else if (m_flagIndex
== 5) {
116 QAOutput("Selected BYPASS_CACHE flag.", 1);
117 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE
;
119 else if (m_flagIndex
== 6) {
120 QAOutput("Selected BYPASS_PROXY flag.", 1);
121 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY
;
123 else if (m_flagIndex
== 7) {
124 QAOutput("Selected CHARSET_CHANGE flag.", 1);
125 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE
;
127 else if (m_flagIndex
== 8) {
128 QAOutput("Selected REFRESH flag.", 1);
129 m_flagvalue
= nsIWebNavigation::LOAD_FLAGS_IS_REFRESH
;
132 QAOutput("NO FLAG!!!.", 1);
135 void CUrlDialog::OnSelchangeCombo2()
137 m_protocolIndex
= m_protocol
.GetCurSel();
139 if (m_protocolIndex
== 0) {
140 QAOutput("Selected http protocol.", 1);
141 m_protocolvalue
= "http";
143 else if (m_protocolIndex
== 1) {
144 QAOutput("Selected https protocol.", 1);
145 m_protocolvalue
= "https";
147 else if (m_protocolIndex
== 2) {
148 QAOutput("Selected ftp protocol.", 1);
149 m_protocolvalue
= "ftp";
151 else if (m_protocolIndex
== 3) {
152 QAOutput("Selected file protocol.", 1);
153 m_protocolvalue
= "file";
155 else if (m_protocolIndex
== 4) {
156 QAOutput("Selected javascript protocol.", 1);
157 m_protocolvalue
= "javascript";
159 else if (m_protocolIndex
== 5) {
160 QAOutput("Selected about protocol.", 1);
161 m_protocolvalue
= "about";
163 else if (m_protocolIndex
== 6) {
164 QAOutput("Selected data protocol.", 1);
165 m_protocolvalue
= "data";
167 else if (m_protocolIndex
== 7) {
168 QAOutput("Selected mailto protocol.", 1);
169 m_protocolvalue
= "mailto";
171 else if (m_protocolIndex
== 8) {
172 QAOutput("Selected imap protocol.", 1);
173 m_protocolvalue
= "imap";
176 QAOutput("NO PROTOCOL SELECTED!!!.", 1);