Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.1 KiB

  1. // MSInfoDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "emshell.h"
  5. #include "MSInfoDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CMSInfoDlg dialog
  13. CMSInfoDlg::CMSInfoDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CMSInfoDlg::IDD, pParent)
  15. {
  16. #ifdef _DEBUG
  17. m_csCategories = _T("/CATEGORIES: +componentsNetadapter+componentsports+componentsstorage+componentsprinting");
  18. #else
  19. m_csCategories = _T("/CATEGORIES: +all");
  20. #endif
  21. m_bShow = false;
  22. //{{AFX_DATA_INIT(CMSInfoDlg)
  23. m_bDlgNoShow = FALSE;
  24. //}}AFX_DATA_INIT
  25. }
  26. void CMSInfoDlg::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CDialog::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CMSInfoDlg)
  30. DDX_Control(pDX, IDC_CHECK_NFODIALOG_NOSHOW, m_ctrlDlgNoShow);
  31. DDX_Control(pDX, IDC_STATIC_DEMARK, m_ctlStaticDemark);
  32. DDX_Text(pDX, IDC_EDIT_CATEGORIES, m_csCategories);
  33. DDX_Check(pDX, IDC_CHECK_NFODIALOG_NOSHOW, m_bDlgNoShow);
  34. //}}AFX_DATA_MAP
  35. }
  36. BEGIN_MESSAGE_MAP(CMSInfoDlg, CDialog)
  37. //{{AFX_MSG_MAP(CMSInfoDlg)
  38. ON_BN_CLICKED(IDC_OPTIONS, OnOptions)
  39. //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CMSInfoDlg message handlers
  43. BOOL CMSInfoDlg::OnInitDialog()
  44. {
  45. CDialog::OnInitDialog();
  46. // TODO: Add extra initialization here
  47. ShowOptions( m_bShow ); // false
  48. return TRUE; // return TRUE unless you set the focus to a control
  49. // EXCEPTION: OCX Property Pages should return FALSE
  50. }
  51. void CMSInfoDlg::OnOptions()
  52. {
  53. // TODO: Add your control notification handler code here
  54. ShowOptions( (m_bShow = !m_bShow) );
  55. }
  56. void CMSInfoDlg::ShowOptions(bool bShow)
  57. {
  58. RECT rtShowDlgCheckBox,
  59. rtDemark,
  60. rtDlg;
  61. (*this).GetWindowRect( &rtDlg );
  62. m_ctrlDlgNoShow.GetWindowRect( &rtShowDlgCheckBox );
  63. m_ctlStaticDemark.GetWindowRect( &rtDemark );
  64. if( bShow ) {
  65. rtDlg.bottom = rtShowDlgCheckBox.bottom + 12;
  66. }
  67. else {
  68. rtDlg.bottom = rtDemark.top;
  69. }
  70. (*this).MoveWindow( &rtDlg );
  71. }