53LRESULT CALLBACK
WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
55 static bool bResizing =
false;
76 nMenuId = LOWORD(wParam);
82 InvalidateRect(hWnd,
nullptr, FALSE);
100 InvalidateRect(hWnd,
nullptr, FALSE);
105 SendMessage(hWnd, WM_CLOSE, 0, 0);
113 InvalidateRect(hWnd,
nullptr, FALSE);
119 InvalidateRect(hWnd,
nullptr, FALSE);
125 InvalidateRect(hWnd,
nullptr, FALSE);
131 InvalidateRect(hWnd,
nullptr, FALSE);
137 InvalidateRect(hWnd,
nullptr, FALSE);
143 InvalidateRect(hWnd,
nullptr, FALSE);
151 InvalidateRect(hWnd,
nullptr, FALSE);
157 InvalidateRect(hWnd,
nullptr, FALSE);
164 "https://ian-parberry.github.io/sortingnetworkviewer/html",
170 "Copyright © Ian Parberry, 2022.\nSource code available under the MIT License from https://github.com/Ian-Parberry/sortingnetworkviewer/.",
171 "About", MB_ICONINFORMATION | MB_OK);
178 return DefWindowProc(hWnd, message, wParam, lParam);
191int WINAPI
wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpStr,
int nShow){
192 UNREFERENCED_PARAMETER(hPrev);
193 UNREFERENCED_PARAMETER(lpStr);
199 while(GetMessage(&msg,
nullptr, 0, 0)){
200 TranslateMessage(&msg);
201 DispatchMessage(&msg);
204 return (
int)msg.wParam;
Interface for Batcher's bitonic sorting network.
Interface for the bubblesort sorting network.
Interface for the main class CMain.
static const int g_nMinH
Minimum window height.
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Window procedure.
static const int g_nMinW
Minimum window width.
static CMain * g_pMain
Pointer to the main class.
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpStr, int nShow)
Winmain.
Interface for Batcher's odd-even sorting network.
Interface for the pairwise sorting network.
void MinDragRect(HWND hwnd, WPARAM wParam, RECT *pRect, int w, int h)
Enforce minimum drag rectangle.
void InitWindow(HINSTANCE hInst, INT nShow, WNDPROC WndProc)
Initialize window.
#define IDM_GENERATE_MINBUBBLE
Menu id for Generate min-bubblesort.
#define IDM_GENERATE_MAXBUBBLE
Menu id for Generate max-bubblesort.
#define IDM_FILE_EXPORT_PNG
Menu id for Export PNG.
#define IDM_FILE_OPEN
Menu id for Generate.
#define IDM_GENERATE_BUBBLE
Menu id for Generate min-bubblesort.
#define IDM_GENERATE_BITONIC
Menu id for Generate bitonic.
#define IDM_FILE_VERIFY
Menu id for Verify.
#define IDM_FILE_QUIT
Menu id for Quit.
#define IDM_FILE_EXPORT_TEX
Menu id for Export TeX.
#define IDM_HELP_HELP
Menu id for display help.
#define IDM_VIEW_HORIZONTAL
Menu id for horizontal view.
#define IDM_FILE_EXPORT_SVG
Menu id for Export SVG.
#define IDM_GENERATE_PAIRWISE
Menu id for Generate pairwise.
#define IDM_VIEW_VERTICAL
Menu id for vertical view.
#define IDM_GENERATE_ODDEVEN
Menu id for Generate odd-even.
#define IDM_HELP_ABOUT
Menu id for display About info.
Batcher's bitonic sorting network.
void SetDrawStyle(const eDrawStyle)
Set drawing style.
void Draw()
Draw comparator network to bitmap.
void Read()
Read comparator network from file.
void GeneratePowerOf2()
Generate sorting network.
HRESULT Export(const eExport)
Export image file.
void Generate()
Generate sorting network.
void OnPaint()
Paint the client area of the window.
bool Verify()
Verify that comparator network sorts.
Batcher's odd-even sorting network.
The pairwise sorting network.