qt, gtk: make WheelDelta the same as in windows: -120, 120

git-svn-id: trunk@15409 -
This commit is contained in:
paul 2008-06-13 14:46:43 +00:00
parent 37de3d4197
commit 50a71ae47b
6 changed files with 4 additions and 88 deletions

1
.gitattributes vendored
View File

@ -3268,7 +3268,6 @@ lcl/interfaces/nogui/noguiint.pp svneol=native#text/plain
lcl/interfaces/qt/README.txt svneol=native#text/plain
lcl/interfaces/qt/interfaces.pp svneol=native#text/pascal
lcl/interfaces/qt/qt4.pas svneol=native#text/plain
lcl/interfaces/qt/qtcallback.inc svneol=native#text/pascal
lcl/interfaces/qt/qtcaret.pas svneol=native#text/pascal
lcl/interfaces/qt/qtdefines.inc svneol=native#text/pascal
lcl/interfaces/qt/qtint.pp svneol=native#text/pascal

View File

@ -1221,7 +1221,7 @@ end;
procedure DeliverMouseDownMessage(widget: PGtkWidget; event : pgdkEventButton;
AWinControl: TWinControl);
const
WHEEL_DELTA : array[Boolean] of Integer = (-1, 1);
WHEEL_DELTA : array[Boolean] of Integer = (-120, 120);
var
MessI : TLMMouse;
MessE : TLMMouseEvent;

View File

@ -134,8 +134,8 @@ begin
FillChar(MessE,SizeOf(MessE),0);
MessE.Msg := LM_MOUSEWHEEL;
case event^.direction of
GDK_SCROLL_UP: MessE.WheelDelta := 1;
GDK_SCROLL_DOWN: MessE.WheelDelta := -1;
GDK_SCROLL_UP: MessE.WheelDelta := 120;
GDK_SCROLL_DOWN: MessE.WheelDelta := -120;
else
exit;
end;

View File

@ -1,81 +0,0 @@
{
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
{------------------------------------------------------------------------------
Procedure: DeliverMessage
Params: Message: thje message to process
Returns: True if handled
Generic function whih calls the WindowProc if defined, otherwise the
dispatcher
------------------------------------------------------------------------------}
function DeliverMessage(const Target: Pointer; var Message): Boolean;
begin
{
if TObject(Target) is TControl then
begin
TControl(Target).WindowProc(TLMessage(Message));
end
else
begin
TObject(Target).Dispatch(TLMessage(Message));
end;
Result := TLMessage(Message).Result = 0;}
end;
{*************************************************************}
{ callback routines }
{*************************************************************}
procedure QTMousePressedEvent(qwid,button,x,y,state: integer);cdecl;
{var
MessE : TLMMouseEvent;
Data: pointer;
}
begin
{ Data := GetData(qwid);
EventTrace('Mouse button Press', data);
MessE.Button := button;
case button of
1 : MessE.Msg := LM_LBUTTONDOWN;
2 : MessE.Msg := LM_MBUTTONDOWN;
3 : MessE.Msg := LM_RBUTTONDOWN;
else MessE.Msg := LM_NULL;
end;
// MessE.WheelDelta := 1;
//MessE.State := state;
MessE.X := RoundToInt(x);
MessE.Y := RoundToInt(y);
if MessE.Msg <> LM_NULL then
DeliverMessage(Data, MessE);
}
end;
{*
procedure QTMousePressedEvent(qwid,button,x,y,state: integer);cdecl;
begin
DebugLn('fired press event widget' + IntToStr(qwid));
DebugLn('mouse button=' + IntToStr(button));
DebugLn('mouse x=' + IntToStr(x));
DebugLn('mouse y=' + IntToStr(y));
DebugLn('mouse state=' + IntToStr(state));
end; *}

View File

@ -265,7 +265,6 @@ end;
{$I qtobject.inc}
{$I qtwinapi.inc}
{$I qtlclintf.inc}
{.$I qtcallback.inc}
initialization

View File

@ -2129,7 +2129,6 @@ var
Msg: TLMMouseEvent;
MousePos: TQtPoint;
begin
WriteLn(LCLObject.ClassName);
FillChar(Msg, SizeOf(Msg), #0);
MousePos := QWheelEvent_Pos(QWheelEventH(Event))^;
@ -2143,7 +2142,7 @@ begin
Msg.X := SmallInt(MousePos.X);
Msg.Y := SmallInt(MousePos.Y);
Msg.WheelDelta := QWheelEvent_delta(QWheelEventH(Event)) div 120;
Msg.WheelDelta := QWheelEvent_delta(QWheelEventH(Event));
NotifyApplicationUserInput(Msg.Msg);
DeliverMessage(Msg);