Explorar o código

* ClearContents added

Michaël Van Canneyt %!s(int64=2) %!d(string=hai) anos
pai
achega
a30c313d3e
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      packages/webwidget/webwidget.pas

+ 8 - 0
packages/webwidget/webwidget.pas

@@ -456,6 +456,8 @@ Type
   Public
     Constructor Create(aOwner : TComponent); override;
     Destructor Destroy; override;
+    // Clear content
+    Procedure ClearContent; virtual;
     // Does this element allow childern ?
     Class Function AllowChildren : Boolean; virtual;
     // Manipulate Classes
@@ -3000,6 +3002,12 @@ begin
   inherited Destroy;
 end;
 
+procedure TCustomWebWidget.ClearContent;
+begin
+  if Assigned(FElement) then
+    FElement.InnerHTML:='';
+end;
+
 class function TCustomWebWidget.AllowChildren: Boolean;
 begin
   Result:=True;