SearchDlg.cpp
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:5k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // SearchDlg.cpp : implementation file
  2. //
  3. // This file is a part of the XTREME TOOLKIT PRO MFC class library.
  4. // (c)1998-2008 Codejock Software, All Rights Reserved.
  5. //
  6. // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
  7. // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
  8. // CONSENT OF CODEJOCK SOFTWARE.
  9. //
  10. // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
  11. // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
  12. // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
  13. // SINGLE COMPUTER.
  14. //
  15. // CONTACT INFORMATION:
  16. // support@codejock.com
  17. // http://www.codejock.com
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. #include "stdafx.h"
  21. #include "taskpanel.h"
  22. #include "SearchDlg.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CSearchDlg dialog
  30. CSearchDlg::CSearchDlg(CWnd* pParent /*=NULL*/)
  31. : CDialog(CSearchDlg::IDD, pParent)
  32. {
  33. //{{AFX_DATA_INIT(CSearchDlg)
  34. // NOTE: the ClassWizard will add member initialization here
  35. //}}AFX_DATA_INIT
  36. }
  37. void CSearchDlg::DoDataExchange(CDataExchange* pDX)
  38. {
  39. CDialog::DoDataExchange(pDX);
  40. //{{AFX_DATA_MAP(CSearchDlg)
  41. // NOTE: the ClassWizard will add DDX and DDV calls here
  42. //}}AFX_DATA_MAP
  43. }
  44. BEGIN_MESSAGE_MAP(CSearchDlg, CDialog)
  45. //{{AFX_MSG_MAP(CSearchDlg)
  46. //}}AFX_MSG_MAP
  47. END_MESSAGE_MAP()
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CSearchDlg message handlers
  50. BOOL CSearchDlg::OnInitDialog()
  51. {
  52. CDialog::OnInitDialog();
  53. CXTPClientRect rc(this);
  54. rc.right = 260;
  55. m_wndTaskPanel.Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_TABSTOP, rc, this, 0);
  56. m_wndTaskPanel.SetTheme(xtpTaskPanelThemeNativeWinXPPlain);
  57. m_wndTaskPanel.NavigateItems(TRUE);
  58. CXTPTaskPanelGroup* pGroup = m_wndTaskPanel.AddGroup(0);
  59. pGroup->SetCaption(_T("Search by any or all of the criteria below."));
  60. pGroup->AddTextItem(_T("All or part of the file name:"));
  61. m_edtFileName.CreateEx(WS_EX_CLIENTEDGE, _T("Edit"), NULL, WS_CHILD|WS_VISIBLE, CRect(0, 0, 0, 20), &m_wndTaskPanel, 0);
  62. m_edtFileName.SetFont(XTPPaintManager()->GetRegularFont());
  63. pGroup->AddControlItem(m_edtFileName);
  64. pGroup->AddTextItem(_T("A word or phrase in the file:"));
  65. m_edtContains.CreateEx(WS_EX_CLIENTEDGE, _T("Edit"), NULL, WS_CHILD|WS_VISIBLE, CRect(0, 0, 0, 20), &m_wndTaskPanel, 0);
  66. m_edtContains.SetFont(XTPPaintManager()->GetRegularFont());
  67. pGroup->AddControlItem(m_edtContains);
  68. pGroup->AddTextItem(_T("Look in:"));
  69. m_cboLookIn.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|CBS_DROPDOWN, CRect(0, 0, 0, 60), &m_wndTaskPanel, 0);
  70. m_cboLookIn.SetFont(XTPPaintManager()->GetRegularFont());
  71. m_cboLookIn.AddString(_T("C:\"));
  72. m_cboLookIn.AddString(_T("X:\"));
  73. pGroup->AddControlItem(m_cboLookIn);
  74. pGroup->SetExpandable(FALSE);
  75. pGroup = m_wndTaskPanel.AddGroup(0);
  76. pGroup->SetCaption(_T("When was it modified?"));
  77. m_dlgModified.Create(IDD_DIALOG_SEARCH_MODIFIED, &m_wndTaskPanel);
  78. CXTPTaskPanelGroupItem* pItem = pGroup->AddControlItem(m_dlgModified);
  79. pItem->GetMargins().SetRect(0, 0, 0, 0);
  80. m_dlgModified.SetItem(pItem);
  81. pGroup->SetExpanded(FALSE);
  82. m_dlgModified.CheckRadioButton(IDC_RADIO1, IDC_RADIO5, IDC_RADIO1);
  83. pGroup = m_wndTaskPanel.AddGroup(0);
  84. pGroup->SetCaption(_T("What size is it?"));
  85. m_dlgSize.Create(IDD_DIALOG_SEARCH_SIZE, &m_wndTaskPanel);
  86. pItem = pGroup->AddControlItem(m_dlgSize);
  87. pItem->GetMargins().SetRect(0, 0, 0, 0);
  88. m_dlgSize.SetItem(pItem);
  89. m_dlgSize.CheckRadioButton(IDC_RADIO1, IDC_RADIO5, IDC_RADIO1);
  90. pGroup->SetExpanded(FALSE);
  91. pGroup = m_wndTaskPanel.AddGroup(0);
  92. pGroup->SetCaption(_T("More advanced options"));
  93. pGroup->AddTextItem(_T("Add controls to the Advanced panel here..."));
  94. pGroup->SetExpanded(FALSE);
  95. pGroup = m_wndTaskPanel.AddGroup(0);
  96. pGroup->SetExpandable(FALSE);
  97. pItem = pGroup->AddLinkItem(0);
  98. pItem->SetCaption(_T("Other search options"));
  99. pItem = pGroup->AddLinkItem(0);
  100. pItem->SetCaption(_T("Change preferences"));
  101. m_dlgStart.Create(IDD_DIALOG_SEARCH_START, &m_wndTaskPanel);
  102. pItem = pGroup->AddControlItem(m_dlgStart);
  103. pItem->GetMargins().SetRect(0, 0, 0, 0);
  104. m_dlgStart.SetItem(pItem);
  105. m_wndTaskPanel.Reposition(FALSE);
  106. return TRUE;  // return TRUE unless you set the focus to a control
  107.               // EXCEPTION: OCX Property Pages should return FALSE
  108. }