brushoptions.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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_BRUSHOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)
  19. #define AFX_BRUSHOPTIONS_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. /// BrushOptions modeless (floating) dialog - allows entry and display of brush width and feather.
  29. class BrushOptions : public COptionsPanel , public PopupSliderOwner
  30. {
  31. // Construction
  32. public:
  33. enum {MIN_BRUSH_SIZE=1,
  34. MAX_BRUSH_SIZE=51,
  35. FREQ_BRUSH_TICKS=10,
  36. MIN_FEATHER=0,
  37. FREQ_FEATHER_TICKS=4,
  38. MAX_FEATHER=20};
  39. BrushOptions(CWnd* pParent = NULL); // standard constructor
  40. // Dialog Data
  41. //{{AFX_DATA(BrushOptions)
  42. enum { IDD = IDD_BRUSH_OPTIONS };
  43. // NOTE: the ClassWizard will add data members here
  44. //}}AFX_DATA
  45. // Overrides
  46. // ClassWizard generated virtual function overrides
  47. //{{AFX_VIRTUAL(BrushOptions)
  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(BrushOptions)
  57. virtual BOOL OnInitDialog();
  58. afx_msg void OnChangeFeatherEdit();
  59. afx_msg void OnChangeSizeEdit();
  60. afx_msg void OnChangeHeightEdit();
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. protected:
  64. static BrushOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
  65. static Int m_currentWidth; ///< current brush width in the ui.
  66. static Int m_currentFeather; ///< current feather width in the ui.
  67. static Int m_currentHeight;
  68. Bool m_updating; ///<true if the ui is updating itself.
  69. WBPopupSliderButton m_brushWidthPopup;
  70. WBPopupSliderButton m_brushFeatherPopup;
  71. WBPopupSliderButton m_brushHeightPopup;
  72. public:
  73. static void setWidth(Int width);
  74. static void setFeather(Int feather);
  75. static void setHeight(Int height);
  76. public:
  77. virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
  78. virtual void PopSliderChanged(const long sliderID, long theVal);
  79. virtual void PopSliderFinished(const long sliderID, long theVal);
  80. };
  81. //{{AFX_INSERT_LOCATION}}
  82. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  83. #endif // !defined(AFX_BRUSHOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)