From 093d31e8f1f932a1e9295dc2f16f1feff861b139 Mon Sep 17 00:00:00 2001 From: skalogryz Date: Mon, 15 Aug 2016 02:13:23 +0000 Subject: [PATCH] richmemo: fix in scrollbars styles selection for win32. (non Auto- scrollbars would now be disabled instead of disappeared) git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5090 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/richmemo/win32/win32richmemo.pas | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/components/richmemo/win32/win32richmemo.pas b/components/richmemo/win32/win32richmemo.pas index c14663419..94e90b3e7 100644 --- a/components/richmemo/win32/win32richmemo.pas +++ b/components/richmemo/win32/win32richmemo.pas @@ -180,6 +180,18 @@ const { taCenter } ES_CENTER ); +const + ScrollStyleToEditFlags : array [TScrollStyle] of LongWord = ( + {ssNone} 0 + , {ssHorizontal} WS_HSCROLL or ES_DISABLENOSCROLL + , {ssVertical} WS_VSCROLL or ES_DISABLENOSCROLL + , {ssBoth} WS_HSCROLL or WS_HSCROLL or ES_DISABLENOSCROLL + , {ssAutoHorizontal} WS_HSCROLL + , {ssAutoVertical} WS_VSCROLL + , {ssAutoBoth} WS_HSCROLL or WS_HSCROLL + ); + + const TAB_OFFSET_MASK = $7FFFFF; TAB_OFFSET_BITS = 24; @@ -507,14 +519,8 @@ begin if ACustomMemo.ReadOnly then Flags := Flags or ES_READONLY; Flags := Flags or AlignmentToEditFlags[ACustomMemo.Alignment]; - case ACustomMemo.ScrollBars of - ssHorizontal, ssAutoHorizontal: - Flags := Flags or WS_HSCROLL; - ssVertical, ssAutoVertical: - Flags := Flags or WS_VSCROLL; - ssBoth, ssAutoBoth: - Flags := Flags or WS_HSCROLL or WS_VSCROLL; - end; + Flags := Flags or ScrollStyleToEditFlags[ACustomMemo.ScrollBars]; + if ACustomMemo.WordWrap then Flags := Flags and not WS_HSCROLL else