29#ifndef __WINDOWSHELPERS_H__
30#define __WINDOWSHELPERS_H__
38#pragma region Menu IDs
40#define IDM_FILE_SAVE 1
41#define IDM_FILE_PROPS 2
42#define IDM_FILE_QUIT 3
44#define IDM_GENERATE_PERLINNOISE 4
45#define IDM_GENERATE_VALUENOISE 5
46#define IDM_GENERATE_RANDOMIZE 6
47#define IDM_GENERATE_JUMP 7
48#define IDM_GENERATE_RESETORIGIN 8
50#define IDM_VIEW_COORDS 9
51#define IDM_VIEW_GRID 10
53#define IDM_DISTRIBUTION_UNIFORM 11
54#define IDM_DISTRIBUTION_COSINE 12
55#define IDM_DISTRIBUTION_NORMAL 13
56#define IDM_DISTRIBUTION_EXPONENTIAL 14
57#define IDM_DISTRIBUTION_MIDPOINT 15
58#define IDM_DISTRIBUTION_MAXIMAL 16
60#define IDM_HASH_PERM 17
61#define IDM_HASH_LCON 18
62#define IDM_HASH_STD 19
64#define IDM_SPLINE_NONE 20
65#define IDM_SPLINE_CUBIC 21
66#define IDM_SPLINE_QUINTIC 22
68#define IDM_SETTINGS_OCTAVE_UP 23
69#define IDM_SETTINGS_OCTAVE_DN 24
70#define IDM_SETTINGS_SCALE_UP 25
71#define IDM_SETTINGS_SCALE_DN 26
72#define IDM_SETTINGS_TSIZE_UP 27
73#define IDM_SETTINGS_TSIZE_DN 28
74#define IDM_SETTINGS_RESET 29
76#define IDM_HELP_HELP 30
77#define IDM_HELP_ABOUT 31
79#pragma endregion Menu IDs
84#pragma region Helper functions
92HRESULT
SaveBitmap(HWND,
const std::wstring&, Gdiplus::Bitmap*);
94#pragma endregion Helper functions
99#pragma region Menu functions
140 if(noise == eNoise::None){
141 EnableMenuItem(hMenu, up, MF_GRAYED);
142 EnableMenuItem(hMenu, dn, MF_GRAYED);
146 EnableMenuItem(hMenu, up, (n < nMax)? MF_ENABLED: MF_GRAYED);
147 EnableMenuItem(hMenu, dn, (n > nMin)? MF_ENABLED: MF_GRAYED);
151#pragma endregion Menu functions
Useful defines, constants, and types.
eDistribution
Distribution.
HMENU CreateFileMenu(HMENU)
Create File menu.
HMENU CreateHashMenu(HMENU)
Create Hash menu.
HMENU CreateViewMenu(HMENU)
Create View menu.
void UpdateSettingsMenu(HMENU, eNoise)
Update Settings menu.
void UpdateFileMenu(HMENU, eNoise)
Update File menu.
HMENU CreateGenerateMenu(HMENU)
Create Generate menu.
void UpdateGenerateMenu(HMENU, eNoise)
Update Generate menu.
void CreateHelpMenu(HMENU)
Create Help menu.
HMENU CreateSettingsMenu(HMENU)
Create Settings menu.
void UpdateMenuItemGray(HMENU, UINT, eNoise, bool)
Update menu item bool.
void UpdateSplineMenu(HMENU, eNoise, eSpline)
Update Spline menu.
void UpdateHashMenu(HMENU, eNoise, eHash)
Update Hash menu.
ULONG_PTR InitGDIPlus()
Initialize GDI+.
void UpdateMenuItem(HMENU hMenu, UINT up, UINT dn, eNoise noise, t n, t nMin, t nMax)
Update a numeric menu item.
HMENU CreateDistributionMenu(HMENU)
Create Distribution menu.
void UpdateViewMenu(HMENU, eNoise)
Update View menu.
HMENU CreateSplineMenu(HMENU)
Create Spline menu.
void UpdateMenuItemCheck(HMENU, UINT, bool)
Update menu item check.
void UpdateDistributionMenu(HMENU, eNoise, eDistribution)
Update Distribution menu.
HRESULT SaveBitmap(HWND, const std::wstring &, Gdiplus::Bitmap *)
Save bitmap to file.