-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathToolbarStrip.h
209 lines (189 loc) · 5.96 KB
/
ToolbarStrip.h
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#ifndef __TOOLBARSTRIP_H__
#define __TOOLBARSTRIP_H__
#include <CUI/CUIDialog.h>
#include <LDLib/LDInputHandler.h>
#include "TbButtonInfo.h"
class LDViewWindow;
class LDViewPreferences;
class TCAlert;
class TCImage;
typedef std::vector<HWND> HwndVector;
typedef std::vector<long> LongVector;
typedef std::map<long, size_t> LongSizeTMap;
typedef std::vector<HIMAGELIST> HImageListVector;
typedef std::vector<int> IntVector;
typedef std::map<int, int> IntIntMap;
typedef std::list<HMENU> HMenuList;
typedef std::pair<size_t, int> ImageIndexPair;
typedef std::map<UINT, ImageIndexPair> ImageIndexMap;
class ToolbarStrip: public CUIDialog
{
public:
ToolbarStrip(HINSTANCE hInstance);
void create(LDViewWindow *parent);
void show(void);
void hide(void);
void autoSize(void);
HWND getMainToolbar(void) { return m_hToolbar; }
void updateNumSteps(void);
void updateStep(void);
void enableMainToolbarButton(UINT buttonId, bool enable);
void checksReflect(void);
void viewModeReflect(void);
void activateDeactivatedTooltip(void);
protected:
virtual ~ToolbarStrip(void);
virtual void dealloc(void);
virtual BOOL doInitDialog(HWND /*hKbControl*/);
virtual LRESULT doTextFieldChange(int controlId, HWND control);
virtual LRESULT doCommand(int notifyCode, int commandId,
HWND control);
virtual LRESULT doNotify(int controlId, LPNMHDR notification);
virtual LRESULT doInitMenuPopup(HMENU hPopupMenu, UINT uPos,
BOOL fSystemMenu);
virtual LRESULT doEnterMenuLoop(bool isTrackPopupMenu);
virtual LRESULT doExitMenuLoop(bool isTrackPopupMenu);
virtual LRESULT doContextMenu(HWND hWnd, int xPos, int yPos);
virtual LRESULT doTimer(UINT_PTR timerID);
LRESULT doToolbarGetInfotip(TbButtonInfoVector &infos,
LPNMTBGETINFOTIPUC dispInfo);
LRESULT doMainToolbarNotify(int controlId, LPNMHDR notification);
LRESULT doStepToolbarNotify(int controlId, LPNMHDR notification);
LRESULT doMainTbGetButtonInfo(NMTOOLBARUC *notification);
LRESULT doMainToolbarChange(void);
LRESULT doMainToolbarReset(void);
void addTbButtonInfo(TbButtonInfoVector &infos, CUCSTR tooltipText,
int commandId, BYTE style = TBSTYLE_BUTTON,
BYTE state = TBSTATE_ENABLED);
void addTbCheckButtonInfo(TbButtonInfoVector &infos, CUCSTR tooltipText,
int commandId, bool checked, BYTE style = TBSTYLE_CHECK,
BYTE state = TBSTATE_ENABLED);
void addTbStateButtonInfo(TbButtonInfoVector &infos, CUCSTR tooltipText,
IntVector commandIds, int selection, BYTE style = TBSTYLE_BUTTON,
BYTE state = TBSTATE_ENABLED);
void addTbSeparatorInfo(TbButtonInfoVector &infos);
int addToImageList(int commandId);
void populateMainTbButtonInfos(void);
void populateStepTbButtonInfos(void);
void loadMainToolbarMenus(void);
void initMainToolbar(void);
void fillMainToolbar(void);
void initStepToolbar(void);
void initLayout(void);
void initToolbar(HWND hToolbar, TbButtonInfoVector &infos,
HIMAGELIST hImageList);
void modelAlertCallback(TCAlert *alert);
void stepChanged(void);
void enableToolbarButton(HWND hToolbar, UINT buttonId, bool enable);
bool doCheck(bool &value, LPARAM commandId);
void updateContextMenu(void);
void updateWireframeMenu(void);
void updateEdgesMenu(void);
void updatePrimitivesMenu(void);
void updateLightingMenu(void);
void updateBFCMenu(void);
void updateMenuImages(HMENU hMenu, bool topMenu = false);
void updateMenus(void);
void sizeToolbar(HWND hToolbar, int count);
void forceRedraw(void);
void doWireframe(void);
void doSeams(void);
void doEdges(void);
void doPrimitiveSubstitution(void);
void doLighting(void);
void doBfc(void);
void doShowAxes(void);
void doRandomColors(void);
void doAllConditionals(void);
void doConditionalControls(void);
void doCutaway(void);
void doFlatShading(void);
void doStudQuality(void);
void doPartBoundingBoxes(void);
void doSmoothCurves(void);
void doTransDefaultColor(void);
void doFog(void);
void doRemoveHiddenLines(void);
void doShowEdgesOnly(void);
void doConditionalLines(void);
void doHighQualityEdges(void);
void doAlwaysBlack(void);
void doTextureStuds(void);
void doTexmaps(void);
void doQualityLighting(void);
void doSubduedLighting(void);
void doSpecularHighlight(void);
void doAlternateLighting(void);
void doDrawLightDats(void);
void doOptionalStandardLight(void);
void doRedBackFaces(void);
void doGreenFrontFaces(void);
void doBlueNeutralFaces(void);
void doCustomizeMainToolbar(void);
void doMainToolbar(void);
void doStepsToolbar(void);
void doViewMode(void);
void syncViewMode(void);
void checkReflect(bool &value, bool prefsValue, LPARAM commandID);
void doDropDown(LPNMTOOLBAR toolbarNot);
void fillTbButton(TBBUTTON &button, const TbButtonInfo &buttonInfo);
void stepCountChanged(void);
int translateCommandId(int commandId);
LDViewWindow *m_ldviewWindow;
LDViewPreferences *m_prefs;
HWND m_hToolbar;
HWND m_hStepLabel;
HWND m_hStepField;
HWND m_hNumStepsLabel;
HWND m_hStepToolbar;
HWND m_hDeactivatedTooltip;;
HMENU m_hMainToolbarMenu;
HMENU m_hContextMenu;
HMENU m_hWireframeMenu;
HMENU m_hEdgesMenu;
HMENU m_hPrimitivesMenu;
HMENU m_hLightingMenu;
HMENU m_hBFCMenu;
HMODULE m_hGdiPlus;
double m_scaleFactor;
int m_imageSize;
int m_buttonWidth;
int m_buttonHeight;
int m_numSteps;
int m_step;
ucstring m_numStepsFormat;
TbButtonInfoVector m_mainButtonInfos;
TbButtonInfoVector m_stepButtonInfos;
HwndVector m_controls;
int m_stripHeight;
HImageListVector m_imageLists;
IntIntMap m_commandMap;
ImageIndexMap m_imagesMap;
bool m_have32BitBmps;
int m_stdBitmapStartId;
int m_tbBitmapStartId;
bool m_drawWireframe;
bool m_seams;
bool m_edges;
bool m_primitiveSubstitution;
bool m_lighting;
bool m_bfc;
bool m_showAxes;
bool m_randomColors;
bool m_allConditionals;
bool m_conditionalControls;
bool m_flat;
bool m_lowStuds;
bool m_partBBoxes;
bool m_smoothCurves;
bool m_transDefaultColor;
bool m_modelBoundingBox;
bool m_topmost;
bool m_wireframeCutaway;
bool m_examineLatLong;
bool m_texmaps;
LDInputHandler::ViewMode m_viewMode;
bool m_showMain;
bool m_showSteps;
};
#endif // __TOOLBARSTRIP_H__