Implements WinCE runtime scrollbar showing/hiding. Fixes bug #14548

git-svn-id: trunk@25726 -
This commit is contained in:
sekelsenmat 2010-05-28 08:13:08 +00:00
parent 8c5e3652bc
commit e9b50741dd
2 changed files with 27 additions and 4 deletions

View File

@ -3144,6 +3144,7 @@ function TWinCEWidgetSet.ShowCaret(hWnd: HWND): Boolean;
begin
Result := Boolean(Windows.ShowCaret(HWnd));
end;
{------------------------------------------------------------------------------
Method: ShowScrollBar
Params: Handle - handle of window with scroll bar
@ -3153,11 +3154,33 @@ end;
Shows or hides the specified scroll bar.
------------------------------------------------------------------------------}
{function TWinCEWidgetSet.ShowScrollBar(Handle: HWND; wBar: Integer;
function TWinCEWidgetSet.ShowScrollBar(Handle: HWND; wBar: Integer;
bShow: Boolean): Boolean;
var
dwStyle: DWORD;
begin
Result:=inherited ShowScrollBar(Handle, wBar, bShow);
end;}
Result := True;
dwStyle := GetWindowLong(Handle, GWL_STYLE);
case wBar of
SB_BOTH:
if bShow then
SetWindowLong(Handle, GWL_STYLE, dwStyle or WS_VSCROLL or WS_HSCROLL)
else
SetWindowLong(Handle, GWL_STYLE, (dwStyle and not WS_VSCROLL) and not WS_HSCROLL);
SB_VERT:
if bShow then
SetWindowLong(Handle, GWL_STYLE, dwStyle or WS_VSCROLL)
else
SetWindowLong(Handle, GWL_STYLE, dwStyle and not WS_VSCROLL);
SB_HORZ:
if bShow then
SetWindowLong(Handle, GWL_STYLE, dwStyle or WS_HSCROLL)
else
SetWindowLong(Handle, GWL_STYLE, dwStyle and not WS_HSCROLL);
else
Result := False;
end;
end;
{------------------------------------------------------------------------------
Method: ShowWindow

View File

@ -221,7 +221,7 @@ function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; OldPoint: PPoint) : Bool
function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
X, Y, cx, cy: Integer; uFlags: UINT): Boolean; override;
function ShowCaret(hWnd: HWND): Boolean; override;
{function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;}
function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override;
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; ROp: Cardinal): Boolean; override;
function StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Mask: HBITMAP; XMask, YMask: Integer; Rop: DWORD): Boolean; override;