FeatherOptions.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_FEATHEROPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)
  19. #define AFX_FEATHEROPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // brushoptions.h : header file
  24. //
  25. #include "WBPopupSlider.h"
  26. #include "OptionsPanel.h"
  27. /////////////////////////////////////////////////////////////////////////////
  28. /// FeatherOptions modeless (floating) dialog - allows entry and display of brush width and feather.
  29. class FeatherOptions : public COptionsPanel , public PopupSliderOwner
  30. {
  31. // Construction
  32. public:
  33. enum {MIN_FEATHER_SIZE=2,
  34. MAX_FEATHER_SIZE=51,
  35. MIN_RATE=1,
  36. MAX_RATE=10,
  37. MIN_RADIUS=1,
  38. MAX_RADIUS=5};
  39. FeatherOptions(CWnd* pParent = NULL); // standard constructor
  40. // Dialog Data
  41. //{{AFX_DATA(FeatherOptions)
  42. enum { IDD = IDD_FEATHER_OPTIONS };
  43. // NOTE: the ClassWizard will add data members here
  44. //}}AFX_DATA
  45. // Overrides
  46. // ClassWizard generated virtual function overrides
  47. //{{AFX_VIRTUAL(FeatherOptions)
  48. protected:
  49. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  50. virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
  51. virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. protected:
  55. // Generated message map functions
  56. //{{AFX_MSG(FeatherOptions)
  57. virtual BOOL OnInitDialog();
  58. afx_msg void OnChangeSizeEdit();
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. protected:
  62. static FeatherOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
  63. static Int m_currentFeather; ///< current brush width in the ui.
  64. static Int m_currentRadius; ///< current smoothing radius value.
  65. static Int m_currentRate; ///< current smoothing rate.
  66. Bool m_updating; ///<true if the ui is updating itself.
  67. WBPopupSliderButton m_featherPopup;
  68. WBPopupSliderButton m_radiusPopup;
  69. WBPopupSliderButton m_ratePopup;
  70. public:
  71. static void setFeather(Int feather);
  72. static void setRate(Int rate);
  73. static void setRadius(Int radius);
  74. public:
  75. virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
  76. virtual void PopSliderChanged(const long sliderID, long theVal);
  77. virtual void PopSliderFinished(const long sliderID, long theVal);
  78. };
  79. //{{AFX_INSERT_LOCATION}}
  80. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  81. #endif // !defined(AFX_FEATHEROPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)