* Namespaced version of webwidgets

This commit is contained in:
Michaël Van Canneyt 2023-11-27 21:55:06 +01:00
parent 975506af0b
commit 305ec178cd
14 changed files with 141 additions and 3 deletions

View File

@ -0,0 +1,3 @@
{$DEFINE FPC_DOTTEDUNITS}
unit Widget.DB;
{$include ../src/dbwebwidget.pp}

View File

@ -0,0 +1,3 @@
{$DEFINE FPC_DOTTEDUNITS}
unit Widget.HTML.DB;
{$include ../src/dbhtmlwidgets.pp}

View File

@ -0,0 +1,3 @@
{$DEFINE FPC_DOTTEDUNITS}
unit Widget.HTML;
{$include ../src/htmlwidgets.pp}

View File

@ -0,0 +1,3 @@
{$DEFINE FPC_DOTTEDUNITS}
unit Widget.PropertyGrid;
{$include ../src/propertygridwidget.pp}

View File

@ -0,0 +1,3 @@
{$DEFINE FPC_DOTTEDUNITS}
unit Widget.Web;
{$include ../src/webwidget.pas}

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Package Version="5">
<PathDelim Value="\"/>
<Name Value="lazwebwidgets_namespaced"/>
<Type Value="RunTimeOnly"/>
<AutoUpdate Value="Manually"/>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Other>
<ConfigFile>
<WriteConfigFilePath Value="$(PkgOutDir)\fpclaz.cfg"/>
</ConfigFile>
<ExecuteBefore>
<Command Value="$MakeExe(IDE,pas2js) -O- -Jc -vbq lazwebwidgets_namespaced.pas"/>
<Parsers Count="1">
<Item1 Value="Pas2JS"/>
</Parsers>
</ExecuteBefore>
</Other>
<SkipCompiler Value="True"/>
</CompilerOptions>
<Files Count="5">
<Item1>
<Filename Value="Widget.Web.pas"/>
<UnitName Value="Widget.Web"/>
</Item1>
<Item2>
<Filename Value="Widget.DB.pas"/>
<UnitName Value="Widget.DB"/>
</Item2>
<Item3>
<Filename Value="Widget.HTML.DB.pas"/>
<UnitName Value="Widget.HTML.DB"/>
</Item3>
<Item4>
<Filename Value="Widget.HTML.pas"/>
<UnitName Value="Widget.HTML"/>
</Item4>
<Item5>
<Filename Value="Widget.PropertyGrid.pas"/>
<UnitName Value="Widget.PropertyGrid"/>
</Item5>
</Files>
<CompatibilityMode Value="True"/>
<RequiredPkgs Count="3">
<Item1>
<PackageName Value="pas2js_rtl_namespaced"/>
</Item1>
<Item2>
<PackageName Value="fcl_base_pas2js_namespaced"/>
</Item2>
<Item3>
<PackageName Value="pas2js_fcldb_namespaced"/>
</Item3>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
</Package>
</CONFIG>

View File

@ -0,0 +1,15 @@
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}
unit lazwebwidgets_namespaced;
{$warn 5023 off : no warning about unused units}
interface
uses
Widget.Web, Widget.DB, Widget.HTML.DB, Widget.HTML, Widget.PropertyGrid;
implementation
end.

View File

@ -13,7 +13,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$IFNDEF FPC_DOTTEDUNITS}
unit dbhtmlwidgets;
{$ENDIF}
{$mode objfpc}
{$h+}
@ -21,7 +23,11 @@ unit dbhtmlwidgets;
interface
uses
{$IFDEF FPC_DOTTEDUNITS}
JSApi.JS, System.Classes, System.SysUtils, Data.DB, BrowserApi.Web, Widget.HTML;
{$ELSE}
JS, Classes, SysUtils, db, web, htmlwidgets;
{$ENDIF}
Type

View File

@ -13,8 +13,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$IFNDEF FPC_DOTTEDUNITS}
unit dbwebwidget;
{$ENDIF}
{$mode objfpc}
{$h+}
@ -24,7 +25,11 @@ unit dbwebwidget;
interface
uses
{$IFDEF FPC_DOTTEDUNITS}
System.SysUtils, System.Classes, Widget.Web, Data.DB;
{$ELSE}
SysUtils, Classes, webwidget, db;
{$ENDIF}
Type
TCustomDBLoopTemplateWidget = class;

View File

@ -13,7 +13,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$IFNDEF FPC_DOTTEDUNITS}
unit htmlwidgets;
{$ENDIF}
{$mode objfpc}
{$h+}
@ -21,7 +23,11 @@ unit htmlwidgets;
interface
uses
{$IFDEF FPC_DOTTEDUNITS}
System.Classes, System.SysUtils, Widget.Web, JSApi.JS, BrowserApi.Web;
{$ELSE}
Classes, SysUtils, webwidget, js, web;
{$ENDIF}
Type
TTextMode = (tmText,tmHTML);
@ -1037,7 +1043,12 @@ Const
implementation
uses DateUtils;
uses
{$IFDEF FPC_DOTTEDUNITS}
System.DateUtils;
{$ELSE}
DateUtils;
{$ENDIF}
resourcestring
SErrInvalidIndex = 'Index %d not in valid range of [0..%d]';

View File

@ -1,11 +1,17 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit propertygridwidget;
{$ENDIF}
{$mode objfpc}
interface
uses
{$IFDEF FPC_DOTTEDUNITS}
System.Classes, System.SysUtils, System.Types, BrowserApi.Web, Widget.Web, Widget.HTML, System.TypInfo, System.Contnrs;
{$ELSE}
Classes, SysUtils, types, web, webwidget, htmlwidgets, typinfo, contnrs;
{$ENDIF}
Type

View File

@ -13,14 +13,21 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$IFNDEF FPC_DOTTEDUNITS}
unit webwidget;
{$ENDIF}
{$mode objfpc}{$H+}
{$WARN 4501 off : }
interface
uses
{$IFDEF FPC_DOTTEDUNITS}
System.Types, System.Classes, System.SysUtils, JSApi.JS, BrowserApi.Web, BrowserApi.WebOrWorker;
{$ELSE}
Types, Classes, SysUtils, JS, Web, weborworker;
{$ENDIF}
Const
@ -988,7 +995,12 @@ Type
implementation
uses Strutils, TypInfo;
uses
{$IFDEF FPC_DOTTEDUNITS}
System.Strutils, System.TypInfo;
{$ELSE}
Strutils, TypInfo;
{$ENDIF}
ResourceString
SErrCannotSetParentAndElementID = 'ElementID and ParentID cannot be set at the same time.';