forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 169
Expand file tree
/
Copy pathbrushoptions.h
More file actions
114 lines (97 loc) · 3.81 KB
/
brushoptions.h
File metadata and controls
114 lines (97 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// brushoptions.h : header file
//
#include "WBPopupSlider.h"
#include "OptionsPanel.h"
#include "BrushTool.h"
/////////////////////////////////////////////////////////////////////////////
/// BrushOptions modeless (floating) dialog - allows entry and display of brush width and feather.
class BrushOptions : public COptionsPanel , public PopupSliderOwner
{
// Construction
public:
enum {MIN_BRUSH_SIZE=1,
MAX_BRUSH_SIZE=51,
FREQ_BRUSH_TICKS=10,
MIN_FEATHER=0,
FREQ_FEATHER_TICKS=4,
MAX_FEATHER=20,
MIN_RAISE_LOWER = BrushTool::MIN_RAISE_LOWER,
MAX_RAISE_LOWER = BrushTool::MAX_RAISE_LOWER,
MIN_SMOOTH_RADIUS = BrushTool::MIN_SMOOTH_RADIUS,
MAX_SMOOTH_RADIUS = BrushTool::MAX_SMOOTH_RADIUS,
MIN_SMOOTH_RATE = BrushTool::MIN_SMOOTH_RATE,
MAX_SMOOTH_RATE = BrushTool::MAX_SMOOTH_RATE};
BrushOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(BrushOptions)
enum { IDD = IDD_BRUSH_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(BrushOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(BrushOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeFeatherEdit();
afx_msg void OnChangeSizeEdit();
afx_msg void OnChangeHeightEdit();
afx_msg void OnChangeRaiseLowerEdit();
afx_msg void OnChangeSmoothRadiusEdit();
afx_msg void OnChangeSmoothRateEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static BrushOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
static Int m_currentWidth; ///< current brush width in the ui.
static Int m_currentFeather; ///< current feather width in the ui.
static Int m_currentHeight;
static Int m_currentRaiseLower;
static Int m_currentSmoothRadius;
static Int m_currentSmoothRate;
Bool m_updating; ///<true if the ui is updating itself.
WBPopupSliderButton m_brushWidthPopup;
WBPopupSliderButton m_brushFeatherPopup;
WBPopupSliderButton m_brushHeightPopup;
WBPopupSliderButton m_raiseLowerPopup;
WBPopupSliderButton m_smoothRadiusPopup;
WBPopupSliderButton m_smoothRatePopup;
public:
static void setWidth(Int width);
static void setFeather(Int feather);
static void setHeight(Int height);
static void setRaiseLowerAmount(Int amount);
static void setSmoothRadius(Int radius);
static void setSmoothRate(Int rate);
public:
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.