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.

82 lines
2.2 KiB

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