LCL carbon: better line scrolling

- added few virtual mac key codes

git-svn-id: trunk@15543 -
This commit is contained in:
tombo 2008-06-23 14:41:22 +00:00
parent e2cf50c737
commit c5c0d79399
4 changed files with 17 additions and 7 deletions

View File

@ -212,7 +212,7 @@ type
procedure CreateWidget(const AParams: TCreateParams); override;
procedure DestroyWidget; override;
function GetFrame(Index: Integer): ControlRef; override;
public
public
class function GetValidEvents: TCarbonControlEvents; override;
procedure Draw; override;
procedure GetInfo(out AImageSize, AViewSize, ALineSize: HISize; out AOrigin: HIPoint); virtual;
@ -771,7 +771,16 @@ begin
AOrigin := GetHIPoint(FScrollOrigin.X * FMulX, FScrollOrigin.Y * FMulY);
AImageSize := GetHISize(FScrollSize.X * FMulX, FScrollSize.Y * FMulY);
AViewSize := GetHISize(C.Right - C.Left, C.Bottom - C.Top);
ALineSize := GetHISize(FScrollPageSize.X * FMulX / 40, FScrollPageSize.Y * FMulY / 40);
if FMulX > 1 then
ALineSize.width := FMulX
else
ALineSize.width := 10;
if FMulY > 1 then
ALineSize.height := FMulY
else
ALineSize.height := 10;
{$IFDEF VerboseScroll}
DebugLn('TCarbonCustomControl.GetInfo ' + LCLObject.Name + ' Origin: ' +

View File

@ -288,13 +288,10 @@ begin
NotifyApplicationUserInput(Msg.Message.Msg);
if DeliverMessage(Widget.LCLObject, Msg) = 0 then
begin
Result := EventNotHandledErr //CallNextEventHandler(ANextHandler, AEvent);
Result := EventNotHandledErr;
end
else
begin
// the LCL does not want the event propagated
else // the LCL does not want the event propagated
Result := noErr;
end;
// interactive design
if (Widget is TCarbonDesignWindow) and (GetCarbonMouseButton(AEvent) = 1) and

View File

@ -309,6 +309,9 @@ begin
VK_F15 : Result := MK_F15;
VK_NUMLOCK : Result := MK_NUMLOCK;
VK_SCROLL : Result := MK_SCRLOCK;
VK_SHIFT : Result := MK_SHIFTKEY;
VK_CONTROL : Result := MK_COMMAND;
VK_MENU : Result := MK_ALT;
else
Result := 0;
end;

View File

@ -74,6 +74,7 @@ const
//Modifiers codes - you'll never get these directly
MK_SHIFTKEY = $38;
MK_CTRL = $3B;
MK_ALT = $3A; MK_OPTION = MK_ALT;
MK_COMMAND = $37; MK_APPLE = MK_COMMAND;