menu kinda works

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@108 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
Nishi 2025-10-01 16:47:48 +00:00
commit 4dc4093119
7 changed files with 120 additions and 25 deletions

View file

@ -27,7 +27,7 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
ReleaseDC(hWnd, dc);
u->ll->hDC = hbdc;
MwLLDispatch(u->ll, draw);
MwLLDispatch(u->ll, draw, NULL);
dc = BeginPaint(hWnd, &ps);
StretchBlt(dc, 0, 0, rc.right - rc.left, rc.bottom - rc.top, hbdc, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SRCCOPY);
@ -37,25 +37,33 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
DeleteObject(hbmp);
} else {
u->ll->hDC = BeginPaint(hWnd, &ps);
MwLLDispatch(u->ll, draw);
MwLLDispatch(u->ll, draw, NULL);
EndPaint(hWnd, &ps);
}
} else if(msg == WM_LBUTTONDOWN) {
MwPoint p;
p.x = LOWORD(lp);
p.y = HIWORD(lp);
SetCapture(hWnd);
MwLLDispatch(u->ll, down);
MwLLDispatch(u->ll, down, &p);
InvalidateRect(hWnd, NULL, FALSE);
} else if(msg == WM_LBUTTONUP) {
MwPoint p;
p.x = LOWORD(lp);
p.y = HIWORD(lp);
SetCapture(NULL);
MwLLDispatch(u->ll, up);
MwLLDispatch(u->ll, up, &p);
InvalidateRect(hWnd, NULL, FALSE);
} else if(msg == WM_SIZE) {
MwLLDispatch(u->ll, resize);
MwLLDispatch(u->ll, resize, NULL);
} else if(msg == WM_ERASEBKGND) {
return 1;
} else if(msg == WM_NCHITTEST) {
return HTCLIENT;
} else if(msg == WM_DESTROY) {
MwLLDispatch(u->ll, close);
MwLLDispatch(u->ll, close, NULL);
PostQuitMessage(0);
} else if(msg == WM_CLOSE) {
DestroyWindow(hWnd);