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.

105 lines
3.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // OPTView2D.cpp : implementation file
  9. //
  10. #include "stdafx.h"
  11. #include "hammer.h"
  12. #include "OPTView2D.h"
  13. #include "Options.h"
  14. // memdbgon must be the last include file in a .cpp file!!!
  15. #include <tier0/memdbgon.h>
  16. /////////////////////////////////////////////////////////////////////////////
  17. // COPTView2D property page
  18. IMPLEMENT_DYNCREATE(COPTView2D, CPropertyPage)
  19. COPTView2D::COPTView2D() : CPropertyPage(COPTView2D::IDD)
  20. {
  21. //{{AFX_DATA_INIT(COPTView2D)
  22. //}}AFX_DATA_INIT
  23. }
  24. COPTView2D::~COPTView2D()
  25. {
  26. }
  27. void COPTView2D::DoDataExchange(CDataExchange* pDX)
  28. {
  29. CPropertyPage::DoDataExchange(pDX);
  30. //{{AFX_DATA_MAP(COPTView2D)
  31. DDX_Control(pDX, IDC_GRIDINTENSITY, m_cGridIntensity);
  32. //}}AFX_DATA_MAP
  33. m_cGridIntensity.SetRange(10, 100, TRUE);
  34. DDX_Check(pDX, IDC_CROSSHAIRS, Options.view2d.bCrosshairs);
  35. DDX_Check(pDX, IDC_GROUPCARVE, Options.view2d.bGroupCarve);
  36. DDX_Check(pDX, IDC_ROTATECONSTRAIN, Options.view2d.bRotateConstrain);
  37. DDX_Check(pDX, IDC_SCROLLBARS, Options.view2d.bScrollbars);
  38. DDX_Check(pDX, IDC_DRAWVERTICES, Options.view2d.bDrawVertices);
  39. DDX_Check(pDX, IDC_DRAWMODELSIN2D, Options.view2d.bDrawModels);
  40. DDX_Check(pDX, IDC_WHITEONBLACK, Options.view2d.bWhiteOnBlack);
  41. DDX_Check(pDX, IDC_GRIDHIGH10, Options.view2d.bGridHigh10);
  42. DDX_Check(pDX, IDC_HIDESMALLGRID, Options.view2d.bHideSmallGrid);
  43. DDX_Check(pDX, IDC_ORIENTPRIMITIVES, Options.view2d.bOrientPrimitives);
  44. DDX_Check(pDX, IDC_NUDGE, Options.view2d.bNudge);
  45. DDX_Check(pDX, IDC_AUTOSELECT, Options.view2d.bAutoSelect);
  46. DDX_Check(pDX, IDC_SELECTBYHANDLES, Options.view2d.bSelectbyhandles);
  47. DDX_Check(pDX, IDC_KEEPCLONEGROUP, Options.view2d.bKeepclonegroup);
  48. DDX_Check(pDX, IDC_GRIDHIGH64, Options.view2d.bGridHigh64);
  49. DDX_Check(pDX, IDC_GRIDHIGH1024, Options.view2d.bGridHigh1024);
  50. DDX_Check(pDX, IDC_CENTERONCAMERA, Options.view2d.bCenteroncamera);
  51. DDX_Check(pDX, IDC_USEGROUPCOLORS, Options.view2d.bUsegroupcolors);
  52. DDX_Check(pDX, IDC_GRIDDOTS, Options.view2d.bGridDots);
  53. DDX_Text(pDX, IDC_GRIDHIGHSPEC, Options.view2d.iGridHighSpec);
  54. CString strTemp;
  55. strTemp.Format("%d", Options.view2d.iDefaultGrid);
  56. DDX_CBString(pDX, IDC_GRID, strTemp);
  57. if(pDX->m_bSaveAndValidate) // converting back
  58. {
  59. Options.view2d.iDefaultGrid = atoi(strTemp);
  60. Options.view2d.iGridIntensity = m_cGridIntensity.GetPos();
  61. }
  62. else
  63. {
  64. m_cGridIntensity.SetPos(Options.view2d.iGridIntensity);
  65. }
  66. }
  67. BEGIN_MESSAGE_MAP(COPTView2D, CPropertyPage)
  68. //{{AFX_MSG_MAP(COPTView2D)
  69. //}}AFX_MSG_MAP
  70. END_MESSAGE_MAP()
  71. /////////////////////////////////////////////////////////////////////////////
  72. // COPTView2D message handlers
  73. BOOL COPTView2D::OnInitDialog()
  74. {
  75. CWnd *pwnd = GetDlgItem(IDC_GRIDHIGH1024);
  76. if (pwnd != NULL)
  77. {
  78. pwnd->EnableWindow(FALSE);
  79. pwnd->ShowWindow(SW_HIDE);
  80. }
  81. CPropertyPage::OnInitDialog();
  82. return TRUE;
  83. }
  84. BOOL COPTView2D::OnApply()
  85. {
  86. Options.PerformChanges(COptions::secView2D);
  87. return CPropertyPage::OnApply();
  88. }