You've already forked lazarus-ccr
* Added option to open xib in XCode
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2631 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -5,7 +5,7 @@ unit iOSIdeIntf;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, Forms, ProjectIntf, iPhoneExtOptions;
|
||||
Classes, Forms, ProjectIntf, iPhoneExtOptions, ComponentEditors;
|
||||
|
||||
type
|
||||
|
||||
@ -53,17 +53,35 @@ type
|
||||
function CreateSource(const Filename, SourceName, ResourceName: string): string; override;
|
||||
end;
|
||||
|
||||
{ TiOSShowInXCode }
|
||||
|
||||
TiOSShowInXCode = Class(TComponentEditor)
|
||||
private
|
||||
FStartIndex : Integer;
|
||||
Public
|
||||
procedure ExecuteVerb(Index: Integer); override;
|
||||
function GetVerb(Index: Integer): string; override;
|
||||
function GetVerbCount: Integer; override;
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
GiOSApplicationDescriptor: TiOSApplicationDescriptor;
|
||||
GiOSAppDelegateWindowFileDesc: TiOSAppDelegateWindowFileDesc;
|
||||
GiOSInfo_PlistFileDesc: TiOSInfo_PlistFileDesc;
|
||||
GiOSObjectDelegateWindowFileDesc: TiOSObjectDelegateWindowFileDesc;
|
||||
|
||||
resourcestring
|
||||
SShowInXCode = 'Show in XCode';
|
||||
|
||||
procedure register;
|
||||
|
||||
implementation
|
||||
|
||||
uses LazIDEIntf, Controls, iOS_Views, iOSXIBResource, UnitResources;
|
||||
uses
|
||||
LazIDEIntf, Controls, iOS_Views, iOSXIBResource, UnitResources,
|
||||
LazFilesUtils,
|
||||
FileUtil;
|
||||
|
||||
procedure register;
|
||||
begin
|
||||
@ -76,9 +94,44 @@ begin
|
||||
GiOSObjectDelegateWindowFileDesc:=TiOSObjectDelegateWindowFileDesc.Create;
|
||||
RegisterProjectFileDescriptor(GiOSObjectDelegateWindowFileDesc);
|
||||
|
||||
RegisterComponentEditor(NSObject, TiOSShowInXCode);
|
||||
|
||||
RegisterUnitResourcefileFormat(TXIBResourcefileFormat);
|
||||
end;
|
||||
|
||||
{ TiOSShowInXCode }
|
||||
|
||||
procedure TiOSShowInXCode.ExecuteVerb(Index: Integer);
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
If Index<FStartIndex then
|
||||
inherited ExecuteVerb(Index)
|
||||
else
|
||||
case (Index-FstartIndex) of
|
||||
0 : begin
|
||||
s := '/Users/joost/svn/testlrs/onzin/appdelegate_iphoneu.xib';
|
||||
if FileExistsUTF8(s) then ExecCmdLineNoWait('open "'+s +'"');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TiOSShowInXCode.GetVerb(Index: Integer): string;
|
||||
begin
|
||||
If Index<FStartIndex then
|
||||
Result:=inherited GetVerb(Index)
|
||||
else
|
||||
case (Index-FstartIndex) of
|
||||
0 : Result:=SShowInXCode;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TiOSShowInXCode.GetVerbCount: Integer;
|
||||
begin
|
||||
FStartIndex:=inherited GetVerbCount;
|
||||
Result:=FStartIndex+1;
|
||||
end;
|
||||
|
||||
{ TiOSObjectDelegateWindowFileDesc }
|
||||
|
||||
function TiOSObjectDelegateWindowFileDesc.GetDelegateProtocols: string;
|
||||
|
Reference in New Issue
Block a user