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
This commit is contained in:
skalogryz
2016-08-15 02:13:23 +00:00
parent e24cdc8732
commit 093d31e8f1

View File

@ -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