From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 140F43858D39; Thu, 16 Nov 2023 19:09:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 140F43858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1700161759; bh=VJdO1goQqGY75cnDI/oYIMqtlbdLApRdj3+OCdAChsE=; h=To:Subject:Date:From:From; b=QF7yLYtUppJX9Ox8z7ddpTreC1Pf5I3m92N65kATpo7H+xSq9cEazAZ16O2Mz1nps HI6TSZDdVnLI+mtvbnDglz0GWcvsuUfLDroU7ylsynvIxMAjPcCS4Nr8aq+zxCHLe3 l/BXafJuMy+xNMaesjl/scYNqzFOKngQ2ngOBQgs= To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.928 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: b97ee0c2c871bce3f72b6439c8aae6b12dfd8268 X-Git-Newrev: 668cc4d7855fb025c171cd5fd86260845e5c2eb0 Message-Id: <20231116190919.140F43858D39@sourceware.org> Date: Thu, 16 Nov 2023 19:09:19 +0000 (GMT) From: Jon Turney List-Id: https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=668cc4d7855fb025c171cd5fd86260845e5c2eb0 commit 668cc4d7855fb025c171cd5fd86260845e5c2eb0 Author: Jon Turney Date: Thu Nov 16 16:35:36 2023 +0000 Add a resize grip in bottom-right of dialog Add a resize grip in bottom-right of dialog, to visually indicate that the dialog is resizable. * Draw a size grip at bottom-right * Invalidate the area where the grip is drawn during resizing * Hit-test over the grip as if we were grabbing the frame (to change the cursor to the diagonally-resizing one when over it, and make the grip sensitive when clicked https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=2f73c0a0ecc72cc07c70321f2db2b9728ccbaca4 commit 2f73c0a0ecc72cc07c70321f2db2b9728ccbaca4 Author: Jon Turney Date: Thu Nov 16 17:40:16 2023 +0000 Abbreviate 'Synchronisieren' to fit in the space available Diff: --- RECTWrapper.h | 2 +- po/de/res.po | 2 +- propsheet.cc | 44 ++++++++++++++++++++++++++++++++++++++++++++ res/de/res.rc | 2 +- 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/RECTWrapper.h b/RECTWrapper.h index 41f52424..e394e05d 100644 --- a/RECTWrapper.h +++ b/RECTWrapper.h @@ -35,7 +35,7 @@ struct RECTWrapper : public RECT int width() const { return right - left; }; int height() const { return bottom - top; }; POINT center() const; - + // Do interesting things to the RECT/RECTWrapper RECTWrapper& operator=(const RECT & r); void move(int x, int y); diff --git a/po/de/res.po b/po/de/res.po index c62ac4ca..905afae9 100644 --- a/po/de/res.po +++ b/po/de/res.po @@ -482,7 +482,7 @@ msgstr "&Beste" #: DIALOG.IDD_CHOOSE.CONTROL.IDC_CHOOSE_SYNC msgid "&Sync" -msgstr "&Synchronisieren" +msgstr "&Synchr." #: DIALOG.IDD_CHOOSE.CONTROL.IDC_CHOOSE_EXP msgid "&Test" diff --git a/propsheet.cc b/propsheet.cc index 092293f0..faf6583f 100644 --- a/propsheet.cc +++ b/propsheet.cc @@ -26,6 +26,7 @@ #include "choose.h" #include "msg.h" #include "quiet.h" +#include "windowsx.h" // Sort of a "hidden" Windows structure. Used in the PropSheetCallback. #include @@ -148,6 +149,14 @@ BOOL CALLBACK EnumPages (HWND hwnd, LPARAM lParam) return TRUE; } +static void +GetSizeGripRect(HWND hwnd, LPRECT rect) +{ + GetClientRect(hwnd, rect); + rect->left = rect->right - GetSystemMetrics(SM_CXHSCROLL); + rect->top = rect->bottom - GetSystemMetrics(SM_CYVSCROLL); +} + static LRESULT CALLBACK PropSheetWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -231,6 +240,41 @@ static LRESULT CALLBACK PropSheetWndProc (HWND hwnd, UINT uMsg, } } break; + case WM_PAINT: + { + RECT rect; + GetSizeGripRect(hwnd, &rect); + + // draw size grip + HDC dc = GetDC(hwnd); + DrawFrameControl(dc, &rect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); + ReleaseDC(hwnd, dc); + } + break; + case WM_NCHITTEST: + { + RECT rect; + GetSizeGripRect(hwnd, &rect); + MapWindowPoints(hwnd, NULL, reinterpret_cast(&rect), 2); + + // when over the size grip, pretend to be over bottom-right corner of + // the sizing border + POINT point = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)}; + if (PtInRect(&rect, point)) + return HTBOTTOMRIGHT; + + // otherwise, fall through... + } + break; + case WM_SIZING: + { + // invalidate the area containing the size grip when the window is + // resized, so it's redrawn + RECT rect; + GetSizeGripRect(hwnd, &rect); + InvalidateRect(hwnd, &rect, FALSE); + } + break; } return CallWindowProc (psd.oldWndProc, diff --git a/res/de/res.rc b/res/de/res.rc index c96d2d62..f5da527a 100644 --- a/res/de/res.rc +++ b/res/de/res.rc @@ -218,7 +218,7 @@ BEGIN PUSHBUTTON "&Clear",IDC_CHOOSE_CLEAR_SEARCH,SETUP_CLEAR_X,30,SETUP_CLEAR_W,14 CONTROL "&Behalten",IDC_CHOOSE_KEEP,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,SETUP_KEEP_X,30,SETUP_KPCE_W,14 CONTROL "&Beste",IDC_CHOOSE_BEST,"Button",BS_AUTORADIOBUTTON,SETUP_BEST_X,30,SETUP_KPCE_W,14 - CONTROL "&Synchronisieren",IDC_CHOOSE_SYNC,"Button",BS_AUTORADIOBUTTON,SETUP_SYNC_X,30,SETUP_KPCE_W,14 + CONTROL "&Synchr.",IDC_CHOOSE_SYNC,"Button",BS_AUTORADIOBUTTON,SETUP_SYNC_X,30,SETUP_KPCE_W,14 CONTROL "&Test",IDC_CHOOSE_EXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,SETUP_EXP_X,30,SETUP_KPCE_W,14 CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28,SETUP_STANDARD_DIALOG_W,1 CONTROL "",IDC_CHOOSE_LIST,WC_LISTVIEW,LVS_NOSORTHEADER | LVS_REPORT | LVS_SINGLESEL | WS_TABSTOP,SETUP_CHOOSE_X,47,SETUP_CHOOSE_W,120,WS_EX_CLIENTEDGE