You've already forked lazarus-ccr
* Removed obsolete SaveAsXIB functionality
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2640 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -117,7 +117,6 @@ type
|
|||||||
FParent: tiOSFakeComponent;
|
FParent: tiOSFakeComponent;
|
||||||
// iOS
|
// iOS
|
||||||
procedure AddChildToDom(const AValue: tiOSFakeComponent);
|
procedure AddChildToDom(const AValue: tiOSFakeComponent);
|
||||||
function ElementToString(AWriteDomMethod: tiOSWriteDomMethod): string;
|
|
||||||
function GetObjectID: integer;
|
function GetObjectID: integer;
|
||||||
function GetPosition(APosition: TiOSXIBPos): integer;
|
function GetPosition(APosition: TiOSXIBPos): integer;
|
||||||
function GetRef: integer;
|
function GetRef: integer;
|
||||||
@ -151,10 +150,6 @@ type
|
|||||||
procedure SetName(const NewName: TComponentName); override;
|
procedure SetName(const NewName: TComponentName); override;
|
||||||
// iOS
|
// iOS
|
||||||
procedure AddConnectionRecord(AnObjectDomElement: TDOMElement; AConnectionType, ALabel, AEventType: string);
|
procedure AddConnectionRecord(AnObjectDomElement: TDOMElement; AConnectionType, ALabel, AEventType: string);
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); virtual;
|
|
||||||
function WriteToObject(AnObjectDomElement: TDOMElement): TDOMElement; virtual;
|
|
||||||
function WriteToConnectionRecords(AnObjectDomElement: TDOMElement): TDOMElement; virtual;
|
|
||||||
function WriteToObjectRecord(AnObjectDomElement: TDOMElement): TDOMElement; virtual;
|
|
||||||
class function GetIBClassName: string; virtual;
|
class function GetIBClassName: string; virtual;
|
||||||
function GetDesigner: IMyWidgetDesigner; virtual;
|
function GetDesigner: IMyWidgetDesigner; virtual;
|
||||||
function GetHeight: integer; virtual;
|
function GetHeight: integer; virtual;
|
||||||
@ -200,9 +195,6 @@ type
|
|||||||
property Children[Index: integer]: tiOSFakeComponent read GetChilds;
|
property Children[Index: integer]: tiOSFakeComponent read GetChilds;
|
||||||
property AcceptChildsAtDesignTime: boolean read FAcceptChildsAtDesignTime;
|
property AcceptChildsAtDesignTime: boolean read FAcceptChildsAtDesignTime;
|
||||||
// iOS
|
// iOS
|
||||||
function getAsXIBObject: string; virtual;
|
|
||||||
function getConnectionRecords: string; virtual;
|
|
||||||
function getObjectRecord: string; virtual;
|
|
||||||
property Ref: integer read GetRef;
|
property Ref: integer read GetRef;
|
||||||
property ObjectID: integer read GetObjectID;
|
property ObjectID: integer read GetObjectID;
|
||||||
// Dom utils
|
// Dom utils
|
||||||
@ -241,7 +233,6 @@ type
|
|||||||
procedure SetNSSuperView(AValue: UIView);
|
procedure SetNSSuperView(AValue: UIView);
|
||||||
protected
|
protected
|
||||||
procedure SetName(const NewName: TComponentName); override;
|
procedure SetName(const NewName: TComponentName); override;
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
procedure InitializeDefaults; override;
|
procedure InitializeDefaults; override;
|
||||||
@ -269,7 +260,6 @@ type
|
|||||||
FWidth, FHeight: integer;
|
FWidth, FHeight: integer;
|
||||||
FXIBUsesObjectsForArrays: boolean;
|
FXIBUsesObjectsForArrays: boolean;
|
||||||
function GetFilesOwnerOutletName: string;
|
function GetFilesOwnerOutletName: string;
|
||||||
procedure GetXIBSaveParam(Sender: TObject; const ParamName: String; out AValue: String);
|
|
||||||
function IsNIBRoot: boolean;
|
function IsNIBRoot: boolean;
|
||||||
function GetFilesOwnerID: string;
|
function GetFilesOwnerID: string;
|
||||||
procedure SetFilesOwnerOutletName(AValue: string);
|
procedure SetFilesOwnerOutletName(AValue: string);
|
||||||
@ -286,10 +276,6 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure SaveAsXIB(const Filename: string);
|
|
||||||
function getObjectRecord: string; override;
|
|
||||||
function getAsXIBObject: string; override;
|
|
||||||
function getConnectionRecords: string; override;
|
|
||||||
function GetDesigner: IMyWidgetDesigner; override;
|
function GetDesigner: IMyWidgetDesigner; override;
|
||||||
procedure InitializeDefaults; override;
|
procedure InitializeDefaults; override;
|
||||||
class function GetIBClassName: string; override;
|
class function GetIBClassName: string; override;
|
||||||
@ -310,7 +296,6 @@ type
|
|||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
function StoreSizeAsFrameSize: boolean; override;
|
function StoreSizeAsFrameSize: boolean; override;
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
procedure SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer); override;
|
procedure SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer); override;
|
||||||
public
|
public
|
||||||
procedure InitializeDefaults; override;
|
procedure InitializeDefaults; override;
|
||||||
@ -324,7 +309,6 @@ type
|
|||||||
|
|
||||||
UIViewController = class(tiOSFakeComponent)
|
UIViewController = class(tiOSFakeComponent)
|
||||||
protected
|
protected
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
function GetHeight: integer; override;
|
function GetHeight: integer; override;
|
||||||
function GetWidth: integer; override;
|
function GetWidth: integer; override;
|
||||||
procedure SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer); override;
|
procedure SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer); override;
|
||||||
@ -337,7 +321,6 @@ type
|
|||||||
|
|
||||||
UINavigationBar = class(UIView)
|
UINavigationBar = class(UIView)
|
||||||
protected
|
protected
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
procedure SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer); override;
|
procedure SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer); override;
|
||||||
procedure paint(ACanvas: TCanvas); override;
|
procedure paint(ACanvas: TCanvas); override;
|
||||||
public
|
public
|
||||||
@ -361,7 +344,6 @@ type
|
|||||||
UINavigationController = class(UIViewController)
|
UINavigationController = class(UIViewController)
|
||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
procedure SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer); override;
|
procedure SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer); override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -376,9 +358,6 @@ type
|
|||||||
private
|
private
|
||||||
FNSNextKeyView: UIView;
|
FNSNextKeyView: UIView;
|
||||||
FTextColor: TColor;
|
FTextColor: TColor;
|
||||||
protected
|
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
function WriteToConnectionRecords(AnObjectDomElement: TDOMElement): TDOMElement; override;
|
|
||||||
public
|
public
|
||||||
procedure InitializeDefaults; override;
|
procedure InitializeDefaults; override;
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -401,8 +380,6 @@ type
|
|||||||
FTextAlignment: TiOSFakeAlignment;
|
FTextAlignment: TiOSFakeAlignment;
|
||||||
FTextColor: TColor;
|
FTextColor: TColor;
|
||||||
procedure SetFont(AValue: TiOSFakeFontDescription);
|
procedure SetFont(AValue: TiOSFakeFontDescription);
|
||||||
protected
|
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -425,8 +402,6 @@ type
|
|||||||
FPlaceholder: string;
|
FPlaceholder: string;
|
||||||
FText: string;
|
FText: string;
|
||||||
FTextAlignment: TiOSFakeAlignment;
|
FTextAlignment: TiOSFakeAlignment;
|
||||||
protected
|
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -450,8 +425,6 @@ type
|
|||||||
FSectionHeaderHeight: float;
|
FSectionHeaderHeight: float;
|
||||||
FSeparatorColor: TColor;
|
FSeparatorColor: TColor;
|
||||||
FSeparatorStyle: TiOSFakeSeparatorStyle;
|
FSeparatorStyle: TiOSFakeSeparatorStyle;
|
||||||
protected
|
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -472,8 +445,6 @@ type
|
|||||||
FPlaceholder: string;
|
FPlaceholder: string;
|
||||||
FPrompt: string;
|
FPrompt: string;
|
||||||
FText: string;
|
FText: string;
|
||||||
protected
|
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -494,8 +465,6 @@ type
|
|||||||
FprogressTintColor: TColor;
|
FprogressTintColor: TColor;
|
||||||
FProgressViewStyle: TiOSFakeProgressViewStyle;
|
FProgressViewStyle: TiOSFakeProgressViewStyle;
|
||||||
FtrackTintColor: TColor;
|
FtrackTintColor: TColor;
|
||||||
protected
|
|
||||||
procedure WriteToDomElement(AnObjectDomElement: TDOMElement); override;
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
class function GetIBClassName: string; override;
|
class function GetIBClassName: string; override;
|
||||||
@ -1311,7 +1280,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ UIProgressView }
|
{ UIProgressView }
|
||||||
|
{
|
||||||
procedure UIProgressView.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UIProgressView.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
begin
|
begin
|
||||||
inherited WriteToDomElement(AnObjectDomElement);
|
inherited WriteToDomElement(AnObjectDomElement);
|
||||||
@ -1320,7 +1289,7 @@ begin
|
|||||||
AddIBColor(AnObjectDomElement,'IBUIProgressTintColor',progressTintColor);
|
AddIBColor(AnObjectDomElement,'IBUIProgressTintColor',progressTintColor);
|
||||||
AddIBColor(AnObjectDomElement,'IBUITrackTintColor',trackTintColor);
|
AddIBColor(AnObjectDomElement,'IBUITrackTintColor',trackTintColor);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
constructor UIProgressView.Create(AOwner: TComponent);
|
constructor UIProgressView.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
@ -1361,7 +1330,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ UIViewController }
|
{ UIViewController }
|
||||||
|
{
|
||||||
procedure UIViewController.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UIViewController.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
var
|
var
|
||||||
ASubElement: TDOMElement;
|
ASubElement: TDOMElement;
|
||||||
@ -1378,7 +1347,7 @@ begin
|
|||||||
ASubElement.AttribStrings['key']:=Children[i].GetIBClassName;
|
ASubElement.AttribStrings['key']:=Children[i].GetIBClassName;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
function UIViewController.GetHeight: integer;
|
function UIViewController.GetHeight: integer;
|
||||||
begin
|
begin
|
||||||
{ if FHeight<>0 then
|
{ if FHeight<>0 then
|
||||||
@ -1423,7 +1392,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ UINavigationBar }
|
{ UINavigationBar }
|
||||||
|
{
|
||||||
procedure UINavigationBar.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UINavigationBar.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
var
|
var
|
||||||
AnElement: TDOMElement;
|
AnElement: TDOMElement;
|
||||||
@ -1433,7 +1402,7 @@ begin
|
|||||||
if assigned(AnElement) then
|
if assigned(AnElement) then
|
||||||
AnElement.NodeValue:='{{0, -44}, {0, 44}}';
|
AnElement.NodeValue:='{{0, -44}, {0, 44}}';
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
procedure UINavigationBar.SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer);
|
procedure UINavigationBar.SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer);
|
||||||
begin
|
begin
|
||||||
inherited SetBounds(0, 0, 0, 0);
|
inherited SetBounds(0, 0, 0, 0);
|
||||||
@ -1456,7 +1425,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ UINavigationController }
|
{ UINavigationController }
|
||||||
|
{
|
||||||
procedure UINavigationController.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UINavigationController.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
var
|
var
|
||||||
NavigationBarElement: TDOMElement;
|
NavigationBarElement: TDOMElement;
|
||||||
@ -1486,7 +1455,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
procedure UINavigationController.SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer);
|
procedure UINavigationController.SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer);
|
||||||
begin
|
begin
|
||||||
inherited SetBounds(NewLeft, NewTop, Width, Height);
|
inherited SetBounds(NewLeft, NewTop, Width, Height);
|
||||||
@ -1537,7 +1506,7 @@ function UIWindow.StoreSizeAsFrameSize: boolean;
|
|||||||
begin
|
begin
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
{
|
||||||
procedure UIWindow.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UIWindow.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
begin
|
begin
|
||||||
inherited WriteToDomElement(AnObjectDomElement);
|
inherited WriteToDomElement(AnObjectDomElement);
|
||||||
@ -1545,7 +1514,7 @@ begin
|
|||||||
AddIBString(AnObjectDomElement,'targetRuntimeIdentifier','IBCocoaTouchFramework');
|
AddIBString(AnObjectDomElement,'targetRuntimeIdentifier','IBCocoaTouchFramework');
|
||||||
AddIBBoolean(AnObjectDomElement,'IBUIResizesToFullScreen',True);
|
AddIBBoolean(AnObjectDomElement,'IBUIResizesToFullScreen',True);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
procedure UIWindow.SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer);
|
procedure UIWindow.SetBounds(NewLeft, NewTop, NewWidth, NewHeight: integer);
|
||||||
begin
|
begin
|
||||||
inherited SetBounds(NewLeft, NewTop, Width, Height);
|
inherited SetBounds(NewLeft, NewTop, Width, Height);
|
||||||
@ -1585,40 +1554,6 @@ end;
|
|||||||
|
|
||||||
{ NSObject }
|
{ NSObject }
|
||||||
|
|
||||||
procedure NSObject.GetXIBSaveParam(Sender: TObject; const ParamName: String; out AValue: String);
|
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
begin
|
|
||||||
if ParamName='Objects' then
|
|
||||||
begin
|
|
||||||
AValue:=getAsXIBObject;
|
|
||||||
for i := 0 to self.ChildCount-1 do
|
|
||||||
begin
|
|
||||||
avalue := AValue + self.Children[i].getAsXIBObject;
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else if ParamName='flattenedProperties' then
|
|
||||||
begin
|
|
||||||
AValue := GetFlattenedProperties;
|
|
||||||
end
|
|
||||||
else if ParamName='ConnectionRecords' then
|
|
||||||
begin
|
|
||||||
avalue := getConnectionRecords;
|
|
||||||
for i := 0 to self.ChildCount-1 do
|
|
||||||
begin
|
|
||||||
avalue := AValue + self.Children[i].getConnectionRecords;
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else if ParamName='ObjectRecords' then
|
|
||||||
begin
|
|
||||||
AValue := getObjectRecord;
|
|
||||||
for i := 0 to self.ChildCount-1 do
|
|
||||||
begin
|
|
||||||
avalue := AValue + self.Children[i].getObjectRecord;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function NSObject.GetFilesOwnerOutletName: string;
|
function NSObject.GetFilesOwnerOutletName: string;
|
||||||
var
|
var
|
||||||
AnElement: TDOMElement;
|
AnElement: TDOMElement;
|
||||||
@ -1788,81 +1723,6 @@ begin
|
|||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function NSObject.getObjectRecord: string;
|
|
||||||
begin
|
|
||||||
if IsNIBRoot then
|
|
||||||
begin
|
|
||||||
// ObjectRecord's for the File's Owner and First Responder
|
|
||||||
result :=
|
|
||||||
'<object class="IBObjectRecord">' + LineEnding +
|
|
||||||
' <int key="objectID">-1</int>' +LineEnding +
|
|
||||||
' <reference key="object" ref="'+GetFilesOwnerID+'"/>' + LineEnding +
|
|
||||||
' <reference key="parent" ref="0"/>' + LineEnding +
|
|
||||||
' <string key="objectName">File''s Owner</string>' + LineEnding +
|
|
||||||
'</object>' + LineEnding +
|
|
||||||
'<object class="IBObjectRecord">' + LineEnding +
|
|
||||||
' <int key="objectID">-2</int>' + LineEnding +
|
|
||||||
' <reference key="object" ref="427554174"/>' + LineEnding +
|
|
||||||
' <reference key="parent" ref="0"/>' + LineEnding +
|
|
||||||
'</object>'+ LineEnding;
|
|
||||||
if IsHiddenObject then
|
|
||||||
result := result +
|
|
||||||
'<object class="IBObjectRecord">' + LineEnding +
|
|
||||||
' <int key="objectID">3</int>' + LineEnding +
|
|
||||||
' <reference key="object" ref="664661524"/>' + LineEnding +
|
|
||||||
' <reference key="parent" ref="0"/>' + LineEnding +
|
|
||||||
'</object>' + LineEnding;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
result := inherited getObjectRecord;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function NSObject.getAsXIBObject: string;
|
|
||||||
begin
|
|
||||||
if IsNIBRoot then
|
|
||||||
begin
|
|
||||||
// Objects for the File's Owner and First Responder
|
|
||||||
result :=
|
|
||||||
// File's owner
|
|
||||||
'<object class="IBProxyObject" id="'+GetFilesOwnerID+'">' + LineEnding +
|
|
||||||
' <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>' + LineEnding +
|
|
||||||
' <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>' + LineEnding +
|
|
||||||
'</object>' + LineEnding +
|
|
||||||
// First responder
|
|
||||||
'<object class="IBProxyObject" id="427554174">' + LineEnding +
|
|
||||||
' <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>' + LineEnding +
|
|
||||||
' <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>' + LineEnding +
|
|
||||||
'</object>' + LineEnding;
|
|
||||||
if IsHiddenObject then
|
|
||||||
result := result +
|
|
||||||
'<object class="IBUICustomObject" id="664661524">' + LineEnding +
|
|
||||||
' <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>' + LineEnding +
|
|
||||||
'</object>' + LineEnding;
|
|
||||||
|
|
||||||
end
|
|
||||||
else
|
|
||||||
result := inherited getObjectRecord;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function NSObject.getConnectionRecords: string;
|
|
||||||
begin
|
|
||||||
if IsNIBRoot then
|
|
||||||
begin
|
|
||||||
if IsHiddenObject then
|
|
||||||
result := result +
|
|
||||||
'<object class="IBConnectionRecord">' + LineEnding +
|
|
||||||
' <object class="IBCocoaTouchOutletConnection" key="connection">' + LineEnding +
|
|
||||||
' <string key="label">delegate</string>' + LineEnding +
|
|
||||||
' <reference key="source" ref="'+GetFilesOwnerID+'"/>' + LineEnding +
|
|
||||||
' <reference key="destination" ref="664661524"/>' + LineEnding +
|
|
||||||
' </object>' + LineEnding +
|
|
||||||
' <int key="connectionID">4</int>' + LineEnding +
|
|
||||||
'</object>' + LineEnding;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Result:=inherited getConnectionRecords;
|
|
||||||
end;
|
|
||||||
|
|
||||||
constructor NSObject.Create(AOwner: TComponent);
|
constructor NSObject.Create(AOwner: TComponent);
|
||||||
var
|
var
|
||||||
ss: TStringStream;
|
ss: TStringStream;
|
||||||
@ -1992,43 +1852,6 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure NSObject.SaveAsXIB(const Filename: string);
|
|
||||||
var
|
|
||||||
ATemplate: TFPTemplate;
|
|
||||||
fs: TFileStream;
|
|
||||||
s: string;
|
|
||||||
dir: string;
|
|
||||||
|
|
||||||
begin
|
|
||||||
ATemplate := TFPTemplate.Create;
|
|
||||||
try
|
|
||||||
ATemplate.StartDelimiter:='[{';
|
|
||||||
ATemplate.EndDelimiter:='}]';
|
|
||||||
|
|
||||||
{$ifndef OutsideIDE}
|
|
||||||
dir := '$PkgDir(iOSDesigner)';
|
|
||||||
IDEMacros.SubstituteMacros(dir);
|
|
||||||
{$else}
|
|
||||||
dir := '/Users/joost/svn/ccr-components/iosdesigner';
|
|
||||||
{$endif OutsideIDE}
|
|
||||||
if dir <>'' then
|
|
||||||
ATemplate.FileName:=dir+PathDelim+ 'MainWindow_iPhone.template'
|
|
||||||
else
|
|
||||||
raise exception.create('iOSDesigner package could not be found.');
|
|
||||||
|
|
||||||
ATemplate.OnGetParam :=@GetXIBSaveParam;
|
|
||||||
s := ATemplate.GetContent;
|
|
||||||
fs := TFileStream.Create(Filename,fmCreate);
|
|
||||||
try
|
|
||||||
fs.Write(s[1],length(s));
|
|
||||||
finally
|
|
||||||
fs.free;
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
ATemplate.Free;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function NSObject.GetDesigner: IMyWidgetDesigner;
|
function NSObject.GetDesigner: IMyWidgetDesigner;
|
||||||
begin
|
begin
|
||||||
Result:=Designer;
|
Result:=Designer;
|
||||||
@ -2151,32 +1974,6 @@ begin
|
|||||||
SetBounds(AValue,Top,Width,Height);
|
SetBounds(AValue,Top,Width,Height);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function tiOSFakeComponent.ElementToString(AWriteDomMethod: tiOSWriteDomMethod): string;
|
|
||||||
var
|
|
||||||
XMLDoc: TXMLDocument;
|
|
||||||
AStream: TStringStream;
|
|
||||||
RootElement: TDOMElement;
|
|
||||||
i: integer;
|
|
||||||
begin
|
|
||||||
XMLDoc := TXMLDocument.Create;
|
|
||||||
try
|
|
||||||
RootElement := XMLDoc.CreateElement('root');
|
|
||||||
XMLDoc.AppendChild(RootElement);
|
|
||||||
AWriteDomMethod(RootElement);
|
|
||||||
|
|
||||||
AStream := TStringStream.Create('');
|
|
||||||
try
|
|
||||||
for i := 0 to RootElement.ChildNodes.Count-1 do
|
|
||||||
WriteXML(RootElement.ChildNodes.Item[i],AStream);
|
|
||||||
result := AStream.DataString;
|
|
||||||
finally
|
|
||||||
AStream.Free;
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
XMLDoc.Free;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function tiOSFakeComponent.GetObjectID: integer;
|
function tiOSFakeComponent.GetObjectID: integer;
|
||||||
var
|
var
|
||||||
ANode: TDOMNode;
|
ANode: TDOMNode;
|
||||||
@ -2842,71 +2639,6 @@ begin
|
|||||||
AddIBInt(IBConnectionElement,'IBEventType',StrToInt64Def(AEventType,1));
|
AddIBInt(IBConnectionElement,'IBEventType',StrToInt64Def(AEventType,1));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure tiOSFakeComponent.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
|
||||||
var
|
|
||||||
ChildsMutableArray: TDOMElement;
|
|
||||||
i: Integer;
|
|
||||||
begin
|
|
||||||
if ChildCount>0 then
|
|
||||||
begin
|
|
||||||
ChildsMutableArray := AddIBObject(AnObjectDomElement,'NSSubviews','NSMutableArray');
|
|
||||||
AddIBBoolean(ChildsMutableArray,'EncodedWithXMLCoder',true);
|
|
||||||
for i := 0 to ChildCount-1 do
|
|
||||||
Children[i].WriteToObject(ChildsMutableArray);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function tiOSFakeComponent.WriteToObject(AnObjectDomElement: TDOMElement) : TDOMElement;
|
|
||||||
var
|
|
||||||
ClassDomElement: TDOMElement;
|
|
||||||
AnAttribute: TDOMNode;
|
|
||||||
|
|
||||||
begin
|
|
||||||
ClassDomElement := AddIBObject(AnObjectDomElement,'',GetIBClassName);
|
|
||||||
ClassDomElement.AttribStrings['id']:=IntToStr(Ref);
|
|
||||||
|
|
||||||
WriteToDomElement(ClassDomElement);
|
|
||||||
result := ClassDomElement;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function tiOSFakeComponent.WriteToConnectionRecords(
|
|
||||||
AnObjectDomElement: TDOMElement): TDOMElement;
|
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
begin
|
|
||||||
AddConnectionRecord(AnObjectDomElement,'IBCocoaTouchOutletConnection',Name,'');
|
|
||||||
for i := 0 to ChildCount-1 do
|
|
||||||
Children[i].WriteToConnectionRecords(AnObjectDomElement);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function tiOSFakeComponent.WriteToObjectRecord(AnObjectDomElement: TDOMElement
|
|
||||||
): TDOMElement;
|
|
||||||
var
|
|
||||||
ObjectRecordElement: TDOMElement;
|
|
||||||
ChildArray: TDOMElement;
|
|
||||||
i: Integer;
|
|
||||||
begin
|
|
||||||
ObjectRecordElement := AddIBObject(AnObjectDomElement,'','IBObjectRecord');
|
|
||||||
AddIBInt(ObjectRecordElement,'objectID',ObjectID);
|
|
||||||
AddIBReference(ObjectRecordElement,'object',self,True);
|
|
||||||
|
|
||||||
if ChildCount>0 then
|
|
||||||
begin
|
|
||||||
ChildArray := AddIBObject(ObjectRecordElement,'children','NSMutableArray');
|
|
||||||
AddIBBoolean(ChildArray,'EncodedWithXMLCoder',True);
|
|
||||||
for i := 0 to ChildCount-1 do
|
|
||||||
AddIBReference(ChildArray,'',Children[i]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
if assigned(Parent) then
|
|
||||||
AddIBReference(ObjectRecordElement,'parent',parent)
|
|
||||||
else
|
|
||||||
AddIBReference(ObjectRecordElement,'parent','0');
|
|
||||||
for i := 0 to ChildCount-1 do
|
|
||||||
Children[i].WriteToObjectRecord(AnObjectDomElement);
|
|
||||||
result := ObjectRecordElement;
|
|
||||||
end;
|
|
||||||
|
|
||||||
class function tiOSFakeComponent.GetIBClassName: string;
|
class function tiOSFakeComponent.GetIBClassName: string;
|
||||||
begin
|
begin
|
||||||
result := '';
|
result := '';
|
||||||
@ -3007,23 +2739,6 @@ begin
|
|||||||
Result:=FChilds.Count;
|
Result:=FChilds.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function tiOSFakeComponent.getAsXIBObject: string;
|
|
||||||
begin
|
|
||||||
result := ElementToString(@WriteToObject);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function tiOSFakeComponent.getConnectionRecords: string;
|
|
||||||
begin
|
|
||||||
result := ElementToString(@WriteToConnectionRecords);
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function tiOSFakeComponent.getObjectRecord: string;
|
|
||||||
|
|
||||||
begin
|
|
||||||
result := ElementToString(@WriteToObjectRecord);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function tiOSFakeComponent.AddElement(ADomNode: TDomElement; AName: string): TDOMElement;
|
function tiOSFakeComponent.AddElement(ADomNode: TDomElement; AName: string): TDOMElement;
|
||||||
begin
|
begin
|
||||||
result := ADomNode.OwnerDocument.CreateElement(AName);
|
result := ADomNode.OwnerDocument.CreateElement(AName);
|
||||||
@ -3178,7 +2893,7 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
{ UISearchBar }
|
{ UISearchBar }
|
||||||
|
{
|
||||||
procedure UISearchBar.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UISearchBar.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
begin
|
begin
|
||||||
inherited WriteToDomElement(AnObjectDomElement);
|
inherited WriteToDomElement(AnObjectDomElement);
|
||||||
@ -3186,7 +2901,7 @@ begin
|
|||||||
AddIBString(AnObjectDomElement,'IBPlaceholder',Placeholder);
|
AddIBString(AnObjectDomElement,'IBPlaceholder',Placeholder);
|
||||||
AddIBString(AnObjectDomElement,'IBPrompt',Prompt);
|
AddIBString(AnObjectDomElement,'IBPrompt',Prompt);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
constructor UISearchBar.Create(AOwner: TComponent);
|
constructor UISearchBar.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
@ -3204,7 +2919,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ UITableView }
|
{ UITableView }
|
||||||
|
{
|
||||||
procedure UITableView.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UITableView.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
begin
|
begin
|
||||||
inherited WriteToDomElement(AnObjectDomElement);
|
inherited WriteToDomElement(AnObjectDomElement);
|
||||||
@ -3215,7 +2930,7 @@ begin
|
|||||||
AddIBColor(AnObjectDomElement,'IBUISeparatorColor',SeparatorColor);
|
AddIBColor(AnObjectDomElement,'IBUISeparatorColor',SeparatorColor);
|
||||||
AddIBBoolean(AnObjectDomElement,'IBUIClipsSubviews',ClipSubviews);
|
AddIBBoolean(AnObjectDomElement,'IBUIClipsSubviews',ClipSubviews);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
constructor UITableView.Create(AOwner: TComponent);
|
constructor UITableView.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
@ -3240,7 +2955,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ UITextField }
|
{ UITextField }
|
||||||
|
{
|
||||||
procedure UITextField.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UITextField.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
begin
|
begin
|
||||||
inherited WriteToDomElement(AnObjectDomElement);
|
inherited WriteToDomElement(AnObjectDomElement);
|
||||||
@ -3248,7 +2963,7 @@ begin
|
|||||||
AddIBString(AnObjectDomElement,'IBUIPlaceholder',Placeholder);
|
AddIBString(AnObjectDomElement,'IBUIPlaceholder',Placeholder);
|
||||||
AddIBInt(AnObjectDomElement,'IBUITextAlignment',ord(Alignment),0)
|
AddIBInt(AnObjectDomElement,'IBUITextAlignment',ord(Alignment),0)
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
constructor UITextField.Create(AOwner: TComponent);
|
constructor UITextField.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
@ -3279,7 +2994,7 @@ begin
|
|||||||
if FFont=AValue then Exit;
|
if FFont=AValue then Exit;
|
||||||
FFont.Assign(AValue);
|
FFont.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
{
|
||||||
procedure UILabel.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UILabel.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
var
|
var
|
||||||
AnElement: TDOMElement;
|
AnElement: TDOMElement;
|
||||||
@ -3294,7 +3009,7 @@ begin
|
|||||||
AddIBBoolean(AnObjectDomElement,'IBUIHighlighted',Highlighted,false);
|
AddIBBoolean(AnObjectDomElement,'IBUIHighlighted',Highlighted,false);
|
||||||
AddIBInt(AnObjectDomElement,'IBUILineBreakMode',ord(LineBreaks),4);
|
AddIBInt(AnObjectDomElement,'IBUILineBreakMode',ord(LineBreaks),4);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
constructor UILabel.Create(AOwner: TComponent);
|
constructor UILabel.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
@ -3454,7 +3169,7 @@ begin
|
|||||||
if Name=Caption then Caption:=NewName;
|
if Name=Caption then Caption:=NewName;
|
||||||
inherited SetName(NewName);
|
inherited SetName(NewName);
|
||||||
end;
|
end;
|
||||||
|
{
|
||||||
procedure UIView.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UIView.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
var
|
var
|
||||||
b: integer;
|
b: integer;
|
||||||
@ -3471,7 +3186,7 @@ begin
|
|||||||
AddIBColor(AnObjectDomElement,'IBUIBackgroundColor',BackgroundColor);
|
AddIBColor(AnObjectDomElement,'IBUIBackgroundColor',BackgroundColor);
|
||||||
inherited WriteToDomElement(AnObjectDomElement);
|
inherited WriteToDomElement(AnObjectDomElement);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
function tiOSFakeComponent.GetXIBBoolean(index: TXIBProperties): boolean;
|
function tiOSFakeComponent.GetXIBBoolean(index: TXIBProperties): boolean;
|
||||||
var
|
var
|
||||||
s: string;
|
s: string;
|
||||||
@ -3559,7 +3274,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ UIButton }
|
{ UIButton }
|
||||||
|
{
|
||||||
procedure UIButton.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
procedure UIButton.WriteToDomElement(AnObjectDomElement: TDOMElement);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -3569,24 +3284,7 @@ begin
|
|||||||
AddIBString(AnObjectDomElement,'IBUINormalTitle',Caption);
|
AddIBString(AnObjectDomElement,'IBUINormalTitle',Caption);
|
||||||
AddIBColor(AnObjectDomElement,'IBUINormalTitleColor',TextColor);
|
AddIBColor(AnObjectDomElement,'IBUINormalTitleColor',TextColor);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
function UIButton.WriteToConnectionRecords(AnObjectDomElement: TDOMElement): TDOMElement;
|
|
||||||
var
|
|
||||||
AMethod: TMethod;
|
|
||||||
begin
|
|
||||||
inherited WriteToConnectionRecords(AnObjectDomElement);
|
|
||||||
//writeln('PROPVAL: ' + vartostr(GetPropValue(self,'onTouchDown')));
|
|
||||||
AMethod := LazGetMethodProp(self,GetPropInfo(self,'onTouchDown'));
|
|
||||||
|
|
||||||
writeln('PROPVAL: ' + hexStr(PtrInt( AMethod.Code),8) + ' - ' + hexStr(ptrint(AMethod.Data),8));
|
|
||||||
if AMethod.Data<>nil then
|
|
||||||
begin
|
|
||||||
AddConnectionRecord(AnObjectDomElement,'IBCocoaTouchEventConnection',Name+'TouchDown:','1');
|
|
||||||
writeln(TObject(AMethod.Data).MethodName(self));
|
|
||||||
end
|
|
||||||
else
|
|
||||||
writeln('AA- Geen Touchdown ' + self.Name);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure UIButton.InitializeDefaults;
|
procedure UIButton.InitializeDefaults;
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user