tvplanit: Activate mousewheel in VpCalendar

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4730 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-12 16:27:54 +00:00
parent 6f027303d9
commit cdd2584be7
3 changed files with 15 additions and 13 deletions

View File

@ -34,7 +34,7 @@ unit VpCalendar;
interface interface
uses uses
{$IFDEF LCL} {$IFDEF LCL} windows,
LMessages, LCLProc, LCLType, LCLIntf, LazUTF8, LMessages, LCLProc, LCLType, LCLIntf, LazUTF8,
{$ELSE} {$ELSE}
Windows, Windows,
@ -217,7 +217,7 @@ type
procedure DoOnChange(Value: TDateTime); dynamic; procedure DoOnChange(Value: TDateTime); dynamic;
function DoOnGetDateEnabled(ADate: TDateTime): Boolean; dynamic; function DoOnGetDateEnabled(ADate: TDateTime): Boolean; dynamic;
{$IFDEF LCL} {$IFDEF LCL}
// .... to be done in DoMouseWheel function DoMouseWheel(Shift: TShiftState; Delta: Integer; MousePos: TPoint): Boolean; override;
{$ELSE} {$ELSE}
procedure DoOnMouseWheel(Shift: TShiftState; Delta, XPos, YPos: SmallInt); override; procedure DoOnMouseWheel(Shift: TShiftState; Delta, XPos, YPos: SmallInt); override;
{$ENDIF} {$ENDIF}
@ -922,13 +922,22 @@ end;
{=====} {=====}
{$IFDEF LCL} {$IFDEF LCL}
// to be done in DoMouseWheel function TVpCustomCalendar.DoMouseWheel(Shift: TShiftState;
Delta: Integer; MousePos: TPoint): Boolean;
{$ELSE} {$ELSE}
procedure TVpCustomCalendar.DoOnMouseWheel(Shift: TShiftState; Delta, XPos, YPos: SmallInt); procedure TVpCustomCalendar.DoMouseWheel(Shift: TShiftState;
Delta, XPos, YPos: SmallInt);
{$ENDIF}
const
WHEEL_DELTA = 120; // in unit Windows.
var var
Key: Word; key: Word;
begin begin
{$IFDEF LCL}
Result := inherited DoMouseWheel(Shift, Delta, MousePos);
{$ELSE}
inherited DoOnMouseWheel(Shift, Delta, XPos, YPos); inherited DoOnMouseWheel(Shift, Delta, XPos, YPos);
{$ENDIF}
if Abs(Delta) = WHEEL_DELTA then begin if Abs(Delta) = WHEEL_DELTA then begin
{inc/dec month} {inc/dec month}
if Delta < 0 then if Delta < 0 then
@ -952,7 +961,6 @@ begin
KeyDown(Key, []); KeyDown(Key, []);
end; end;
end; end;
{$ENDIF}
{=====} {=====}
function TVpCustomCalendar.IsReadOnly: Boolean; function TVpCustomCalendar.IsReadOnly: Boolean;

View File

@ -2025,12 +2025,6 @@ end;
{=====} {=====}
{$IFDEF LCL} {$IFDEF LCL}
{
procedure TVpDayView.WMMouseWheel(var Message: TLMMouseEvent);
begin
inherited;
end;
}
function TVpDayView.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; function TVpDayView.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;
MousePos: TPoint): Boolean; MousePos: TPoint): Boolean;
begin begin