Leaked source code of windows server 2003
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.

158 lines
4.3 KiB

  1. #include "precomp.h"
  2. #include "resource.h"
  3. #include "global.h"
  4. #include "PropPg.h"
  5. #include "SetSht.h"
  6. #include "dslist.h"
  7. #include "Confirm.h"
  8. #include "nmakreg.h"
  9. #include "nmakwiz.h"
  10. ////////////////////////////////////////////////////////////////////////////////////////////////////
  11. // Static member vars
  12. CConfirmationSheet* CConfirmationSheet::ms_pConfirmationSheet = NULL;
  13. ////////////////////////////////////////////////////////////////////////////////////////////////////
  14. // Static member fns
  15. INT_PTR CALLBACK CConfirmationSheet::DlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) {
  16. switch( message )
  17. {
  18. case WM_INITDIALOG:
  19. {
  20. PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK );
  21. ms_pConfirmationSheet->_CreateFilePane(hDlg);
  22. return TRUE;
  23. break;
  24. }
  25. case WM_NOTIFY:
  26. {
  27. switch( reinterpret_cast< NMHDR FAR* >( lParam )->code )
  28. {
  29. case PSN_QUERYCANCEL:
  30. SetWindowLong( hDlg, DWL_MSGRESULT, !VerifyExitMessageBox());
  31. return TRUE;
  32. case PSN_SETACTIVE:
  33. g_hwndActive = hDlg;
  34. ms_pConfirmationSheet->_FillListBox( );
  35. PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK );
  36. ms_pConfirmationSheet->m_pFilePane->Validate(FALSE);
  37. return TRUE;
  38. case PSN_WIZBACK:
  39. if( !ms_pConfirmationSheet->m_pFilePane->Validate( TRUE ) )
  40. {
  41. SetWindowLong( hDlg, DWL_MSGRESULT, -1 );
  42. return TRUE;
  43. }
  44. break;
  45. case PSN_WIZNEXT:
  46. if( !ms_pConfirmationSheet->m_pFilePane->Validate( TRUE ) )
  47. {
  48. SetWindowLong( hDlg, DWL_MSGRESULT, -1 );
  49. return TRUE;
  50. }
  51. break;
  52. }
  53. break;
  54. }
  55. default:
  56. break;
  57. }
  58. return FALSE;
  59. }
  60. ////////////////////////////////////////////////////////////////////////////////////////////////////
  61. // Member fns
  62. CConfirmationSheet::CConfirmationSheet() :
  63. m_PropertySheetPage( MAKEINTRESOURCE( IDD_PROPPAGE_DEFAULT ),
  64. CConfirmationSheet::DlgProc /*,
  65. PSP_HASHELP */
  66. ),
  67. m_uIndex( 0 ),
  68. m_pFilePane( NULL )
  69. {
  70. ms_pConfirmationSheet = this;
  71. }
  72. CConfirmationSheet::~CConfirmationSheet( void )
  73. {
  74. delete m_pFilePane;
  75. m_pFilePane = NULL;
  76. ms_pConfirmationSheet = NULL;
  77. }
  78. void CConfirmationSheet::_FillListBox(void)
  79. {
  80. HWND hwndList = GetDlgItem( m_pFilePane->GetHwnd(), IDC_LIST_SETTINGS );
  81. ListBox_ResetContent( hwndList );
  82. int iLine = 0;
  83. iLine = g_pWiz->m_SettingsSheet.SpewToListBox( hwndList, iLine );
  84. iLine = g_pWiz->m_CallModeSheet.SpewToListBox( hwndList, iLine );
  85. // Note - 500 is just a large and arbitrary value
  86. ListBox_SetHorizontalExtent( hwndList, 500 );
  87. }
  88. void CConfirmationSheet::_CreateFilePane(HWND hDlg)
  89. {
  90. RECT rect;
  91. GetClientRect(hDlg, &rect );
  92. int iHeight = rect.bottom - rect.top;
  93. int iWidth = rect.right - CPropertyDataWindow2::mcs_iLeft;
  94. m_pFilePane = new CFilePanePropWnd2(hDlg,
  95. IDD_FILEPANE_SUMMARY,
  96. TEXT("IDD_FILEPANE_SUMMARY"),
  97. 0,
  98. CPropertyDataWindow2::mcs_iLeft,
  99. CPropertyDataWindow2::mcs_iTop,
  100. iWidth,
  101. iHeight );
  102. assert( m_pFilePane );
  103. HWND hwndCond = GetDlgItem( m_pFilePane->GetHwnd(), IDC_CREATE_CONFIGURATION_SUMMARY_FILE );
  104. m_pFilePane->ConnectControlsToCheck( IDC_CREATE_CONFIGURATION_SUMMARY_FILE, 2,
  105. new CControlID( hwndCond,
  106. IDC_CREATE_CONFIGURATION_SUMMARY_FILE,
  107. IDC_CONFIGURATION_SUMMARY_PATH,
  108. CControlID::EDIT ),
  109. new CControlID( hwndCond,
  110. IDC_CREATE_CONFIGURATION_SUMMARY_FILE,
  111. IDC_BROWSE_CONFIGURATION_SUMMARY,
  112. // Note this is not a check but I don't think I care
  113. CControlID::CHECK ) );
  114. m_pFilePane->SetFilePane( FALSE, IDC_CONFIGURATION_SUMMARY_PATH,
  115. IDC_CREATE_CONFIGURATION_SUMMARY_FILE,
  116. IDC_BROWSE_CONFIGURATION_SUMMARY,
  117. TEXT( "Text File (*.txt)" ),
  118. TEXT( ".txt" ),
  119. TEXT( "Summary.txt" ));
  120. m_pFilePane->ShowWindow( TRUE );
  121. m_pFilePane->SetCheck(IDC_CREATE_CONFIGURATION_SUMMARY_FILE, TRUE);
  122. if (g_pWiz->m_IntroSheet.GetFilePane()->OptionEnabled())
  123. {
  124. m_pFilePane->ReadSettings();
  125. }
  126. }