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.

79 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "resource.h"
  8. #include "InputProperties.h"
  9. #include "ChoreoView.h"
  10. #include "choreoactor.h"
  11. #include "mdlviewer.h"
  12. static CInputParams g_Params;
  13. //-----------------------------------------------------------------------------
  14. // Purpose:
  15. // Input : hwndDlg -
  16. // uMsg -
  17. // wParam -
  18. // lParam -
  19. // Output : static BOOL CALLBACK
  20. //-----------------------------------------------------------------------------
  21. static BOOL CALLBACK InputPropertiesDialogProc( 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_INPUTSTRING, g_Params.m_szInputText );
  32. SetDlgItemText( hwndDlg, IDC_STATIC_PROMPT, g_Params.m_szPrompt );
  33. SetWindowText( hwndDlg, g_Params.m_szDialogTitle );
  34. SetFocus( GetDlgItem( hwndDlg, IDC_INPUTSTRING ) );
  35. SendMessage( GetDlgItem( hwndDlg, IDC_INPUTSTRING ), EM_SETSEL, 0, MAKELONG(0, 0xffff) );
  36. }
  37. return FALSE;
  38. case WM_COMMAND:
  39. switch (LOWORD(wParam))
  40. {
  41. case IDOK:
  42. g_Params.m_szInputText[ 0 ] = 0;
  43. GetDlgItemText( hwndDlg, IDC_INPUTSTRING, g_Params.m_szInputText, sizeof( g_Params.m_szInputText ) );
  44. EndDialog( hwndDlg, 1 );
  45. break;
  46. case IDCANCEL:
  47. EndDialog( hwndDlg, 0 );
  48. break;
  49. }
  50. return TRUE;
  51. }
  52. return FALSE;
  53. }
  54. //-----------------------------------------------------------------------------
  55. // Purpose:
  56. // Input : *view -
  57. // *actor -
  58. // Output : int
  59. //-----------------------------------------------------------------------------
  60. int InputProperties( CInputParams *params )
  61. {
  62. g_Params = *params;
  63. int retval = DialogBox( (HINSTANCE)GetModuleHandle( 0 ),
  64. MAKEINTRESOURCE( IDD_INPUTDIALOG ),
  65. (HWND)g_MDLViewer->getHandle(),
  66. (DLGPROC)InputPropertiesDialogProc );
  67. *params = g_Params;
  68. return retval;
  69. }