let synedit use scrollwindowex, if that does not work, use invalidate

git-svn-id: trunk@5626 -
This commit is contained in:
micha 2004-06-30 17:14:11 +00:00
parent f0f1bba3c1
commit a0bbd3dbca
2 changed files with 29 additions and 5 deletions

View File

@ -274,7 +274,9 @@ type
{$ENDIF}
procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS;
{$IFDEF SYN_LAZARUS}
{$IFDEF USE_SYNEDIT_MOUSEWHEEL}
procedure WMMouseWheel(var Msg: TLMMouseEvent); message LM_MOUSEWHEEL;
{$ENDIF}
{$ELSE}
procedure WMMouseWheel(var Msg: TMessage); message WM_MOUSEWHEEL;
procedure WMSetCursor(var Msg: TWMSetCursor); message WM_SETCURSOR;
@ -333,7 +335,9 @@ type
{$ifndef SYN_LAZARUS}
fBorderStyle: TBorderStyle;
{$endif}
{$ifdef USE_SYNEDIT_MOUSEWHEEL}
fMouseWheelAccumulator: integer;
{$endif}
fHideSelection: boolean;
fOverwriteCaret: TSynEditCaretType;
fInsertCaret: TSynEditCaretType;
@ -3645,6 +3649,7 @@ begin
if fGutterWidth <> Value then begin
fGutterWidth := Value;
fTextOffset := fGutterWidth + 2 - (LeftChar - 1) * fCharWidth;
fBookmarkOpt.XOffset := Value - 18;
if HandleAllocated then begin
{$IFDEF SYN_LAZARUS}
fCharsInWindow := Max(1,(ClientWidth - fGutterWidth - 2 - ScrollBarWidth)
@ -4072,11 +4077,19 @@ begin
fTopLine := Value;
UpdateScrollBars;
if Abs(Delta) < fLinesInWindow then
{$IFDEF SYN_LAZARUS}
Invalidate
{$ELSE}
ScrollWindow(Handle, 0, fTextHeight * Delta, nil, nil)
{$ENDIF}
{$ifndef SYN_LAZARUS}
ScrollWindow(Handle, 0, fTextHeight * Delta, nil, nil);
{$else}
begin
// TODO: SW_SMOOTHSCROLL --> can't get it work
if not ScrollWindowEx(Handle, 0, fTextHeight * Delta, nil, nil, 0, nil,
SW_INVALIDATE) then
begin
// scrollwindow failed, invalidate all
Invalidate;
end;
end
{$endif}
else
Invalidate;
StatusChanged([scTopLine]);
@ -6785,6 +6798,7 @@ begin
end;
{$IFDEF SYN_LAZARUS}
{$IFDEF USE_SYNEDIT_MOUSEWHEEL}
procedure TCustomSynEdit.WMMouseWheel(var Msg: TLMMouseEvent);
var
@ -6822,6 +6836,7 @@ begin
Update;
end;
{$ENDIF}
{$ELSE}
procedure TCustomSynEdit.WMMouseWheel(var Msg: TMessage);

View File

@ -608,6 +608,12 @@ const
DLGC_WANTCHARS = $80;
{ScrollWindowEx}
SW_SMOOTHSCROLL = 16;
SW_ERASE = 4;
SW_INVALIDATE = 2;
SW_SCROLLCHILDREN = 1;
{owner drawn constants}
ODT_MENU = 1;
ODT_LISTBOX = 2;
@ -2007,6 +2013,9 @@ end.
{
$Log$
Revision 1.62 2004/06/30 17:14:11 micha
let synedit use scrollwindowex, if that does not work, use invalidate
Revision 1.61 2004/05/14 17:17:29 micha
add measureitem message and struct