Added resize gripper....finally.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1060 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
rainwater 2002-09-20 02:43:47 +00:00
parent 07b87eb653
commit 898e6bb120
3 changed files with 20 additions and 4 deletions

View file

@ -25,6 +25,7 @@
#include "noclib.h"
static RECT resizeRect;
static RECT g_griprect;
static int dx;
static int dy;
@ -91,6 +92,17 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
CompileNSISScript();
return TRUE;
}
case WM_PAINT:
{
PAINTSTRUCT ps;
GetClientRect(g_hwnd, &g_griprect);
HDC hdc = BeginPaint(g_hwnd, &ps);
g_griprect.left = g_griprect.right - GetSystemMetrics(SM_CXVSCROLL);
g_griprect.top = g_griprect.bottom - GetSystemMetrics(SM_CYVSCROLL);
DrawFrameControl(hdc, &g_griprect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
EndPaint(g_hwnd,&ps);
return TRUE;
}
case WM_DESTROY:
{
SaveWindowPos(g_hwnd);
@ -158,12 +170,15 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
RECT rSize;
if (hwndDlg == g_hwnd) {
GetClientRect(g_hwnd, &rSize);
if (((rSize.right==0)&&(rSize.bottom==0))||((resizeRect.right==0)&&(resizeRect.bottom==0)))
return TRUE;
if (((rSize.right==0)&&(rSize.bottom==0))||((resizeRect.right==0)&&(resizeRect.bottom==0))) return TRUE;
dx = rSize.right - resizeRect.right;
dy = rSize.bottom - resizeRect.bottom;
EnumChildWindows(g_hwnd, DialogResize, (LPARAM)0);
resizeRect = rSize;
GetClientRect(g_hwnd, &g_griprect);
g_griprect.left = g_griprect.right - GetSystemMetrics(SM_CXVSCROLL);
g_griprect.top = g_griprect.bottom - GetSystemMetrics(SM_CYVSCROLL);
InvalidateRect(g_hwnd,&g_griprect,TRUE);
}
return TRUE;
}