|
@@ -26,7 +26,7 @@ interface
|
|
|
uses
|
|
|
Classes, SysUtils, Math, FPImage,
|
|
|
{$IF FPC_FULLVERSION>30300}
|
|
|
- sortbase,
|
|
|
+ sortbase, System.UITypes,
|
|
|
{$ENDIF}
|
|
|
fpCSSTree, fpCSSResParser, fpCSSResolver, fpCSSScanner, fpCSSParser, FCL.Events,
|
|
|
Fresnel.Classes, Fresnel.Events;
|
|
@@ -1245,14 +1245,23 @@ type
|
|
|
private
|
|
|
FElement: TFresnelElement;
|
|
|
FHorizontal: boolean;
|
|
|
+ public type
|
|
|
+ {$ScopedEnums on}
|
|
|
+ THit = (hNone, hButtonLT, hButtonRB, hThumb, hTrackLT, hTrackRB);
|
|
|
+ {$ScopedEnums off}
|
|
|
public
|
|
|
- Box: TFresnelRect;
|
|
|
- Position: TFresnelLength; // ScrollLeft/Top
|
|
|
+ Position: TFresnelLength; // ScrollLeft/Top, When direction=rtl: Position=Size-Page+ScrollLeft
|
|
|
+ // can be negative or bigger than Size
|
|
|
Size: TFresnelLength; // ScrollWidth/Height
|
|
|
Page: TFresnelLength; // ClientWidth/Height
|
|
|
Color: TFPColor;
|
|
|
+ Box: TFresnelRect; // relative to layoutnode parent's RenderedContentBox
|
|
|
+ MouseDownHit: THit;
|
|
|
+ MouseDownPos: TFresnelLength;
|
|
|
constructor Create(TheElement: TFresnelElement; aHorizontal: boolean);
|
|
|
destructor Destroy; override;
|
|
|
+ function GetHit(const X, Y: TFresnelLength; out aPosition: TFresnelLength): THit; virtual; abstract;
|
|
|
+ procedure MouseHandler(WSData: TFresnelMouseEventInit; MouseEventId: TEventID); virtual; abstract;
|
|
|
property Element: TFresnelElement read FElement;
|
|
|
property Horizontal: boolean read FHorizontal;
|
|
|
end;
|
|
@@ -1667,7 +1676,8 @@ type
|
|
|
function GetScrollbarsWidth(IsHorizontal: boolean): TFresnelLength; virtual;
|
|
|
function GetVPLength(l: TFresnelViewportLength): TFresnelLength; virtual;
|
|
|
function GetWidth: TFresnelLength; virtual;
|
|
|
- procedure FPOObservedChanged(ASender: TObject; {%H-}Operation: TFPObservedOperation; {%H-}Data: Pointer); override;
|
|
|
+ procedure FPOObservedChanged(ASender: TObject; {%H-}Operation: TFPObservedOperation;
|
|
|
+ {%H-}Data: Pointer); override;
|
|
|
procedure InitResolver; virtual;
|
|
|
procedure UpdateResolverStylesheet; virtual;
|
|
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
|
@@ -1682,6 +1692,15 @@ type
|
|
|
procedure StylesheetChanged; virtual;
|
|
|
function TrySetFocusControl(aControl : TFresnelElement) : Boolean;
|
|
|
public type
|
|
|
+ {$ScopedEnums on}
|
|
|
+ THit = (
|
|
|
+ hNone,
|
|
|
+ hElement,
|
|
|
+ hScrollbarHorz,
|
|
|
+ hScrollbarVert
|
|
|
+ );
|
|
|
+ {$ScopedEnums off}
|
|
|
+ THits = set of THit;
|
|
|
|
|
|
{ TBubbleMouseClickEvent }
|
|
|
|
|
@@ -1748,6 +1767,9 @@ type
|
|
|
class function GetCSSTypeStyle: TCSSString; override;
|
|
|
function GetElementAt(const x, y: TFresnelLength): TFresnelElement; virtual;
|
|
|
function GetElementsAt(const x, y: TFresnelLength): TFresnelElementArray; virtual;
|
|
|
+ // returns in stacking order top to bottom aka child to parents
|
|
|
+ procedure GetElementsAt(const x, y: TFresnelLength; OnlyLast: boolean;
|
|
|
+ out Arr: TFresnelElementArray; out Hit: THit); virtual;
|
|
|
function ContentToPagePos(El: TFresnelElement; const x, y: TFresnelLength): TFresnelPoint; virtual; overload; // content box of El to content of viewport
|
|
|
function ContentToPagePos(El: TFresnelElement; const p: TFresnelPoint): TFresnelPoint; overload; // content box of El to content of viewport
|
|
|
function PageToContentPos(El: TFresnelElement; const x, y: TFresnelLength): TFresnelPoint; virtual; overload; // content of viewport to content box of El
|
|
@@ -6719,7 +6741,7 @@ begin
|
|
|
try
|
|
|
if assigned(FFocusedElement) then
|
|
|
begin
|
|
|
- // Blur does not bubble;
|
|
|
+ // Blur does not bubble
|
|
|
lEvt:=TFresnelFocusEvent.Create(FFocusedElement,evtBlur);
|
|
|
lEvt.Related:=aControl;
|
|
|
FFocusedElement.DispatchEvent(lEvt);
|
|
@@ -6733,7 +6755,7 @@ begin
|
|
|
FFocusedElement:=aControl;
|
|
|
if assigned(FFocusedElement) then
|
|
|
begin
|
|
|
- // Focus does not bubble;
|
|
|
+ // Focus does not bubble
|
|
|
lEvt:=TFresnelFocusEvent.Create(FFocusedElement,evtFocus);
|
|
|
lEvt.Related:=lOldElement;
|
|
|
FFocusedElement.DispatchEvent(levt);
|
|
@@ -6851,8 +6873,8 @@ begin
|
|
|
DomChanged;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelViewport.SetScrollbarsThinWidth(IsHorizontal: boolean; const AValue: TFresnelLength
|
|
|
- );
|
|
|
+procedure TFresnelViewport.SetScrollbarsThinWidth(IsHorizontal: boolean;
|
|
|
+ const AValue: TFresnelLength);
|
|
|
begin
|
|
|
if FScrollbarThinWidth[IsHorizontal]=AValue then exit;
|
|
|
FScrollbarThinWidth[IsHorizontal]:=AValue;
|
|
@@ -7022,65 +7044,107 @@ end;
|
|
|
|
|
|
function TFresnelViewport.GetElementAt(const x, y: TFresnelLength
|
|
|
): TFresnelElement;
|
|
|
-
|
|
|
- function Check(Node: TFresnelLayoutNode; const dx, dy: TFresnelLength): TFresnelElement;
|
|
|
- var
|
|
|
- El: TFresnelElement;
|
|
|
- i: Integer;
|
|
|
- BorderBox: TFresnelRect;
|
|
|
- aContentOffset: TFresnelPoint;
|
|
|
- begin
|
|
|
- Result:=nil;
|
|
|
- if Node=nil then exit;
|
|
|
- El:=Node.Element;
|
|
|
- if not El.Rendered then exit;
|
|
|
- if Node.NodeCount>0 then begin
|
|
|
- aContentOffset:=El.RenderedContentBox.TopLeft;
|
|
|
- for i:=Node.NodeCount-1 downto 0 do
|
|
|
- begin
|
|
|
- Result:=Check(Node.Nodes[i],dx+aContentOffset.X,dy+aContentOffset.Y);
|
|
|
- if Result<>nil then exit;
|
|
|
- end;
|
|
|
- end;
|
|
|
- BorderBox:=El.RenderedBorderBox;
|
|
|
- if BorderBox.Contains(x-dx,y-dy) then
|
|
|
- Result:=El
|
|
|
- else
|
|
|
- Result:=nil;
|
|
|
- end;
|
|
|
-
|
|
|
+var
|
|
|
+ Arr: TFresnelElementArray;
|
|
|
+ Hit: THit;
|
|
|
begin
|
|
|
- Result:=Check(LayoutNode,0,0);
|
|
|
+ GetElementsAt(x,y,true,Arr,Hit);
|
|
|
+ if Arr<>nil then
|
|
|
+ Result:=Arr[0]
|
|
|
+ else
|
|
|
+ Result:=nil;
|
|
|
end;
|
|
|
|
|
|
function TFresnelViewport.GetElementsAt(const x, y: TFresnelLength
|
|
|
): TFresnelElementArray;
|
|
|
+var
|
|
|
+ Hit: THit;
|
|
|
+begin
|
|
|
+ GetElementsAt(x,y,false,Result,Hit);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TFresnelViewport.GetElementsAt(const x, y: TFresnelLength; OnlyLast: boolean; out
|
|
|
+ Arr: TFresnelElementArray; out Hit: THit);
|
|
|
|
|
|
- procedure Check(Node: TFresnelLayoutNode; const dx, dy: TFresnelLength);
|
|
|
+ function Check(Node: TFresnelLayoutNode; const dx, dy: TFresnelLength): boolean;
|
|
|
var
|
|
|
El: TFresnelElement;
|
|
|
i: Integer;
|
|
|
- BorderBox: TFresnelRect;
|
|
|
+ BorderBox, r: TFresnelRect;
|
|
|
aContentOffset: TFresnelPoint;
|
|
|
+ HitX, HitY: TFresnelLength;
|
|
|
+ aBar: TFresnelScrollBar;
|
|
|
+ ClipHorizontal, ClipVertical: Boolean;
|
|
|
begin
|
|
|
+ Result:=false;
|
|
|
if Node=nil then exit;
|
|
|
El:=Node.Element;
|
|
|
if not El.Rendered then exit;
|
|
|
+
|
|
|
+ HitX:=x-dx;
|
|
|
+ HitY:=y-dy;
|
|
|
+
|
|
|
+ ClipHorizontal:=flfClipHorizontal in Node.Flags;
|
|
|
+ ClipVertical:=flfClipVertical in Node.Flags;
|
|
|
+ if ClipHorizontal or ClipVertical then
|
|
|
+ begin
|
|
|
+ r:=El.GetRenderedPaddingBox;
|
|
|
+ //writeln('TFresnelElement.GetElementAts ',El.Name,' ClipH=',ClipHorizontal,' ClipV=',ClipVertical,' Hit=',FloatToCSSStr(HitX),',',FloatToCSSStr(HitY),' PadBox=',r.ToString);
|
|
|
+ if ClipHorizontal then
|
|
|
+ begin
|
|
|
+ if HitX<r.Left then exit;
|
|
|
+ if HitX>r.Right then exit;
|
|
|
+ end;
|
|
|
+ if ClipVertical then
|
|
|
+ begin
|
|
|
+ if HitY<r.Top then exit;
|
|
|
+ if HitY>r.Bottom then exit;
|
|
|
+ end;
|
|
|
+ aBar:=El.ScrollBarHorizontal;
|
|
|
+ //if aBar<>nil then writeln('Check ',aBar.Box.ToString);
|
|
|
+ if (aBar<>nil) and aBar.Box.Contains(HitX,HitY) then
|
|
|
+ begin
|
|
|
+ Arr:=[El];
|
|
|
+ Hit:=THit.hScrollbarHorz;
|
|
|
+ exit(true);
|
|
|
+ end;
|
|
|
+ aBar:=El.ScrollBarVertical;
|
|
|
+ if (aBar<>nil) and aBar.Box.Contains(HitX,HitY) then
|
|
|
+ begin
|
|
|
+ Arr:=[El];
|
|
|
+ Hit:=THit.hScrollbarVert;
|
|
|
+ exit(true);
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+
|
|
|
if Node.NodeCount>0 then begin
|
|
|
aContentOffset:=El.RenderedContentBox.TopLeft;
|
|
|
for i:=Node.NodeCount-1 downto 0 do
|
|
|
- Check(Node.Nodes[i],dx+aContentOffset.X,dy+aContentOffset.Y);
|
|
|
+ begin
|
|
|
+ if Check(Node.Nodes[i],dx+aContentOffset.X,dy+aContentOffset.Y)
|
|
|
+ and OnlyLast then
|
|
|
+ exit;
|
|
|
+ end;
|
|
|
end;
|
|
|
BorderBox:=El.RenderedBorderBox;
|
|
|
- if BorderBox.Contains(x-dx,y-dy) then
|
|
|
+ if BorderBox.Contains(HitX,HitY) then
|
|
|
begin
|
|
|
- System.Insert(El,Result,length(Result));
|
|
|
+ if length(Arr)=0 then
|
|
|
+ begin
|
|
|
+ Arr:=[El];
|
|
|
+ Hit:=THit.hElement;
|
|
|
+ end else begin
|
|
|
+ System.Insert(El,Arr,length(Arr));
|
|
|
+ end;
|
|
|
+ Result:=true;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
begin
|
|
|
- Result:=[];
|
|
|
+ Arr:=[];
|
|
|
+ Hit:=THit.hNone;
|
|
|
Check(LayoutNode,0,0);
|
|
|
+ //writeln('TFresnelViewport.GetElementsAt END ',Hit);
|
|
|
end;
|
|
|
|
|
|
function TFresnelViewport.ContentToPagePos(El: TFresnelElement; const x,
|
|
@@ -7136,20 +7200,19 @@ var
|
|
|
NewPageXY, OldPageXY: TFresnelPoint;
|
|
|
i: Integer;
|
|
|
j: SizeInt;
|
|
|
+ Hit: THit;
|
|
|
begin
|
|
|
if not (MouseEventId in [evtMouseDown,evtMouseUp,evtMouseMove,evtMouseEnter,evtMouseLeave]) then
|
|
|
exit;
|
|
|
|
|
|
NewPageXY:=WSData.PagePos;
|
|
|
- if evtMouseDown=MouseEventID then
|
|
|
- Writeln('Ah');
|
|
|
- NewHoverElements:=GetElementsAt(NewPageXY.X,NewPageXY.Y);
|
|
|
+ GetElementsAt(NewPageXY.X,NewPageXY.Y,false,NewHoverElements,Hit);
|
|
|
OldHoverElements:=VPApplication.GetHoverElements;
|
|
|
OldMouseDownEl:=VPApplication.GetMouseDownElement(OldPageXY);
|
|
|
|
|
|
MouseEvt:=nil;
|
|
|
try
|
|
|
- // send mouse leave events in stacking order top to bottom
|
|
|
+ // send mouse leave events in stacking order top to bottom aka child to parents
|
|
|
for i:=0 to length(OldHoverElements)-1 do
|
|
|
begin
|
|
|
El:=OldHoverElements[i];
|
|
@@ -7174,9 +7237,9 @@ begin
|
|
|
{$IFDEF VerboseFresnelMouse}
|
|
|
writeln('TFresnelViewport.WSMouseXY LEAVE VIEWPORT');
|
|
|
{$ENDIF}
|
|
|
- FreeAndNil(MouseEvt);
|
|
|
MouseEvt:=EventDispatcher.CreateEvent(Self,evtMouseLeave) as TFresnelMouseLeaveEvent;
|
|
|
DispatchEvent(MouseEvt);
|
|
|
+ FreeAndNil(MouseEvt);
|
|
|
end;
|
|
|
|
|
|
VPApplication.SetHoverElements(NewHoverElements);
|
|
@@ -7187,12 +7250,12 @@ begin
|
|
|
{$IFDEF VerboseFresnelMouse}
|
|
|
writeln('TFresnelViewport.WSMouseXY ENTER VIEWPORT');
|
|
|
{$ENDIF}
|
|
|
- FreeAndNil(MouseEvt);
|
|
|
MouseEvt:=EventDispatcher.CreateEvent(Self,evtMouseEnter) as TFresnelMouseEnterEvent;
|
|
|
EventDispatcher.DispatchEvent(MouseEvt);
|
|
|
+ FreeAndNil(MouseEvt);
|
|
|
end;
|
|
|
|
|
|
- // sent mouse enter events in stacking order bottom to top
|
|
|
+ // sent mouse enter events in stacking order bottom to top aka parents to child
|
|
|
for i:=length(NewHoverElements)-1 downto 0 do
|
|
|
begin
|
|
|
El:=NewHoverElements[i];
|
|
@@ -7203,9 +7266,9 @@ begin
|
|
|
{$IFDEF VerboseFresnelMouse}
|
|
|
writeln('TFresnelViewport.WSMouseXY ENTER ',El.GetPath);
|
|
|
{$ENDIF}
|
|
|
- FreeAndNil(MouseEvt);
|
|
|
MouseEvt:=El.EventDispatcher.CreateEvent(El,evtMouseEnter) as TFresnelMouseEnterEvent;
|
|
|
El.DispatchEvent(MouseEvt);
|
|
|
+ FreeAndNil(MouseEvt);
|
|
|
end;
|
|
|
|
|
|
finally
|
|
@@ -7230,60 +7293,66 @@ begin
|
|
|
|
|
|
if MouseEventId in [evtMouseDown,evtMouseUp,evtMouseMove] then
|
|
|
begin
|
|
|
- MouseEvt:=nil;
|
|
|
- ClickEvt:=nil;
|
|
|
- try
|
|
|
- // dispatch mouse down/move/up events, in stacking order
|
|
|
- i:=0;
|
|
|
- MouseEvt:=El.EventDispatcher.CreateEvent(El,MouseEventId) as TFresnelMouseEvent;
|
|
|
- MouseEvt.InitEvent(WSData);
|
|
|
-
|
|
|
- BubbleEl:=El;
|
|
|
- repeat
|
|
|
- if MouseEvt is TBubbleMouseDownEvent then
|
|
|
- TBubbleMouseDownEvent(MouseEvt).FElement:=BubbleEl
|
|
|
- else if MouseEvt is TBubbleMouseUpEvent then
|
|
|
- TBubbleMouseUpEvent(MouseEvt).FElement:=BubbleEl
|
|
|
- else if MouseEvt is TBubbleMouseMoveEvent then
|
|
|
- TBubbleMouseMoveEvent(MouseEvt).FElement:=BubbleEl;
|
|
|
-
|
|
|
- {$IFDEF VerboseFresnelMouse}
|
|
|
- writeln('TFresnelViewport.WSMouseXY ',MouseEventId,' ',BubbleEl.GetPath,' ',FloatToCSSStr(MouseEvt.X),',',FloatToCSSStr(MouseEvt.Y));
|
|
|
- {$ENDIF}
|
|
|
- BubbleEl.DispatchEvent(MouseEvt);
|
|
|
- inc(i);
|
|
|
- if (MouseEvt.PropagationStopped) or (i>=length(NewHoverElements)) then
|
|
|
- break;
|
|
|
- BubbleEl:=NewHoverElements[i];
|
|
|
- if MouseEvt is TBubbleMouseDownEvent then
|
|
|
- TBubbleMouseDownEvent(MouseEvt).SetXY(PageToContentPos(BubbleEl,NewPageXY))
|
|
|
- else if MouseEvt is TBubbleMouseUpEvent then
|
|
|
- TBubbleMouseUpEvent(MouseEvt).SetXY(PageToContentPos(BubbleEl,NewPageXY))
|
|
|
- else if MouseEvt is TBubbleMouseMoveEvent then
|
|
|
- TBubbleMouseMoveEvent(MouseEvt).SetXY(PageToContentPos(BubbleEl,NewPageXY))
|
|
|
- else
|
|
|
- break;
|
|
|
- until false;
|
|
|
+ case Hit of
|
|
|
+ THit.hScrollbarHorz: El.ScrollBarHorizontal.MouseHandler(WSData,MouseEventId);
|
|
|
+ THit.hScrollbarVert: El.ScrollBarVertical.MouseHandler(WSData,MouseEventId);
|
|
|
+ else
|
|
|
+ MouseEvt:=nil;
|
|
|
+ ClickEvt:=nil;
|
|
|
+ try
|
|
|
+ // Dispatch mouse down/move/up events, in stacking order top to bottom aka child to parent,
|
|
|
+ // until an element stops the dispatch.
|
|
|
+ i:=0;
|
|
|
+ MouseEvt:=El.EventDispatcher.CreateEvent(El,MouseEventId) as TFresnelMouseEvent;
|
|
|
+ MouseEvt.InitEvent(WSData);
|
|
|
+
|
|
|
+ BubbleEl:=El;
|
|
|
+ repeat
|
|
|
+ if MouseEvt is TBubbleMouseDownEvent then
|
|
|
+ TBubbleMouseDownEvent(MouseEvt).FElement:=BubbleEl
|
|
|
+ else if MouseEvt is TBubbleMouseUpEvent then
|
|
|
+ TBubbleMouseUpEvent(MouseEvt).FElement:=BubbleEl
|
|
|
+ else if MouseEvt is TBubbleMouseMoveEvent then
|
|
|
+ TBubbleMouseMoveEvent(MouseEvt).FElement:=BubbleEl;
|
|
|
+
|
|
|
+ {$IFDEF VerboseFresnelMouse}
|
|
|
+ writeln('TFresnelViewport.WSMouseXY ',MouseEventId,' ',BubbleEl.GetPath,' ',FloatToCSSStr(MouseEvt.X),',',FloatToCSSStr(MouseEvt.Y));
|
|
|
+ {$ENDIF}
|
|
|
+ BubbleEl.DispatchEvent(MouseEvt);
|
|
|
+ inc(i);
|
|
|
+ if (MouseEvt.PropagationStopped) or (i>=length(NewHoverElements)) then
|
|
|
+ break;
|
|
|
+ BubbleEl:=NewHoverElements[i];
|
|
|
+ if MouseEvt is TBubbleMouseDownEvent then
|
|
|
+ TBubbleMouseDownEvent(MouseEvt).SetXY(PageToContentPos(BubbleEl,NewPageXY))
|
|
|
+ else if MouseEvt is TBubbleMouseUpEvent then
|
|
|
+ TBubbleMouseUpEvent(MouseEvt).SetXY(PageToContentPos(BubbleEl,NewPageXY))
|
|
|
+ else if MouseEvt is TBubbleMouseMoveEvent then
|
|
|
+ TBubbleMouseMoveEvent(MouseEvt).SetXY(PageToContentPos(BubbleEl,NewPageXY))
|
|
|
+ else
|
|
|
+ break;
|
|
|
+ until false;
|
|
|
|
|
|
- FreeAndNil(MouseEvt);
|
|
|
+ FreeAndNil(MouseEvt);
|
|
|
|
|
|
|
|
|
- if (MouseEventId=evtMouseUp) and (VPApplication.GetMouseDownElement(OldPageXY)=El) then
|
|
|
- begin
|
|
|
- // dispatch click event up the element hierarchy
|
|
|
- ClickEvt:=El.EventDispatcher.CreateEvent(El,evtClick) as TFresnelMouseClickEvent;
|
|
|
- Bubble(El,ClickEvt);
|
|
|
- VPApplication.SetMouseDownElement(nil,NewPageXY);
|
|
|
- end;
|
|
|
+ if (MouseEventId=evtMouseUp) and (VPApplication.GetMouseDownElement(OldPageXY)=El) then
|
|
|
+ begin
|
|
|
+ // dispatch click event up the element hierarchy
|
|
|
+ ClickEvt:=El.EventDispatcher.CreateEvent(El,evtClick) as TFresnelMouseClickEvent;
|
|
|
+ Bubble(El,ClickEvt);
|
|
|
+ VPApplication.SetMouseDownElement(nil,NewPageXY);
|
|
|
+ end;
|
|
|
|
|
|
- // Focus gets set on mouse down. TrySetFocusControl will test whether the element actually can get focus.
|
|
|
- // Todo: Test what if a non-focus handling element is positioned over one which does handle focus ?
|
|
|
- // -> go over hover list ?
|
|
|
- if (MouseEventId=evtMouseDown) and Assigned(El) then
|
|
|
- TrySetFocusControl(El);
|
|
|
- finally
|
|
|
- MouseEvt.Free;
|
|
|
- ClickEvt.Free;
|
|
|
+ // Focus gets set on mouse down. TrySetFocusControl will test whether the element actually can get focus.
|
|
|
+ // Todo: Test what if a non-focus handling element is positioned over one which does handle focus ?
|
|
|
+ // -> go over hover list ?
|
|
|
+ if (MouseEventId=evtMouseDown) and Assigned(El) then
|
|
|
+ TrySetFocusControl(El);
|
|
|
+ finally
|
|
|
+ MouseEvt.Free;
|
|
|
+ ClickEvt.Free;
|
|
|
+ end;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
@@ -7296,9 +7365,8 @@ begin
|
|
|
lEvt.Sender:=lElement;
|
|
|
lElement.DispatchEvent(lEvt);
|
|
|
if lEvt.PropagationStopped then
|
|
|
- lElement:=Nil
|
|
|
- else
|
|
|
- lElement:=lElement.Parent;
|
|
|
+ exit;
|
|
|
+ lElement:=lElement.Parent;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -7316,7 +7384,7 @@ begin
|
|
|
lFocus:=Self;
|
|
|
lEvtClass:=EventDispatcher.Registry.FindEventClass(KeyEventID);
|
|
|
if not lEvtClass.InheritsFrom(TFresnelKeyEvent) then
|
|
|
- Raise EFresnel.CreateFmt('%s is not a descendent of class TFresnelKeyEvent',[lEvtClass.ClassName]);
|
|
|
+ Raise EFresnel.CreateFmt('%s is not a descendent of class TFresnelKeyEvent',[lEvtClass.ClassName]);
|
|
|
lEvt:=lKeyEvtClass.Create(WSData);
|
|
|
try
|
|
|
Bubble(lFocus,lEvt);
|
|
@@ -7331,7 +7399,6 @@ var
|
|
|
lFocus : TFresnelElement;
|
|
|
lEvt : TFresnelInputEvent;
|
|
|
|
|
|
-
|
|
|
begin
|
|
|
lFocus:=FFocusedElement;
|
|
|
if not Assigned(lFocus) then
|
|
@@ -7540,12 +7607,14 @@ procedure TFresnelElement.SetScrollLeft(const AValue: TFresnelLength);
|
|
|
begin
|
|
|
if FScrollLeft=AValue then Exit;
|
|
|
FScrollLeft:=AValue;
|
|
|
+ DomChanged;
|
|
|
end;
|
|
|
|
|
|
procedure TFresnelElement.SetScrollTop(const AValue: TFresnelLength);
|
|
|
begin
|
|
|
if FScrollTop=AValue then Exit;
|
|
|
FScrollTop:=AValue;
|
|
|
+ DomChanged;
|
|
|
end;
|
|
|
|
|
|
procedure TFresnelElement.SetViewportConnected(AValue: boolean);
|