public inbox for cygwin-apps-cvs@sourceware.org help / color / mirror / Atom feed
From: Jon Turney <jturney@sourceware.org> To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.928 Date: Thu, 16 Nov 2023 19:09:19 +0000 (GMT) [thread overview] Message-ID: <20231116190919.140F43858D39@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=668cc4d7855fb025c171cd5fd86260845e5c2eb0 commit 668cc4d7855fb025c171cd5fd86260845e5c2eb0 Author: Jon Turney <jon.turney@dronecode.org.uk> 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 <jon.turney@dronecode.org.uk> 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 <pshpack1.h> @@ -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<POINT *>(&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
reply other threads:[~2023-11-16 19:09 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20231116190919.140F43858D39@sourceware.org \ --to=jturney@sourceware.org \ --cc=cygwin-apps-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).