Bug 454376 add -lCrun -lCstd for Solaris OS_LIBS, r=bsmedberg
[wine-gecko.git] / embedding / qa / testembed / Dialogs.cpp
blob0e2edef04b88b5be44eb25369efc4cd62a82c96b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Chak Nanga <chak@netscape.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #include "stdafx.h"
40 #include "Dialogs.h"
41 #include "BrowserView.h"
43 // File overview....
45 // contains Find dialog box code
48 //--------------------------------------------------------------------------//
49 // CFindDialog Stuff
50 //--------------------------------------------------------------------------//
52 CFindDialog::CFindDialog(CString& csSearchStr, PRBool bMatchCase,
53 PRBool bMatchWholeWord, PRBool bWrapAround,
54 PRBool bSearchBackwards, CBrowserView* pOwner)
55 : CFindReplaceDialog()
57 // Save these initial settings off in member vars
58 // We'll use these to initialize the controls
59 // in InitDialog()
60 m_csSearchStr = csSearchStr;
61 m_bMatchCase = bMatchCase;
62 m_bMatchWholeWord = bMatchWholeWord;
63 m_bWrapAround = bWrapAround;
64 m_bSearchBackwards = bSearchBackwards;
65 m_pOwner = pOwner;
67 // Set up to load our customized Find dialog template
68 // rather than the default one MFC provides
69 m_fr.Flags |= FR_ENABLETEMPLATE;
70 m_fr.hInstance = AfxGetInstanceHandle();
71 m_fr.lpTemplateName = MAKEINTRESOURCE(IDD_FINDDLG);
74 BOOL CFindDialog::OnInitDialog()
76 CFindReplaceDialog::OnInitDialog();
78 CEdit* pEdit = (CEdit *)GetDlgItem(IDC_FIND_EDIT);
79 if(pEdit)
80 pEdit->SetWindowText(m_csSearchStr);
82 CButton* pChk = (CButton *)GetDlgItem(IDC_MATCH_CASE);
83 if(pChk)
84 pChk->SetCheck(m_bMatchCase);
86 pChk = (CButton *)GetDlgItem(IDC_MATCH_WHOLE_WORD);
87 if(pChk)
88 pChk->SetCheck(m_bMatchWholeWord);
90 pChk = (CButton *)GetDlgItem(IDC_WRAP_AROUND);
91 if(pChk)
92 pChk->SetCheck(m_bWrapAround);
94 pChk = (CButton *)GetDlgItem(IDC_SEARCH_BACKWARDS);
95 if(pChk)
96 pChk->SetCheck(m_bSearchBackwards);
98 return TRUE;
101 void CFindDialog::PostNcDestroy()
103 // Let the owner know we're gone
104 if(m_pOwner != NULL)
105 m_pOwner->ClearFindDialog();
107 CFindReplaceDialog::PostNcDestroy();
110 BOOL CFindDialog::WrapAround()
112 CButton* pChk = (CButton *)GetDlgItem(IDC_WRAP_AROUND);
114 return pChk ? pChk->GetCheck() : FALSE;
117 BOOL CFindDialog::SearchBackwards()
119 CButton* pChk = (CButton *)GetDlgItem(IDC_SEARCH_BACKWARDS);
121 return pChk ? pChk->GetCheck() : FALSE;