FenceOptions.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #if !defined(AFX_FenceOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_)
  19. #define AFX_FenceOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // FenceOptions.h : header file
  24. //
  25. #include "TerrainSwatches.h"
  26. #include "OptionsPanel.h"
  27. #include "Common/AsciiString.h"
  28. class WorldHeightMapEdit;
  29. class MapObject;
  30. /////////////////////////////////////////////////////////////////////////////
  31. // FenceOptions dialog
  32. class FenceOptions : public COptionsPanel
  33. {
  34. // Construction
  35. public:
  36. FenceOptions(CWnd* pParent = NULL); ///< standard constructor
  37. ~FenceOptions(void); ///< standard destructor
  38. enum { NAME_MAX_LEN = 64 };
  39. // Dialog Data
  40. //{{AFX_DATA(FenceOptions)
  41. enum { IDD = IDD_FENCE_OPTIONS };
  42. // NOTE: the ClassWizard will add data members here
  43. //}}AFX_DATA
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(FenceOptions)
  47. protected:
  48. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  49. virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
  50. virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
  51. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. protected:
  55. // Generated message map functions
  56. //{{AFX_MSG(FenceOptions)
  57. virtual BOOL OnInitDialog();
  58. afx_msg void OnChangeFenceSpacingEdit();
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. protected:
  62. static FenceOptions *m_staticThis;
  63. static Bool m_updating;
  64. static Int m_currentObjectIndex;
  65. static Real m_fenceSpacing;
  66. static Real m_fenceOffset;
  67. CTreeCtrl m_objectTreeView;
  68. MapObject *m_objectsList;
  69. Bool m_customSpacing;
  70. protected:
  71. void addObject( MapObject *mapObject, const char *pPath, const char *name,
  72. Int objectNdx, HTREEITEM parent );
  73. HTREEITEM findOrAdd(HTREEITEM parent, const char *pLabel);
  74. Bool setObjectTreeViewSelection(HTREEITEM parent, Int selection);
  75. void updateObjectOptions();
  76. public:
  77. static void update(void);
  78. static Bool hasSelectedObject(void);
  79. static Real getFenceSpacing(void) {return m_fenceSpacing;}
  80. static Real getFenceOffset(void) {return m_fenceOffset;}
  81. };
  82. //{{AFX_INSERT_LOCATION}}
  83. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  84. #endif // !defined(AFX_FenceOptions_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)