From 1a9cd2de4af691a8ba3fee0f9dbd03fdcded23f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Thu, 11 Sep 2003 22:10:16 +0000 Subject: [PATCH] Implemented SS_PATHELLIPSIS and SS_ENDELLIPSIS styles and STN_CLICKED/STN_DBLCLK notifications svn path=/trunk/; revision=6048 --- reactos/lib/user32/controls/static.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/reactos/lib/user32/controls/static.c b/reactos/lib/user32/controls/static.c index 454c99bfff5..5359986af60 100644 --- a/reactos/lib/user32/controls/static.c +++ b/reactos/lib/user32/controls/static.c @@ -1,4 +1,4 @@ -/* $Id: static.c,v 1.6 2003/09/11 08:32:42 gvg Exp $ +/* $Id: static.c,v 1.7 2003/09/11 22:10:16 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS User32 @@ -296,6 +296,18 @@ static LRESULT CALLBACK StaticWndProcW( HWND hwnd, UINT uMsg, WPARAM wParam, LPA case WM_GETDLGCODE: return DLGC_STATIC; + case WM_LBUTTONDOWN: + if (! (full_style & SS_NOTIFY)) return 0; + SendMessageW(GetParent(hwnd), WM_COMMAND, + MAKEWPARAM((WORD) GetWindowLongW(hwnd, GWL_ID), STN_CLICKED), (LPARAM) hwnd); + return 0; + + case WM_LBUTTONDBLCLK: + if (! (full_style & SS_NOTIFY)) return 0; + SendMessageW(GetParent(hwnd), WM_COMMAND, + MAKEWPARAM((WORD) GetWindowLongW(hwnd, GWL_ID), STN_DBLCLK), (LPARAM) hwnd); + return 0; + case STM_GETIMAGE: case STM_GETICON: return GetWindowLongA( hwnd, HICON_GWL_OFFSET ); @@ -385,8 +397,20 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style ) if (style & SS_NOPREFIX) wFormat |= DT_NOPREFIX; - if (SS_WORDELLIPSIS == (style & SS_WORDELLIPSIS)) + switch(style & SS_ELLIPSISMASK) + { + case SS_WORDELLIPSIS: wFormat |= DT_WORD_ELLIPSIS | DT_SINGLELINE; + break; + case SS_ENDELLIPSIS: + wFormat |= DT_END_ELLIPSIS; + wFormat &= ~DT_WORDBREAK; + break; + case SS_PATHELLIPSIS: + wFormat |= DT_PATH_ELLIPSIS; + wFormat &= ~DT_WORDBREAK; + break; + } if ((hFont = (HFONT)GetWindowLongA( hwnd, HFONT_GWL_OFFSET ))) SelectObject( hdc, hFont );