Skip to content

Commit

Permalink
Clean method create excess
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderlan.anjos@gmail.com committed Apr 3, 2013
1 parent 47eafd1 commit dc14b12
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 79 deletions.
37 changes: 5 additions & 32 deletions ExtJSWrapper/Ext.pas
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
unit Ext;

// Generated by JSToPascal v.0.9.9, at 03/04/2013 18:32:44
// Generated by JSToPascal v.0.9.9, at 03/04/2013 18:55:22
// from "\extpascal\ext-4.2.0\src

interface
Expand Down Expand Up @@ -3408,8 +3408,7 @@ TExtDrawSurface = class(TExtAbstractComponent)
function Capture(O : TExtUtilObservable; Fn : TExtFunction; Scope : TExtObject = nil) : TExtFunction;
function ClearListeners : TExtFunction;
function ClearManagedListeners : TExtFunction;
constructor Create(Config : TExtObject = nil); overload;
constructor Create(Config : TExtObject; EnginePriority : TArrayOfString = nil); overload;
constructor Create(Config : TExtObject; EnginePriority : TArrayOfString = nil);
function EnableBubble(EventNames : String) : TExtFunction; overload;
function EnableBubble(EventNames : TArrayOfString) : TExtFunction; overload;
function FireEvent(EventName : String; Args : TExtObjectList) : TExtFunction;
Expand Down Expand Up @@ -5688,8 +5687,7 @@ TExtDataProxy = class(TExtAbstractComponent)
function Capture(O : TExtUtilObservable; Fn : TExtFunction; Scope : TExtObject = nil) : TExtFunction;
function ClearListeners : TExtFunction;
function ClearManagedListeners : TExtFunction;
constructor Create(Config : TExtObject = nil); overload;
constructor Create; overload;
constructor Create;
function EnableBubble(EventNames : String) : TExtFunction; overload;
function EnableBubble(EventNames : TArrayOfString) : TExtFunction; overload;
function FireEvent(EventName : String; Args : TExtObjectList) : TExtFunction;
Expand Down Expand Up @@ -10361,8 +10359,7 @@ TExtDataStore = class(TExtDataAbstractStore)
function Collect(DataIndex : String; AllowNull : Boolean = false; BypassFilter : Boolean = false) : TExtFunction;
function CommitChanges : TExtFunction;
function Count(Grouped : Boolean = false) : TExtFunction;
constructor Create(Config : TExtObject = nil); overload;
constructor Create; overload;
constructor Create;
function Each(Fn : TExtFunction; Scope : TExtObject = nil) : TExtFunction;
function Filter(Filters : TExtObjectList; Value : String = '') : TExtFunction; overload;
function Filter(Filters : String = ''; Value : String = '') : TExtFunction; overload;
Expand Down Expand Up @@ -10589,8 +10586,7 @@ TExtStateCookieProvider = class(TExtStateProvider)
public
function JSClassName : string; override;
{$IFDEF FPC}constructor AddTo(List : TExtObjectList);{$ENDIF}
constructor Create(Config : TExtObject = nil); overload;
constructor Create; overload;
constructor Create;
property Domain : String read FDomain write SetFDomain;
property Expires : TDateTime read FExpires write SetFExpires;
property Path : String read FPath write SetFPath;
Expand Down Expand Up @@ -25766,11 +25762,6 @@ function TExtDrawSurface.ClearManagedListeners : TExtFunction; begin
Result := Self;
end;

constructor TExtDrawSurface.Create(Config : TExtObject = nil); begin
CreateVarAlt(JSClassName + '.create(' + VarToJSON([Config, false]) + ');');
InitDefaults;
end;

constructor TExtDrawSurface.Create(Config : TExtObject; EnginePriority : TArrayOfString = nil); begin
CreateVarAlt(JSClassName + '.create(' + VarToJSON([Config, false, EnginePriority]) + ');');
InitDefaults;
Expand Down Expand Up @@ -31968,12 +31959,6 @@ function TExtDataProxy.ClearManagedListeners : TExtFunction; begin
Result := Self;
end;

constructor TExtDataProxy.Create(Config : TExtObject = nil); begin
if Config = nil then CreateVar(JSClassName + '({});') else
CreateVar(JSClassName + '(' + VarToJSON([Config, false]) + ');');
InitDefaults;
end;

constructor TExtDataProxy.Create; begin
CreateVar(JSClassName + '({});');
InitDefaults;
Expand Down Expand Up @@ -43673,12 +43658,6 @@ function TExtDataStore.Count(Grouped : Boolean = false) : TExtFunction; begin
Result := Self;
end;

constructor TExtDataStore.Create(Config : TExtObject = nil); begin
if Config = nil then CreateVar(JSClassName + '({});') else
CreateVar(JSClassName + '(' + VarToJSON([Config, false]) + ');');
InitDefaults;
end;

constructor TExtDataStore.Create; begin
CreateVar(JSClassName + '({});');
InitDefaults;
Expand Down Expand Up @@ -44239,12 +44218,6 @@ procedure TExtStateCookieProvider.InitDefaults; begin

{$IFDEF FPC}constructor TExtStateCookieProvider.AddTo(List : TExtObjectList);begin inherited end;{$ENDIF}

constructor TExtStateCookieProvider.Create(Config : TExtObject = nil); begin
if Config = nil then CreateVar(JSClassName + '({});') else
CreateVar(JSClassName + '(' + VarToJSON([Config, false]) + ');');
InitDefaults;
end;

constructor TExtStateCookieProvider.Create; begin
CreateVar(JSClassName + '({});');
InitDefaults;
Expand Down
3 changes: 3 additions & 0 deletions ExtJSWrapper/ExtToPascal.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ begin
if Method.Name = 'Create' then begin
I := Cls.Methods.IndexOf('Create');
if I <> -1 then begin
if (Method.Params.Count = 0) or
((Method.Params.Count = 1) and TParam(Method.Params.Objects[0]).Optional) then
exit;
TMethod(Cls.Methods.Objects[I]).Overload := True;
Method.Overload := True;
end;
Expand Down
70 changes: 26 additions & 44 deletions ExtJSWrapper/ExtToPascal.dsk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Closed Files]
File_0=TSourceModule,'c:\program files (x86)\embarcadero\rad studio\10.0\SOURCE\RTL\SYS\System.pas',0,1,22052,1,22073,0,0,,
File_0=TSourceModule,'c:\program files (x86)\embarcadero\rad studio\10.0\SOURCE\RTL\SYS\System.pas',0,1,15025,1,15046,0,0,,
File_1=TSourceModule,'c:\program files (x86)\embarcadero\rad studio\10.0\source\rtl\common\System.Classes.pas',0,1,6619,1,6644,0,0,,
File_2=TSourceModule,'E:\extpascal\ext-4.2.0\src\window\MessageBox.js',0,1,353,1,148,0,0,,
File_3=TSourceModule,'E:\extpascal\ext-4.2.0\src\data\reader\Reader.js',0,1,280,23,302,0,0,,
Expand All @@ -21,50 +21,43 @@ File_18=TSourceModule,'E:\extpascal\ext-4.2.0\docs\resources\prettify\prettify.c
File_19=TSourceModule,'E:\extpascal\ext-4.2.0\examples\build\KitchenSink\ext-theme-access\lib\prettify\prettify.css',0,1,16,5,35,0,0,,

[Modules]
Module0=E:\extpascal\ExtJSWrapper\ExtToPascal.dproj
Module1=E:\extpascal\ExtJSWrapper\ExtFixes.txt
Module2=E:\extpascal\ExtJSWrapper\Ext.pas
Module3=E:\extpascal\ExtPascal.pas
Module0=E:\extpascal\ExtJSWrapper\Ext.pas
Module1=E:\extpascal\ExtJSWrapper\ExtToPascal.dproj
Module2=E:\extpascal\ExtPascal.pas
Module3=E:\extpascal\ExtJSWrapper\ExtFixes.txt
Module4=E:\extpascal\ExtPascalUtils.pas
Module5=E:\extpascal\ExtJSWrapper\ExtOld.pas
Count=6
Count=5
EditWindowCount=1

[E:\extpascal\ExtJSWrapper\ExtToPascal.dproj]
ModuleType=TBaseProject

[E:\extpascal\ExtJSWrapper\ExtFixes.txt]
ModuleType=TSourceModule

[E:\extpascal\ExtJSWrapper\Ext.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0

[E:\extpascal\ExtJSWrapper\ExtToPascal.dproj]
ModuleType=TBaseProject

[E:\extpascal\ExtPascal.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0

[E:\extpascal\ExtPascalUtils.pas]
[E:\extpascal\ExtJSWrapper\ExtFixes.txt]
ModuleType=TSourceModule
FormState=0
FormOnTop=0

[E:\extpascal\ExtJSWrapper\ExtOld.pas]
[E:\extpascal\ExtPascalUtils.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0

[EditWindow0]
ViewCount=6
CurrentEditView=E:\extpascal\ExtJSWrapper\ExtToPascal.dpr
ViewCount=5
CurrentEditView=E:\extpascal\ExtJSWrapper\Ext.pas
View0=0
View1=1
View2=2
View3=3
View4=4
View5=5
PercentageSizes=1
Create=1
Visible=1
Expand All @@ -83,7 +76,7 @@ BorlandEditorCodeExplorer=BorlandEditorCodeExplorer@EditWindow0
TopPanelSize=0
LeftPanelSize=1648
LeftPanelClients=DockSite2
LeftPanelData=00000800010100000000C11D00000000000001700600000000000001000000003125000009000000446F636B5369746532FFFFFFFF
LeftPanelData=000008000100000000009A1D00000000000000000000000000000001000000009A1D000009000000446F636B5369746532FFFFFFFF
RightPanelSize=0
BottomPanelSize=0
BottomPanelClients=DockSite1
Expand All @@ -95,9 +88,9 @@ BottomMiddelPanelData=0000080001020200000009000000446F636B5369746530100000004772
[View0]
CustomEditViewType=TEditView
Module=E:\extpascal\ExtJSWrapper\Ext.pas
CursorX=18
CursorY=491
TopLine=472
CursorX=23
CursorY=3040
TopLine=3018
LeftCol=1
Elisions=
Bookmarks=
Expand All @@ -106,9 +99,9 @@ EditViewName=E:\extpascal\ExtJSWrapper\Ext.pas
[View1]
CustomEditViewType=TEditView
Module=E:\extpascal\ExtJSWrapper\ExtToPascal.dpr
CursorX=32
CursorY=746
TopLine=726
CursorX=3
CursorY=15
TopLine=1
LeftCol=1
Elisions=
Bookmarks=
Expand All @@ -128,9 +121,9 @@ EditViewName=E:\extpascal\ExtPascal.pas
[View3]
CustomEditViewType=TEditView
Module=E:\extpascal\ExtJSWrapper\ExtFixes.txt
CursorX=24
CursorY=37
TopLine=28
CursorX=17
CursorY=93
TopLine=73
LeftCol=1
Elisions=
Bookmarks=
Expand All @@ -147,21 +140,10 @@ Elisions=
Bookmarks=
EditViewName=E:\extpascal\ExtPascalUtils.pas

[View5]
CustomEditViewType=TEditView
Module=E:\extpascal\ExtJSWrapper\ExtOld.pas
CursorX=52
CursorY=35805
TopLine=35799
LeftCol=1
Elisions=
Bookmarks=
EditViewName=E:\extpascal\ExtJSWrapper\ExtOld.pas

[Watches]
Count=4
Watch0='Matches[2]',256,0,18,1,0,'Watches',1
Watch1='CurClass.Name',256,0,18,1,0,'Watches',1
Watch0='Result',256,0,18,1,0,'Watches',1
Watch1='Ident',256,0,18,1,0,'Watches',1
Watch2='M.Methods[I]',256,0,18,1,0,'Watches',1
Watch3='TMethod(M.Methods.Objects[I]).Overload',256,0,18,1,0,'Watches',1

Expand Down Expand Up @@ -729,5 +711,5 @@ Dockable=1
StayOnTop=0
TabPosition=1
ActiveTabID=ProjectManager
TabDockClients=ProjectManager,ToolForm,PropertyInspector,StructureView,DataExplorerContainer,ModelViewTool,ClassBrowserTool,TemplateView,TFileExplorerForm
TabDockClients=ProjectManager,ToolForm,PropertyInspector,StructureView,DataExplorerContainer,ModelViewTool,TFileExplorerForm,TemplateView,ClassBrowserTool

6 changes: 3 additions & 3 deletions ExtPascalSamples/LayoutWindow.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface
type
TLayoutWindow = class(TExtWindow)
constructor Create;
procedure ExtTabPanelOnTabchange(AThis : TExtTabPanel; NewTab, OldTab : TExtPanel);
procedure ExtTabPanelOnTabchange(AThis : TExtTabPanel; NewTab, OldTab : TExtComponent);
end;

implementation
Expand Down Expand Up @@ -64,8 +64,8 @@ constructor TLayoutWindow.Create;
SelfSession.AddShowSourceButton(Buttons, 'LayoutWindow');
end;

procedure TLayoutWindow.ExtTabPanelOnTabchange(AThis : TExtTabPanel; NewTab, OldTab : TExtPanel); begin
ExtMessageBox.Alert('Active Tab is', NewTab.Title);
procedure TLayoutWindow.ExtTabPanelOnTabchange(AThis : TExtTabPanel; NewTab, OldTab : TExtComponent); begin
ExtMessageBox.Alert('Active Tab is', TExtTabPanel(NewTab).Title);
end;

end.

0 comments on commit dc14b12

Please sign in to comment.