Counter Strike : Global Offensive Source Code
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.

78 lines
2.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "resource.h"
  8. #include "MessageBoxWithCheckBox.h"
  9. #include "ChoreoView.h"
  10. #include "choreoactor.h"
  11. #include "mdlviewer.h"
  12. static CMessageBoxWithCheckBoxParams g_Params;
  13. //-----------------------------------------------------------------------------
  14. // Purpose:
  15. // MessageBoxWithCheckBox : hwndDlg -
  16. // uMsg -
  17. // wParam -
  18. // lParam -
  19. // Output : static BOOL CALLBACK
  20. //-----------------------------------------------------------------------------
  21. static BOOL CALLBACK MessageBoxWithCheckBoxPropertiesDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
  22. {
  23. switch(uMsg)
  24. {
  25. case WM_INITDIALOG:
  26. // Insert code here to put the string (to find and replace with)
  27. // into the edit controls.
  28. // ...
  29. {
  30. g_Params.PositionSelf( hwndDlg );
  31. SetDlgItemText( hwndDlg, IDC_STATIC_PROMPT, g_Params.m_szPrompt );
  32. SetDlgItemText( hwndDlg, IDC_MESSAGEBOX_CHECKBOX, g_Params.m_szCheckBoxText );
  33. SendMessage( GetDlgItem( hwndDlg, IDC_MESSAGEBOX_CHECKBOX ), BM_SETCHECK, ( WPARAM )g_Params.m_bChecked ? BST_CHECKED : BST_UNCHECKED, (LPARAM)0 );
  34. SetWindowText( hwndDlg, g_Params.m_szDialogTitle );
  35. }
  36. return FALSE;
  37. case WM_COMMAND:
  38. switch (LOWORD(wParam))
  39. {
  40. case IDOK:
  41. {
  42. g_Params.m_bChecked = SendMessage( GetDlgItem( hwndDlg, IDC_MESSAGEBOX_CHECKBOX ), BM_GETCHECK, 0, 0 ) == BST_CHECKED ? true : false;
  43. EndDialog( hwndDlg, 1 );
  44. }
  45. break;
  46. case IDCANCEL:
  47. EndDialog( hwndDlg, 0 );
  48. break;
  49. }
  50. return TRUE;
  51. }
  52. return FALSE;
  53. }
  54. //-----------------------------------------------------------------------------
  55. // Purpose:
  56. // MessageBoxWithCheckBox : *view -
  57. // *actor -
  58. // Output : int
  59. //-----------------------------------------------------------------------------
  60. int MessageBoxWithCheckBox( CMessageBoxWithCheckBoxParams *params )
  61. {
  62. g_Params = *params;
  63. int retval = DialogBox( (HINSTANCE)GetModuleHandle( 0 ),
  64. MAKEINTRESOURCE( IDD_MESSAGEBOX_WITHCHECKBOX ),
  65. (HWND)g_MDLViewer->getHandle(),
  66. (DLGPROC)MessageBoxWithCheckBoxPropertiesDialogProc );
  67. *params = g_Params;
  68. return retval;
  69. }