Skip to content

Commit

Permalink
Make version information selectable and copyable in the About dialog.…
Browse files Browse the repository at this point in the history
… refs #2413
  • Loading branch information
sdottaka committed Aug 26, 2024
1 parent e85e626 commit 42ac97b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 26 deletions.
21 changes: 16 additions & 5 deletions Src/AboutDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void CAboutDlg::Impl::DoDataExchange(CDataExchange* pDX)
/**
* @brief Read version info from resource to dialog.
*/
BOOL CAboutDlg::Impl::OnInitDialog()
BOOL CAboutDlg::Impl::OnInitDialog()
{
CTrDialog::OnInitDialog();

Expand All @@ -116,7 +116,7 @@ BOOL CAboutDlg::Impl::OnInitDialog()
String link;
GetDlgItemText(IDC_WWW, link);
link = _T("<a href=\"") + m_p->m_info.website + _T("\">") + link + _T("</a>");
SetDlgItemText(IDC_WWW, link);
SetDlgItemText(IDC_WWW, link);

UpdateData(FALSE);

Expand All @@ -128,10 +128,21 @@ HBRUSH CAboutDlg::Impl::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
if (nCtlColor == CTLCOLOR_STATIC)
{
if (pWnd->GetDlgCtrlID() == IDC_GNU_ASCII)
const int ctrlId = pWnd->GetDlgCtrlID();
if (ctrlId == IDC_GNU_ASCII)
{
pDC->SetTextColor(RGB(128, 128, 128));
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
else if (ctrlId == IDC_COMPANY)
{
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
else if (ctrlId == IDC_VERSION)
{
return (HBRUSH)GetStockObject(WHITE_BRUSH);
}
}
return CTrDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
Expand Down
43 changes: 22 additions & 21 deletions Src/Merge.rc
Original file line number Diff line number Diff line change
Expand Up @@ -229,29 +229,29 @@ BEGIN
BEGIN
POPUP "&Blink interval"
BEGIN
MENUITEM "200[ms]", ID_IMG_BLINKINTERVAL_200
MENUITEM "400[ms]", ID_IMG_BLINKINTERVAL_400
MENUITEM "600[ms]", ID_IMG_BLINKINTERVAL_600
MENUITEM "800[ms]", ID_IMG_BLINKINTERVAL_800
MENUITEM "1000[ms]", ID_IMG_BLINKINTERVAL_1000
MENUITEM "1200[ms]", ID_IMG_BLINKINTERVAL_1200
MENUITEM "1500[ms]", ID_IMG_BLINKINTERVAL_1500
MENUITEM "2000[ms]", ID_IMG_BLINKINTERVAL_2000
MENUITEM "3000[ms]", ID_IMG_BLINKINTERVAL_3000
MENUITEM "4000[ms]", ID_IMG_BLINKINTERVAL_4000
MENUITEM "200[ms]", ID_IMG_BLINKINTERVAL_200
MENUITEM "400[ms]", ID_IMG_BLINKINTERVAL_400
MENUITEM "600[ms]", ID_IMG_BLINKINTERVAL_600
MENUITEM "800[ms]", ID_IMG_BLINKINTERVAL_800
MENUITEM "1000[ms]", ID_IMG_BLINKINTERVAL_1000
MENUITEM "1200[ms]", ID_IMG_BLINKINTERVAL_1200
MENUITEM "1500[ms]", ID_IMG_BLINKINTERVAL_1500
MENUITEM "2000[ms]", ID_IMG_BLINKINTERVAL_2000
MENUITEM "3000[ms]", ID_IMG_BLINKINTERVAL_3000
MENUITEM "4000[ms]", ID_IMG_BLINKINTERVAL_4000
END
POPUP "&Overlay animation interval"
BEGIN
MENUITEM "200[ms]", ID_IMG_OVERLAYANIMINTERVAL_200
MENUITEM "400[ms]", ID_IMG_OVERLAYANIMINTERVAL_400
MENUITEM "600[ms]", ID_IMG_OVERLAYANIMINTERVAL_600
MENUITEM "800[ms]", ID_IMG_OVERLAYANIMINTERVAL_800
MENUITEM "1000[ms]", ID_IMG_OVERLAYANIMINTERVAL_1000
MENUITEM "1200[ms]", ID_IMG_OVERLAYANIMINTERVAL_1200
MENUITEM "1500[ms]", ID_IMG_OVERLAYANIMINTERVAL_1500
MENUITEM "2000[ms]", ID_IMG_OVERLAYANIMINTERVAL_2000
MENUITEM "3000[ms]", ID_IMG_OVERLAYANIMINTERVAL_3000
MENUITEM "4000[ms]", ID_IMG_OVERLAYANIMINTERVAL_4000
MENUITEM "200[ms]", ID_IMG_OVERLAYANIMINTERVAL_200
MENUITEM "400[ms]", ID_IMG_OVERLAYANIMINTERVAL_400
MENUITEM "600[ms]", ID_IMG_OVERLAYANIMINTERVAL_600
MENUITEM "800[ms]", ID_IMG_OVERLAYANIMINTERVAL_800
MENUITEM "1000[ms]", ID_IMG_OVERLAYANIMINTERVAL_1000
MENUITEM "1200[ms]", ID_IMG_OVERLAYANIMINTERVAL_1200
MENUITEM "1500[ms]", ID_IMG_OVERLAYANIMINTERVAL_1500
MENUITEM "2000[ms]", ID_IMG_OVERLAYANIMINTERVAL_2000
MENUITEM "3000[ms]", ID_IMG_OVERLAYANIMINTERVAL_3000
MENUITEM "4000[ms]", ID_IMG_OVERLAYANIMINTERVAL_4000
END
END
MENUITEM SEPARATOR
Expand Down Expand Up @@ -1293,6 +1293,7 @@ BEGIN
END
END


/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
Expand Down Expand Up @@ -1398,11 +1399,11 @@ CAPTION "About WinMerge"
FONT 8, FONTNAME, 0, 0, 0x1
BEGIN
LTEXT "",IDC_GNU_ASCII,7,50,200,120
LTEXT "Version 1.0",IDC_VERSION,240,153,133,21,SS_NOPREFIX
CONTROL "Visit the WinMerge Homepage!",IDC_WWW,"SysLink",LWS_IGNORERETURN | 0x1,120,222,167,10
LTEXT "[VERSION COPYRIGHT GOES HERE]",IDC_COMPANY,7,174,350,42
DEFPUSHBUTTON "OK",IDOK,295,220,65,14
PUSHBUTTON "Contributors",IDC_OPEN_CONTRIBUTORS,7,220,65,14
EDITTEXT IDC_VERSION,237,155,120,20,ES_MULTILINE | ES_READONLY | NOT WS_BORDER
END

IDD_OPEN DIALOGEX 0, 0, 465, 266
Expand Down

0 comments on commit 42ac97b

Please sign in to comment.