Team Fortress 2 Source Code as on 22/4/2020
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.

77 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include <mxtk/mx.h>
  8. #include "resource.h"
  9. #include "ExpressionProperties.h"
  10. #include "mdlviewer.h"
  11. static CExpressionParams g_Params;
  12. //-----------------------------------------------------------------------------
  13. // Purpose:
  14. // Input : hwndDlg -
  15. // uMsg -
  16. // wParam -
  17. // lParam -
  18. // Output : static BOOL CALLBACK ExpressionPropertiesDialogProc
  19. //-----------------------------------------------------------------------------
  20. static BOOL CALLBACK ExpressionPropertiesDialogProc ( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
  21. {
  22. switch(uMsg)
  23. {
  24. case WM_INITDIALOG:
  25. {
  26. // Insert code here to put the string (to find and replace with)
  27. // into the edit controls.
  28. // ...
  29. g_Params.PositionSelf( hwndDlg );
  30. SetDlgItemText( hwndDlg, IDC_EXPRESSIONNAME, g_Params.m_szName );
  31. SetDlgItemText( hwndDlg, IDC_EXPRESSIONDESC, g_Params.m_szDescription );
  32. SetWindowText( hwndDlg, g_Params.m_szDialogTitle );
  33. SetFocus( GetDlgItem( hwndDlg, IDC_EXPRESSIONNAME ) );
  34. }
  35. return FALSE;
  36. case WM_COMMAND:
  37. switch (LOWORD(wParam))
  38. {
  39. case IDOK:
  40. g_Params.m_szName[ 0 ] = 0;
  41. GetDlgItemText( hwndDlg, IDC_EXPRESSIONNAME, g_Params.m_szName, 256 );
  42. GetDlgItemText( hwndDlg, IDC_EXPRESSIONDESC, g_Params.m_szDescription, 256 );
  43. EndDialog( hwndDlg, 1 );
  44. break;
  45. case IDCANCEL:
  46. EndDialog( hwndDlg, 0 );
  47. break;
  48. }
  49. return TRUE;
  50. }
  51. return FALSE;
  52. }
  53. //-----------------------------------------------------------------------------
  54. // Purpose:
  55. // Input : *view -
  56. // *actor -
  57. // Output : int
  58. //-----------------------------------------------------------------------------
  59. int ExpressionProperties( CExpressionParams *params )
  60. {
  61. g_Params = *params;
  62. int retval = DialogBox( (HINSTANCE)GetModuleHandle( 0 ),
  63. MAKEINTRESOURCE( IDD_EXPRESSIONPROPERTIES ),
  64. (HWND)g_MDLViewer->getHandle(),
  65. (DLGPROC)ExpressionPropertiesDialogProc );
  66. *params = g_Params;
  67. return retval;
  68. }