MeshMoldOptions.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_MESHMOLDOPTIONS_H__D5E62CB9_2830_4FA1_8306_DE18DD971087__INCLUDED_)
  19. #define AFX_MESHMOLDOPTIONS_H__D5E62CB9_2830_4FA1_8306_DE18DD971087__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // MeshMoldOptions.h : header file
  24. //
  25. #include "WBPopupSlider.h"
  26. #include "OptionsPanel.h"
  27. #include "Common/AsciiString.h"
  28. /////////////////////////////////////////////////////////////////////////////
  29. // MeshMoldOptions dialog
  30. class MeshMoldOptions : public COptionsPanel , public PopupSliderOwner
  31. {
  32. // Construction
  33. public:
  34. MeshMoldOptions(CWnd* pParent = NULL); // standard constructor
  35. enum {MIN_ANGLE=-180,
  36. MAX_ANGLE=180,
  37. MIN_HEIGHT=-10,
  38. MAX_HEIGHT=256,
  39. MIN_SCALE=1,
  40. MAX_SCALE=200};
  41. // Dialog Data
  42. //{{AFX_DATA(MeshMoldOptions)
  43. enum { IDD = IDD_MESHMOLD_OPTIONS };
  44. // NOTE: the ClassWizard will add data members here
  45. //}}AFX_DATA
  46. // Overrides
  47. // ClassWizard generated virtual function overrides
  48. //{{AFX_VIRTUAL(MeshMoldOptions)
  49. protected:
  50. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  51. virtual BOOL OnInitDialog();
  52. virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
  53. virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
  54. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  55. //}}AFX_VIRTUAL
  56. // Implementation
  57. protected:
  58. // Generated message map functions
  59. //{{AFX_MSG(MeshMoldOptions)
  60. afx_msg void OnPreview();
  61. afx_msg void OnApplyMesh();
  62. afx_msg void OnChangeScaleEdit();
  63. afx_msg void OnChangeHeightEdit();
  64. afx_msg void OnChangeAngleEdit();
  65. afx_msg void OnRaise();
  66. afx_msg void OnRaiseLower();
  67. afx_msg void OnLower();
  68. //}}AFX_MSG
  69. DECLARE_MESSAGE_MAP()
  70. protected:
  71. WBPopupSliderButton m_anglePopup;
  72. WBPopupSliderButton m_scalePopup;
  73. WBPopupSliderButton m_HeightPopup;
  74. CTreeCtrl m_moldTreeView;
  75. Bool m_updating;
  76. AsciiString m_meshModelName;
  77. static Real m_currentHeight;
  78. static Real m_currentScale;
  79. static Int m_currentAngle;
  80. static Bool m_doingPreview;
  81. static Bool m_raiseOnly;
  82. static Bool m_lowerOnly;
  83. public:
  84. static void setScale(Real scale);
  85. static void setHeight(Real height);
  86. static void setAngle(Int angle);
  87. static Real getHeight(void) {return m_currentHeight;};
  88. static Real getScale(void) {return m_currentScale;};
  89. static Int getAngle(void) {return m_currentAngle;};
  90. static MeshMoldOptions *m_staticThis;
  91. static Bool isDoingPreview(void) {return m_doingPreview;};
  92. static Bool isRaisingOnly(void) {return m_raiseOnly;};
  93. static Bool isLoweringOnly(void) {return m_lowerOnly;};
  94. static AsciiString getModelName(void) {if (m_staticThis) return m_staticThis->m_meshModelName; return "";};
  95. public: //PopupSliderOwner methods.
  96. virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
  97. virtual void PopSliderChanged(const long sliderID, long theVal);
  98. virtual void PopSliderFinished(const long sliderID, long theVal);
  99. };
  100. //{{AFX_INSERT_LOCATION}}
  101. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  102. #endif // !defined(AFX_MESHMOLDOPTIONS_H__D5E62CB9_2830_4FA1_8306_DE18DD971087__INCLUDED_)