* Patch from heliosroots. Closes merge request cd pas2js/

This commit is contained in:
Michael Van Canneyt 2021-12-21 14:15:45 +01:00
parent 184cdf3835
commit 2799118b26
2 changed files with 12 additions and 1 deletions
packages/webwidget

View File

@ -696,7 +696,7 @@ Type
Public
Constructor Create(aTable : TCustomTableWidget;aTableID : String); virtual;
Property Table : TCustomTableWidget Read FTable;
Property Column : TCustomTableColumn Read FColumn;
Property Column : TCustomTableColumn Read FColumn Write FColumn;
Property Row : Integer Read FRow;
Property Col : Integer Read FCol;
Property Kind : TRowKind Read FKind;
@ -3184,3 +3184,5 @@ end;
end.

View File

@ -377,6 +377,7 @@ Type
Class Function FindElement(aID : String) : TJSHTMLElement;
// Create element in DOM tree, set ID if it is nonzero
Class function CreateElement (aTag : String; aID : String) : TJSHTMLElement;
Class function CreateElement (aParent:TJSElement; aTag : String; aID : String) : TJSHTMLElement;
// references are relative to this element. By default, this is the element of the widget.
// override if you want for instance to indicate the parent element.
function GetReferenceElement: TJSHTMLELement; virtual;
@ -2737,6 +2738,14 @@ begin
Result.id:=aID;
end;
class function TCustomWebWidget.CreateElement(aParent: TJSElement;
aTag: String; aID: String): TJSHTMLElement;
begin
Result := CreateElement(aTag, aID);
if aParent <> nil then
aParent.appendChild(Result);
end;
function TCustomWebWidget.GetReferenceElement: TJSHTMLELement;
begin
Result:=Element;