mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-24 21:31:43 +02:00
cody: added dialog to add a Assign method
git-svn-id: trunk@30521 -
This commit is contained in:
parent
478c782316
commit
bc19f550d3
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -538,8 +538,11 @@ components/codetools/h2pastool.pas svneol=native#text/plain
|
||||
components/codetools/ide/Makefile svneol=native#text/plain
|
||||
components/codetools/ide/Makefile.compiled svneol=native#text/plain
|
||||
components/codetools/ide/Makefile.fpc svneol=native#text/plain
|
||||
components/codetools/ide/addassignmethoddlg.lfm svneol=native#text/plain
|
||||
components/codetools/ide/addassignmethoddlg.pas svneol=native#text/plain
|
||||
components/codetools/ide/cody.lpk svneol=native#text/plain
|
||||
components/codetools/ide/cody.pas svneol=native#text/pascal
|
||||
components/codetools/ide/codyctrls.pas svneol=native#text/plain
|
||||
components/codetools/ide/codystrconsts.pas svneol=native#text/pascal
|
||||
components/codetools/ide/languages/codystrconsts.it.po svneol=native#text/plain
|
||||
components/codetools/ide/languages/codystrconsts.po svneol=native#text/plain
|
||||
|
||||
@ -160,7 +160,7 @@ type
|
||||
out CommentStart, CommentEnd: integer): boolean;
|
||||
function CreateMissingProcBodies: boolean;
|
||||
function ApplyChangesAndJumpToFirstNewProc(CleanPos: integer;
|
||||
OldTopLine: integer;
|
||||
OldTopLine: integer; AddMissingProcBodies: boolean;
|
||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||
function NodeExtIsVariable(ANodeExt: TCodeTreeNodeExtension): boolean;
|
||||
function NodeExtHasVisibilty(ANodeExt: TCodeTreeNodeExtension;
|
||||
@ -310,10 +310,11 @@ type
|
||||
out InheritedDeclContext: TFindContext;
|
||||
ProcName: string = '' // default is 'Assign'
|
||||
): boolean;
|
||||
function AddAssignMethod(MemberNodeExts: TAVLTree;
|
||||
function AddAssignMethod(ClassNode: TCodeTreeNode; MemberNodeExts: TFPList;
|
||||
const ProcName, ParamName, ParamType: string;
|
||||
OverrideMod, CallInherited, CallInheritedOnlyInElse: boolean;
|
||||
SourceChanger: TSourceChangeCache;
|
||||
out NewPos: TCodeXYPosition; out NewTopLine: integer;
|
||||
LocalVarName: string = '' // default aSource
|
||||
): boolean;
|
||||
|
||||
@ -1216,25 +1217,11 @@ begin
|
||||
SectionNode:=SectionNode.NextBrother;
|
||||
end;
|
||||
|
||||
{$IFDEF CTDEBUG}
|
||||
DebugLn('TCodeCompletionCodeTool.CompleteCode Insert new variables and methods ... ');
|
||||
{$ENDIF}
|
||||
// insert all new variables and procs definitions
|
||||
if not InsertAllNewClassParts then
|
||||
RaiseException(ctsErrorDuringInsertingNewClassParts);
|
||||
|
||||
{$IFDEF CTDEBUG}
|
||||
DebugLn('TCodeCompletionCodeTool.CompleteCode Insert new method bodies ... ');
|
||||
{$ENDIF}
|
||||
// insert all missing proc bodies
|
||||
if not CreateMissingProcBodies then
|
||||
RaiseException(ctsErrorDuringCreationOfNewProcBodies);
|
||||
|
||||
{$IFDEF CTDEBUG}
|
||||
DebugLn('TCodeCompletionCodeTool.CompleteCode Apply ... ');
|
||||
{$ENDIF}
|
||||
// apply the changes and jump to first new proc body
|
||||
Result:=ApplyChangesAndJumpToFirstNewProc(CleanCursorPos,OldTopLine,
|
||||
Result:=ApplyChangesAndJumpToFirstNewProc(CleanCursorPos,OldTopLine,true,
|
||||
NewPos,NewTopLine);
|
||||
finally
|
||||
FreeClassInsertionList;
|
||||
@ -5123,7 +5110,7 @@ function TCodeCompletionCodeTool.FindAssignMethod(CursorPos: TCodeXYPosition;
|
||||
Params.Identifier:=PChar(ProcName);
|
||||
Params.ContextNode:=ClassNode;
|
||||
if not FindIdentifierInContext(Params) then exit;
|
||||
debugln(['FindInheritedAssign NewNode=',Params.NewNode.DescAsString]);
|
||||
//debugln(['FindInheritedAssign NewNode=',Params.NewNode.DescAsString]);
|
||||
if Params.NewNode=nil then exit;
|
||||
if Params.NewNode.Desc<>ctnProcedure then exit;
|
||||
InheritedDeclContext:=CreateFindContext(Params);
|
||||
@ -5175,17 +5162,15 @@ begin
|
||||
FindInheritedAssign;
|
||||
end;
|
||||
|
||||
function TCodeCompletionCodeTool.AddAssignMethod(MemberNodeExts: TAVLTree;
|
||||
const ProcName, ParamName, ParamType: string; OverrideMod, CallInherited,
|
||||
CallInheritedOnlyInElse: boolean; SourceChanger: TSourceChangeCache;
|
||||
LocalVarName: string): boolean;
|
||||
function TCodeCompletionCodeTool.AddAssignMethod(ClassNode: TCodeTreeNode;
|
||||
MemberNodeExts: TFPList; const ProcName, ParamName, ParamType: string;
|
||||
OverrideMod, CallInherited, CallInheritedOnlyInElse: boolean;
|
||||
SourceChanger: TSourceChangeCache; out NewPos: TCodeXYPosition;
|
||||
out NewTopLine: integer; LocalVarName: string): boolean;
|
||||
var
|
||||
AVLNode: TAVLTreeNode;
|
||||
NodeExt: TCodeTreeNodeExtension;
|
||||
Node: TCodeTreeNode;
|
||||
CleanDef: String;
|
||||
Def: String;
|
||||
ClassNode: TCodeTreeNode;
|
||||
aClassName: String;
|
||||
ProcBody: String;
|
||||
e: String;
|
||||
@ -5193,62 +5178,64 @@ var
|
||||
Indent: Integer;
|
||||
IndentStep: LongInt;
|
||||
SrcVar: String;
|
||||
i: Integer;
|
||||
begin
|
||||
Result:=false;
|
||||
if (MemberNodeExts=nil) or (MemberNodeExts.Count=0) then exit(true);
|
||||
NewPos:=CleanCodeXYPosition;
|
||||
NewTopLine:=-1;
|
||||
if ClassNode=nil then exit;
|
||||
if (ParamName='') or (ParamType='') then exit;
|
||||
ClassNode:=nil;
|
||||
CleanDef:='procedure '+ProcName+'(:'+ParamType+')';
|
||||
aClassName:=ExtractClassName(ClassNode,false);
|
||||
CleanDef:=ProcName+'('+ParamType+');';
|
||||
Def:='procedure '+ProcName+'('+ParamName+':'+ParamType+');';
|
||||
if OverrideMod then Def:=Def+'override;';
|
||||
ProcBody:='';
|
||||
AVLNode:=MemberNodeExts.FindLowest;
|
||||
SrcVar:=ParamName;
|
||||
// create the proc header
|
||||
SameType:=CompareIdentifiers(PChar(aClassName),PChar(ParamType))=0;
|
||||
e:=SourceChanger.BeautifyCodeOptions.LineEnd;
|
||||
SameType:=true;
|
||||
Indent:=0;
|
||||
IndentStep:=SourceChanger.BeautifyCodeOptions.Indent;
|
||||
SrcVar:=ParamName;
|
||||
while AVLNode<>nil do begin
|
||||
NodeExt:=TCodeTreeNodeExtension(AVLNode.Data);
|
||||
Node:=NodeExt.Node;
|
||||
if ClassNode=nil then begin
|
||||
// first assignment
|
||||
// => get the classnode, create the proc header
|
||||
ClassNode:=FindClassOrInterfaceNode(Node.Parent);
|
||||
aClassName:=ExtractClassName(ClassNode,false);
|
||||
SameType:=CompareIdentifiers(PChar(aClassName),PChar(ParamType))=0;
|
||||
ProcBody:='procedure '+aClassName+'.'+ProcName+'('+ParamName+':'+ParamType+')'+e;
|
||||
if not SameType then begin
|
||||
SrcVar:=LocalVarName;
|
||||
if SrcVar='' then
|
||||
SrcVar:='aSource';
|
||||
if CompareIdentifiers(PChar(SrcVar),PChar(ParamName))=0 then begin
|
||||
if CompareIdentifiers(PChar(SrcVar),'aSource')=0 then
|
||||
SrcVar:='aSrc'
|
||||
else
|
||||
SrcVar:='aSource';
|
||||
end;
|
||||
ProcBody:=ProcBody+'var'+e
|
||||
+GetIndentStr(Indent+IndentStep)+SrcVar+':'+aClassName+';'+e;
|
||||
end;
|
||||
ProcBody:=ProcBody+'begin'+e;
|
||||
inc(Indent,IndentStep);
|
||||
if CallInherited and (not CallInheritedOnlyInElse) then
|
||||
ProcBody:=ProcBody
|
||||
+GetIndentStr(Indent)+'inherited '+ProcName+'('+ParamName+');'+e;
|
||||
if not SameType then begin
|
||||
// add a parameter check to the new procedure
|
||||
ProcBody:=ProcBody
|
||||
+GetIndentStr(Indent)+'if '+ParamName+' is '+aClassName+' then'+e
|
||||
+GetIndentStr(Indent)+'begin'+e;
|
||||
inc(Indent,IndentStep);
|
||||
ProcBody:=ProcBody+GetIndentStr(Indent)+SrcVar+':='+aClassName+'('+ParamName+');'+e;
|
||||
end;
|
||||
ProcBody:='procedure '+aClassName+'.'+ProcName+'('+ParamName+':'+ParamType+');'+e;
|
||||
if not SameType then begin
|
||||
// add local variable
|
||||
SrcVar:=LocalVarName;
|
||||
if SrcVar='' then
|
||||
SrcVar:='aSource';
|
||||
if CompareIdentifiers(PChar(SrcVar),PChar(ParamName))=0 then begin
|
||||
if CompareIdentifiers(PChar(SrcVar),'aSource')=0 then
|
||||
SrcVar:='aSrc'
|
||||
else
|
||||
SrcVar:='aSource';
|
||||
end;
|
||||
// add assignment
|
||||
ProcBody:=ProcBody+GetIndentStr(Indent)+NodeExt.Txt+':='+SrcVar+'.'+NodeExt.Txt+';'+e;
|
||||
AVLNode:=MemberNodeExts.FindSuccessor(AVLNode);
|
||||
ProcBody:=ProcBody+'var'+e
|
||||
+GetIndentStr(Indent+IndentStep)+SrcVar+':'+aClassName+';'+e;
|
||||
end;
|
||||
ProcBody:=ProcBody+'begin'+e;
|
||||
inc(Indent,IndentStep);
|
||||
|
||||
// call inherited
|
||||
if CallInherited and (not CallInheritedOnlyInElse) then
|
||||
ProcBody:=ProcBody
|
||||
+GetIndentStr(Indent)+'inherited '+ProcName+'('+ParamName+');'+e;
|
||||
|
||||
if not SameType then begin
|
||||
// add a parameter check to the new procedure
|
||||
ProcBody:=ProcBody
|
||||
+GetIndentStr(Indent)+'if '+ParamName+' is '+aClassName+' then'+e
|
||||
+GetIndentStr(Indent)+'begin'+e;
|
||||
inc(Indent,IndentStep);
|
||||
ProcBody:=ProcBody+GetIndentStr(Indent)+SrcVar+':='+aClassName+'('+ParamName+');'+e;
|
||||
end;
|
||||
|
||||
// add assignments
|
||||
if MemberNodeExts<>nil then begin
|
||||
for i:=0 to MemberNodeExts.Count-1 do begin
|
||||
NodeExt:=TCodeTreeNodeExtension(MemberNodeExts[i]);
|
||||
// add assignment
|
||||
ProcBody:=ProcBody+GetIndentStr(Indent)+NodeExt.Txt+':='+SrcVar+'.'+NodeExt.Txt+';'+e;
|
||||
end;
|
||||
end;
|
||||
|
||||
if not SameType then begin
|
||||
// close if block
|
||||
dec(Indent,IndentStep);
|
||||
@ -5265,7 +5252,8 @@ begin
|
||||
if not InitClassCompletion(ClassNode,SourceChanger) then exit;
|
||||
ProcBody:=SourceChanger.BeautifyCodeOptions.BeautifyStatement(ProcBody,0);
|
||||
AddClassInsertion(CleanDef,Def,ProcName,ncpPublicProcs,nil,ProcBody);
|
||||
Result:=ApplyClassCompletion(true);
|
||||
Result:=ApplyChangesAndJumpToFirstNewProc(ClassNode.StartPos,1,true,
|
||||
NewPos,NewTopLine);
|
||||
end;
|
||||
|
||||
function TCodeCompletionCodeTool.GatherPublishedMethods(
|
||||
@ -6669,7 +6657,9 @@ var
|
||||
// remember one proc body to jump to after the completion
|
||||
FJumpToProcName:=ANodeExt.Txt;
|
||||
if System.Pos('.',FJumpToProcName)<1 then
|
||||
FJumpToProcName:=UpperCaseStr(TheClassName)+'.'+FJumpToProcName;
|
||||
FJumpToProcName:=TheClassName+'.'+FJumpToProcName;
|
||||
if FJumpToProcName[length(FJumpToProcName)]<>';' then
|
||||
FJumpToProcName:=FJumpToProcName+';';
|
||||
{$IFDEF CTDEBUG}
|
||||
DebugLn('CreateMissingProcBodies FJumpToProcName="',FJumpToProcName,'"');
|
||||
{$ENDIF}
|
||||
@ -7198,7 +7188,7 @@ begin
|
||||
end;
|
||||
|
||||
function TCodeCompletionCodeTool.ApplyChangesAndJumpToFirstNewProc(
|
||||
CleanPos: integer; OldTopLine: integer;
|
||||
CleanPos: integer; OldTopLine: integer; AddMissingProcBodies: boolean;
|
||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||
var
|
||||
OldCodeXYPos: TCodeXYPosition;
|
||||
@ -7208,16 +7198,29 @@ var
|
||||
ProcNode: TCodeTreeNode;
|
||||
begin
|
||||
Result:=false;
|
||||
|
||||
CurClassName:=ExtractClassName(CodeCompleteClassNode,false);
|
||||
|
||||
// apply the changes and jump to first new proc body
|
||||
if not CleanPosToCodePos(CleanPos,OldCodePos) then
|
||||
RaiseException('TCodeCompletionCodeTool.CompleteCode Internal Error CleanPosToCodePos');
|
||||
if not CleanPosToCaret(CleanPos,OldCodeXYPos) then
|
||||
RaiseException('TCodeCompletionCodeTool.CompleteCode Internal Error CleanPosToCaret');
|
||||
if not ASourceChangeCache.Apply then
|
||||
RaiseException(ctsUnableToApplyChanges);
|
||||
try
|
||||
// extend class declaration
|
||||
if not InsertAllNewClassParts then
|
||||
RaiseException(ctsErrorDuringInsertingNewClassParts);
|
||||
|
||||
// create missing method bodies
|
||||
if AddMissingProcBodies and (not CreateMissingProcBodies) then
|
||||
RaiseException(ctsErrorDuringCreationOfNewProcBodies);
|
||||
|
||||
CurClassName:=ExtractClassName(CodeCompleteClassNode,false);
|
||||
|
||||
// apply the changes and jump to first new proc body
|
||||
if not CleanPosToCodePos(CleanPos,OldCodePos) then
|
||||
RaiseException('TCodeCompletionCodeTool.CompleteCode Internal Error CleanPosToCodePos');
|
||||
if not CleanPosToCaret(CleanPos,OldCodeXYPos) then
|
||||
RaiseException('TCodeCompletionCodeTool.CompleteCode Internal Error CleanPosToCaret');
|
||||
if not ASourceChangeCache.Apply then
|
||||
RaiseException(ctsUnableToApplyChanges);
|
||||
|
||||
finally
|
||||
FreeClassInsertionList;
|
||||
end;
|
||||
|
||||
if FJumpToProcName<>'' then begin
|
||||
{$IFDEF CTDEBUG}
|
||||
@ -7237,6 +7240,7 @@ begin
|
||||
FCodeCompleteClassNode:=FindClassNode(CursorNode,CurClassName,true,false);
|
||||
if CodeCompleteClassNode=nil then
|
||||
RaiseException('oops, I lost your class');
|
||||
debugln(['TCodeCompletionCodeTool.ApplyChangesAndJumpToFirstNewProc AAA2 ',FJumpToProcName]);
|
||||
ProcNode:=FindProcNode(CursorNode,FJumpToProcName,
|
||||
[phpInUpperCase,phpIgnoreForwards]);
|
||||
if ProcNode=nil then
|
||||
@ -7544,14 +7548,8 @@ begin
|
||||
AVLNode:=NewMethods.FindSuccessor(AVLNode);
|
||||
end;
|
||||
|
||||
// extend class declaration
|
||||
if not InsertAllNewClassParts then exit;
|
||||
|
||||
// create missing method bodies
|
||||
if not CreateMissingProcBodies then exit;
|
||||
|
||||
// apply changes
|
||||
if not ApplyChangesAndJumpToFirstNewProc(CleanCursorPos,OldTopLine,
|
||||
if not ApplyChangesAndJumpToFirstNewProc(CleanCursorPos,OldTopLine,true,
|
||||
NewPos,NewTopLine) then exit;
|
||||
|
||||
Result:=true;
|
||||
|
||||
@ -556,7 +556,9 @@ type
|
||||
out AssignDeclNode: TCodeTreeNode;
|
||||
var MemberNodeExts: TAVLTree; // tree of TCodeTreeNodeExtension, Node=var or property, Data=write property
|
||||
out AssignBodyNode: TCodeTreeNode;
|
||||
out InheritedDeclContext: TFindContext): boolean;
|
||||
out InheritedDeclContext: TFindContext;
|
||||
ProcName: string = '' // default: Assign
|
||||
): boolean;
|
||||
|
||||
// code templates
|
||||
function InsertCodeTemplate(Code: TCodeBuffer;
|
||||
@ -3907,8 +3909,8 @@ end;
|
||||
function TCodeToolManager.FindAssignMethod(Code: TCodeBuffer; X, Y: integer;
|
||||
out Tool: TCodeTool; out ClassNode: TCodeTreeNode;
|
||||
out AssignDeclNode: TCodeTreeNode; var MemberNodeExts: TAVLTree;
|
||||
out AssignBodyNode: TCodeTreeNode; out InheritedDeclContext: TFindContext
|
||||
): boolean;
|
||||
out AssignBodyNode: TCodeTreeNode; out InheritedDeclContext: TFindContext;
|
||||
ProcName: string): boolean;
|
||||
var
|
||||
CodePos: TCodeXYPosition;
|
||||
begin
|
||||
@ -3926,7 +3928,7 @@ begin
|
||||
try
|
||||
Result:=FCurCodeTool.FindAssignMethod(CodePos,ClassNode,
|
||||
AssignDeclNode,MemberNodeExts,AssignBodyNode,
|
||||
InheritedDeclContext);
|
||||
InheritedDeclContext,ProcName);
|
||||
except
|
||||
on e: Exception do Result:=HandleException(e);
|
||||
end;
|
||||
|
||||
@ -28,7 +28,7 @@ program AddMethodAssign;
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, CodeCache, CodeToolManager, FileProcs, AVL_Tree,
|
||||
Classes, SysUtils, CodeCache, CodeToolManager, FileProcs, AVL_Tree, CodeAtom,
|
||||
BasicCodeTools, SourceChanger, CodeTree, FindDeclarationTool, AssignExample1;
|
||||
|
||||
const
|
||||
@ -50,6 +50,10 @@ var
|
||||
ParamNode: TCodeTreeNode;
|
||||
InheritedIsTPersistent: boolean;
|
||||
InheritedClassNode: TCodeTreeNode;
|
||||
AssignMembers: TFPList;
|
||||
NewPos: TCodeXYPosition;
|
||||
NewTopline: integer;
|
||||
i: Integer;
|
||||
begin
|
||||
CodeToolBoss.SimpleInit(ConfigFilename);
|
||||
|
||||
@ -60,6 +64,7 @@ begin
|
||||
raise Exception.Create('loading failed '+Filename);
|
||||
|
||||
// parse the unit, check if in a class with an Assign method
|
||||
AssignMembers:=TFPList.Create;
|
||||
try
|
||||
MemberNodeExts:=nil;
|
||||
if not CodeToolBoss.FindAssignMethod(Code,3,18,
|
||||
@ -79,14 +84,15 @@ begin
|
||||
NodeExt:=TCodeTreeNodeExtension(AVLNode.Data);
|
||||
if NodeExt.Data<>nil then begin
|
||||
debugln(['skipping identifier ',NodeExt.Txt,' because it is written by a property']);
|
||||
MemberNodeExts.FreeAndDelete(AVLNode);
|
||||
end else begin
|
||||
debugln('assigning identifier ',NodeExt.Txt,' ...');
|
||||
AssignMembers.Add(NodeExt);
|
||||
MemberNodeExts.Delete(AVLNode);
|
||||
end;
|
||||
AVLNode:=NextAVLNode;
|
||||
end;
|
||||
end;
|
||||
if (MemberNodeExts=nil) or (MemberNodeExts.Count=0) then begin
|
||||
if (AssignMembers.Count=0) then begin
|
||||
debugln('no assignable members found');
|
||||
exit;
|
||||
end;
|
||||
@ -115,9 +121,10 @@ begin
|
||||
|
||||
// add assign method
|
||||
if AssignDeclNode=nil then begin
|
||||
if not Tool.AddAssignMethod(MemberNodeExts,'Assign',ParamName,ParamType,
|
||||
if not Tool.AddAssignMethod(ClassNode,AssignMembers,
|
||||
'Assign',ParamName,ParamType,
|
||||
InheritedDeclContext.Node<>nil,true,InheritedIsTPersistent,
|
||||
CodeToolBoss.SourceChangeCache)
|
||||
CodeToolBoss.SourceChangeCache,NewPos,NewTopline)
|
||||
then
|
||||
raise Exception.Create('AddAssignMethod failed');
|
||||
end else begin
|
||||
@ -126,6 +133,9 @@ begin
|
||||
|
||||
finally
|
||||
DisposeAVLTree(MemberNodeExts);
|
||||
for i:=0 to AssignMembers.Count-1 do
|
||||
TObject(AssignMembers[i]).Free;
|
||||
FreeAndNil(AssignMembers);
|
||||
end;
|
||||
// write the new source:
|
||||
writeln('-----------------------------------');
|
||||
|
||||
267
components/codetools/ide/addassignmethoddlg.lfm
Normal file
267
components/codetools/ide/addassignmethoddlg.lfm
Normal file
@ -0,0 +1,267 @@
|
||||
object AddAssignMethodDialog: TAddAssignMethodDialog
|
||||
Left = 173
|
||||
Height = 484
|
||||
Top = 217
|
||||
Width = 569
|
||||
Caption = 'AddAssignMethodDialog'
|
||||
ClientHeight = 484
|
||||
ClientWidth = 569
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.31'
|
||||
object ButtonPanel1: TButtonPanel
|
||||
Left = 6
|
||||
Height = 30
|
||||
Top = 448
|
||||
Width = 557
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.Caption = '&OK'
|
||||
HelpButton.Name = 'HelpButton'
|
||||
HelpButton.Caption = '&Help'
|
||||
CloseButton.Name = 'CloseButton'
|
||||
CloseButton.Caption = '&Close'
|
||||
CancelButton.Name = 'CancelButton'
|
||||
CancelButton.Caption = 'Cancel'
|
||||
TabOrder = 0
|
||||
ShowButtons = [pbOK, pbCancel]
|
||||
end
|
||||
object MembersGroupBox: TGroupBox
|
||||
AnchorSideTop.Control = InheritedGroupBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 184
|
||||
Top = 258
|
||||
Width = 557
|
||||
Align = alBottom
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'MembersGroupBox'
|
||||
ClientHeight = 162
|
||||
ClientWidth = 549
|
||||
TabOrder = 1
|
||||
object MembersTreeView: TCodyTreeView
|
||||
Left = 0
|
||||
Height = 162
|
||||
Top = 0
|
||||
Width = 549
|
||||
Align = alClient
|
||||
DefaultItemHeight = 18
|
||||
Images = ImageList1
|
||||
TabOrder = 0
|
||||
OnMouseDown = MembersTreeViewMouseDown
|
||||
end
|
||||
end
|
||||
object InheritedGroupBox: TGroupBox
|
||||
Left = 6
|
||||
Height = 128
|
||||
Top = 124
|
||||
Width = 557
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'InheritedGroupBox'
|
||||
ClientHeight = 106
|
||||
ClientWidth = 549
|
||||
TabOrder = 2
|
||||
object InheritedLabel: TLabel
|
||||
AnchorSideLeft.Control = InheritedGroupBox
|
||||
AnchorSideTop.Control = InheritedEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 9
|
||||
Width = 91
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'InheritedLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
object InheritedEdit: TEdit
|
||||
AnchorSideLeft.Control = InheritedLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = InheritedGroupBox
|
||||
AnchorSideRight.Control = InheritedGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 103
|
||||
Height = 22
|
||||
Top = 6
|
||||
Width = 440
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
TabOrder = 0
|
||||
Text = 'InheritedEdit'
|
||||
end
|
||||
object InhOverrideCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = InheritedLabel
|
||||
AnchorSideTop.Control = InheritedEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 18
|
||||
Top = 34
|
||||
Width = 156
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'InhOverrideCheckBox'
|
||||
TabOrder = 1
|
||||
end
|
||||
object InhCallCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = InheritedLabel
|
||||
AnchorSideTop.Control = InhOverrideCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 18
|
||||
Top = 58
|
||||
Width = 126
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'InhCallCheckBox'
|
||||
TabOrder = 2
|
||||
end
|
||||
object InhCallOnlyInElseCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = InheritedLabel
|
||||
AnchorSideTop.Control = InhCallCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 18
|
||||
Top = 82
|
||||
Width = 191
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'InhCallOnlyInElseCheckBox'
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
object DeclGroupBox: TGroupBox
|
||||
Left = 6
|
||||
Height = 112
|
||||
Top = 6
|
||||
Width = 557
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'DeclGroupBox'
|
||||
ClientHeight = 90
|
||||
ClientWidth = 549
|
||||
TabOrder = 3
|
||||
object ParamTypeLabel: TLabel
|
||||
AnchorSideLeft.Control = ProcNameLabel
|
||||
AnchorSideTop.Control = ParamTypeEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 65
|
||||
Width = 104
|
||||
Caption = 'ParamTypeLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
object ParamTypeEdit: TEdit
|
||||
AnchorSideLeft.Control = ParamTypeLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ParamNameEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 116
|
||||
Height = 22
|
||||
Top = 62
|
||||
Width = 141
|
||||
BorderSpacing.Around = 6
|
||||
TabOrder = 0
|
||||
Text = 'ParamTypeEdit'
|
||||
end
|
||||
object ParamNameEdit: TEdit
|
||||
AnchorSideLeft.Control = ParamNameLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ProcNameEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 121
|
||||
Height = 22
|
||||
Top = 34
|
||||
Width = 136
|
||||
BorderSpacing.Around = 6
|
||||
OnChange = ParamNameEditChange
|
||||
TabOrder = 1
|
||||
Text = 'ParamNameEdit'
|
||||
end
|
||||
object ParamNameLabel: TLabel
|
||||
AnchorSideLeft.Control = ProcNameLabel
|
||||
AnchorSideTop.Control = ParamNameEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 37
|
||||
Width = 109
|
||||
Caption = 'ParamNameLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
object ProcNameEdit: TEdit
|
||||
AnchorSideLeft.Control = ProcNameLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = DeclGroupBox
|
||||
Left = 110
|
||||
Height = 22
|
||||
Top = 6
|
||||
Width = 147
|
||||
BorderSpacing.Around = 6
|
||||
OnChange = ProcNameEditChange
|
||||
TabOrder = 2
|
||||
Text = 'ProcNameEdit'
|
||||
end
|
||||
object ProcNameLabel: TLabel
|
||||
AnchorSideLeft.Control = DeclGroupBox
|
||||
AnchorSideTop.Control = ProcNameEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 9
|
||||
Width = 98
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'ProcNameLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
object ProcNameErrorLabel: TLabel
|
||||
AnchorSideLeft.Control = ProcNameEdit
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ProcNameEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 263
|
||||
Height = 17
|
||||
Top = 9
|
||||
Width = 129
|
||||
Caption = 'ProcNameErrorLabel'
|
||||
Font.Color = clRed
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object ParamNameErrorLabel: TLabel
|
||||
AnchorSideLeft.Control = ParamNameEdit
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ParamNameEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 263
|
||||
Height = 17
|
||||
Top = 37
|
||||
Width = 140
|
||||
Caption = 'ParamNameErrorLabel'
|
||||
Font.Color = clRed
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object ParamTypeErrorLabel: TLabel
|
||||
AnchorSideLeft.Control = ParamTypeEdit
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ParamTypeEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 263
|
||||
Height = 17
|
||||
Top = 65
|
||||
Width = 135
|
||||
Caption = 'ParamTypeErrorLabel'
|
||||
Font.Color = clRed
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
end
|
||||
object ImageList1: TImageList
|
||||
left = 306
|
||||
top = 288
|
||||
end
|
||||
end
|
||||
542
components/codetools/ide/addassignmethoddlg.pas
Normal file
542
components/codetools/ide/addassignmethoddlg.pas
Normal file
@ -0,0 +1,542 @@
|
||||
{
|
||||
***************************************************************************
|
||||
* *
|
||||
* This source is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This code is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* A copy of the GNU General Public License is available on the World *
|
||||
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||
* obtain it by writing to the Free Software Foundation, *
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
Author: Mattias Gaertner
|
||||
|
||||
Abstract:
|
||||
An IDE dialog to add a Assign method to a pascal class.
|
||||
}
|
||||
unit AddAssignMethodDlg;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics,
|
||||
Dialogs, ButtonPanel, StdCtrls, ComCtrls, Menus, AVL_Tree,
|
||||
// Codetools
|
||||
CodeCache, CodeToolManager, FileProcs, PascalParserTool,
|
||||
BasicCodeTools, CodeAtom, CodeTree, FindDeclarationTool,
|
||||
// IDEIntf
|
||||
IDEDialogs, IDECommands, MenuIntf, LazIDEIntf, SrcEditorIntf,
|
||||
// Cody
|
||||
CodyCtrls, CodyStrConsts;
|
||||
|
||||
type
|
||||
|
||||
{ TAAMDItem }
|
||||
|
||||
TAAMDItem = class
|
||||
public
|
||||
CodePos: TCodeXYPosition;
|
||||
Name: string;
|
||||
Desc: TCodeTreeNodeDesc;
|
||||
Visibility: TCodeTreeNodeDesc;
|
||||
WrittenByProperty: string;
|
||||
Selected: boolean;
|
||||
end;
|
||||
|
||||
{ TAddAssignMethodDialog }
|
||||
|
||||
TAddAssignMethodDialog = class(TForm)
|
||||
ButtonPanel1: TButtonPanel;
|
||||
DeclGroupBox: TGroupBox;
|
||||
ImageList1: TImageList;
|
||||
InhCallCheckBox: TCheckBox;
|
||||
InhCallOnlyInElseCheckBox: TCheckBox;
|
||||
InheritedEdit: TEdit;
|
||||
InheritedGroupBox: TGroupBox;
|
||||
InheritedLabel: TLabel;
|
||||
InhOverrideCheckBox: TCheckBox;
|
||||
MembersGroupBox: TGroupBox;
|
||||
MembersTreeView: TCodyTreeView;
|
||||
ParamNameEdit: TEdit;
|
||||
ParamNameErrorLabel: TLabel;
|
||||
ParamNameLabel: TLabel;
|
||||
ParamTypeEdit: TEdit;
|
||||
ParamTypeErrorLabel: TLabel;
|
||||
ParamTypeLabel: TLabel;
|
||||
ProcNameEdit: TEdit;
|
||||
ProcNameErrorLabel: TLabel;
|
||||
ProcNameLabel: TLabel;
|
||||
procedure MembersTreeViewMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
{%H-}Shift: TShiftState; X, Y: Integer);
|
||||
procedure OkButtonClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ParamNameEditChange(Sender: TObject);
|
||||
procedure ProcNameEditChange(Sender: TObject);
|
||||
private
|
||||
FParamChanged: boolean;
|
||||
FProcNameEditChanged: boolean;
|
||||
FChecking: Boolean;
|
||||
FIdleConnected: boolean;
|
||||
procedure SetIdleConnected(const AValue: boolean);
|
||||
procedure OnIdle(Sender: TObject; var {%H-}Done: Boolean);
|
||||
private
|
||||
ImgIDImplementation: LongInt;
|
||||
ImgIDVariable: LongInt;
|
||||
ImgIDProperty: LongInt;
|
||||
// cursor position
|
||||
FCode: TCodeBuffer;
|
||||
FX, FY: integer;
|
||||
FProcName: string;
|
||||
// items
|
||||
FItems: TAVLTree; // tree of TAAMDItem sorted for Name
|
||||
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
||||
public
|
||||
NewPos: TCodeXYPosition;
|
||||
NewTopLine: integer;
|
||||
function Init(NewCode: TCodeBuffer; NewX, NewY: integer;
|
||||
UseInheritedParam: boolean): boolean;
|
||||
end;
|
||||
|
||||
|
||||
procedure Register;
|
||||
|
||||
procedure ShowAddAssignMethodDialog(Sender: TObject);
|
||||
|
||||
function CompareAAMDItemsByName(Item1, Item2: Pointer): integer;
|
||||
function CompareAnsistringWithAAMDItemName(AnAnsistring, Item: Pointer): integer;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Register;
|
||||
var
|
||||
CmdCategory: TIDECommandCategory;
|
||||
AddAssignMethodCommand: TIDECommand;
|
||||
begin
|
||||
CmdCategory:=IDECommandList.FindCategoryByName('CodeTools');
|
||||
if CmdCategory=nil then
|
||||
raise Exception.Create('cody: AddAssignMethodDlg.Register: command category CodeTools not found');
|
||||
AddAssignMethodCommand:=RegisterIDECommand(CmdCategory, 'AddAssignMethod',
|
||||
crsAddAssignMethod,
|
||||
CleanIDEShortCut,CleanIDEShortCut,nil,@ShowAddAssignMethodDialog);
|
||||
RegisterIDEMenuCommand(SrcEditSubMenuSource, 'AddAssignMethod',
|
||||
crsAddAssignMethod2,nil,nil,AddAssignMethodCommand);
|
||||
end;
|
||||
|
||||
procedure ShowAddAssignMethodDialog(Sender: TObject);
|
||||
|
||||
procedure ErrorNotInClass;
|
||||
begin
|
||||
IDEMessageDialog('Error','Please position the cursor of the source editor'
|
||||
+' in a pascal class declaration before invoking "Add Assign method".',
|
||||
mtError,[mbCancel]);
|
||||
end;
|
||||
|
||||
var
|
||||
AddAssignMethodDialog: TAddAssignMethodDialog;
|
||||
SrcEdit: TSourceEditorInterface;
|
||||
begin
|
||||
// commit changes form source editor to codetools
|
||||
if not LazarusIDE.BeginCodeTools then exit;
|
||||
// check context at cursor
|
||||
SrcEdit:=SourceEditorManagerIntf.ActiveEditor;
|
||||
if SrcEdit=nil then begin
|
||||
ErrorNotInClass;
|
||||
exit;
|
||||
end;
|
||||
AddAssignMethodDialog:=nil;
|
||||
try
|
||||
AddAssignMethodDialog:=TAddAssignMethodDialog.Create(nil);
|
||||
with AddAssignMethodDialog do begin
|
||||
if not Init(SrcEdit.CodeToolsBuffer as TCodeBuffer,
|
||||
SrcEdit.CursorTextXY.X,SrcEdit.CursorTextXY.Y,true)
|
||||
then begin
|
||||
// syntax error or not in a class
|
||||
if CodeToolBoss.ErrorMessage<>'' then
|
||||
LazarusIDE.DoJumpToCodeToolBossError
|
||||
else
|
||||
ErrorNotInClass;
|
||||
exit;
|
||||
end;
|
||||
if ShowModal=mrOk then begin
|
||||
if NewPos.Code<>nil then
|
||||
LazarusIDE.DoOpenFileAndJumpToPos(NewPos.Code.Filename,
|
||||
Point(NewPos.X,NewPos.Y),NewTopLine,-1,-1,[]);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
AddAssignMethodDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function CompareAAMDItemsByName(Item1, Item2: Pointer): integer;
|
||||
var
|
||||
it1: TAAMDItem absolute Item1;
|
||||
it2: TAAMDItem absolute Item2;
|
||||
begin
|
||||
Result:=SysUtils.CompareText(it1.Name,it2.Name);
|
||||
end;
|
||||
|
||||
function CompareAnsistringWithAAMDItemName(AnAnsistring, Item: Pointer
|
||||
): integer;
|
||||
var
|
||||
it: TAAMDItem absolute Item;
|
||||
s: String;
|
||||
begin
|
||||
s:=AnsiString(AnAnsistring);
|
||||
Result:=SysUtils.CompareText(s,it.Name);
|
||||
end;
|
||||
|
||||
{ TAddAssignMethodDialog }
|
||||
|
||||
procedure TAddAssignMethodDialog.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FProcName:='Assign';
|
||||
FItems:=TAVLTree.Create(@CompareAAMDItemsByName);
|
||||
ImgIDImplementation := Imagelist1.AddLazarusResource('ce_implementation');
|
||||
ImgIDVariable := Imagelist1.AddLazarusResource('ce_variable');
|
||||
ImgIDProperty := Imagelist1.AddLazarusResource('ce_property');
|
||||
|
||||
ButtonPanel1.OKButton.OnClick:=@OkButtonClick;
|
||||
ProcNameEdit.Text:=FProcName;
|
||||
end;
|
||||
|
||||
procedure TAddAssignMethodDialog.OkButtonClick(Sender: TObject);
|
||||
var
|
||||
FTool: TCodeTool;
|
||||
FClassNode: TCodeTreeNode;
|
||||
FAssignDeclNode: TCodeTreeNode;
|
||||
FMemberNodeExts: TAVLTree;
|
||||
FAssignBodyNode: TCodeTreeNode;
|
||||
FInheritedDeclContext: TFindContext;
|
||||
AVLNode: TAVLTreeNode;
|
||||
NextAVLNode: TAVLTreeNode;
|
||||
NodeExt: TCodeTreeNodeExtension;
|
||||
AssignIt: Boolean;
|
||||
FoundAVLNode: TAVLTreeNode;
|
||||
Item: TAAMDItem;
|
||||
FAssignMembers: TFPList;
|
||||
i: Integer;
|
||||
begin
|
||||
if (not IsValidIdent(FProcName))
|
||||
or (not IsValidIdent(ParamNameEdit.Text))
|
||||
or (not IsValidIdent(ParamTypeEdit.Text)) then exit;
|
||||
|
||||
FMemberNodeExts:=nil;
|
||||
FAssignMembers:=TFPList.Create;
|
||||
try
|
||||
if not CodeToolBoss.FindAssignMethod(FCode,FX,FY,
|
||||
FTool,FClassNode,FAssignDeclNode,FMemberNodeExts,FAssignBodyNode,
|
||||
FInheritedDeclContext,FProcName)
|
||||
then begin
|
||||
// syntax error or not in a class
|
||||
if CodeToolBoss.ErrorMessage<>'' then begin
|
||||
LazarusIDE.DoJumpToCodeToolBossError;
|
||||
ModalResult:=mrCancel;
|
||||
end;
|
||||
exit;
|
||||
end;
|
||||
if FAssignDeclNode<>nil then
|
||||
exit;
|
||||
|
||||
// use selected members
|
||||
if FMemberNodeExts<>nil then begin
|
||||
AVLNode:=FMemberNodeExts.FindLowest;
|
||||
while AVLNode<>nil do begin
|
||||
NextAVLNode:=FMemberNodeExts.FindSuccessor(AVLNode);
|
||||
NodeExt:=TCodeTreeNodeExtension(AVLNode.Data);
|
||||
AssignIt:=true;
|
||||
if (NodeExt.Txt='') then AssignIt:=false;
|
||||
if AssignIt then begin
|
||||
FoundAVLNode:=FItems.FindKey(PChar(NodeExt.Txt),@CompareAnsistringWithAAMDItemName);
|
||||
if FoundAVLNode<>nil then begin
|
||||
Item:=TAAMDItem(FoundAVLNode.Data);
|
||||
AssignIt:=Item.Selected;
|
||||
end;
|
||||
end;
|
||||
if AssignIt then begin
|
||||
FMemberNodeExts.Delete(AVLNode);
|
||||
FAssignMembers.Add(NodeExt);
|
||||
end;
|
||||
AVLNode:=NextAVLNode;
|
||||
end;
|
||||
end;
|
||||
//debugln(['TAddAssignMethodDialog.OkButtonClick Count=',FAssignMembers.Count]);
|
||||
|
||||
if not FTool.AddAssignMethod(FClassNode,FAssignMembers,FProcName,
|
||||
ParamNameEdit.Text,ParamTypeEdit.Text,
|
||||
InhOverrideCheckBox.Checked,InhCallCheckBox.Checked,
|
||||
InhCallOnlyInElseCheckBox.Checked,
|
||||
CodeToolBoss.SourceChangeCache,
|
||||
NewPos,NewTopLine)
|
||||
then begin
|
||||
debugln(['TAddAssignMethodDialog.ButtonPanel1Click failed']);
|
||||
ModalResult:=mrCancel;
|
||||
exit;
|
||||
end;
|
||||
finally
|
||||
DisposeAVLTree(FMemberNodeExts);
|
||||
for i:=0 to FAssignMembers.Count-1 do
|
||||
TObject(FAssignMembers[i]).Free;
|
||||
FreeAndNil(FAssignMembers);
|
||||
end;
|
||||
ModalResult:=mrOk;
|
||||
end;
|
||||
|
||||
procedure TAddAssignMethodDialog.MembersTreeViewMouseDown(Sender: TObject;
|
||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
Node: TTreeNode;
|
||||
Item: TAAMDItem;
|
||||
begin
|
||||
Node:=MembersTreeView.GetNodeAt(X,Y);
|
||||
if Node=nil then exit;
|
||||
if TObject(Node.Data) is TAAMDItem then
|
||||
Item:=TAAMDItem(Node.Data)
|
||||
else
|
||||
Item:=nil;
|
||||
if Item<>nil then begin
|
||||
if Button=mbLeft then begin
|
||||
if X>Node.DisplayExpandSignRight then begin
|
||||
Item.Selected:=not Item.Selected;
|
||||
if Item.Selected then
|
||||
Node.ImageIndex:=ImgIDImplementation
|
||||
else
|
||||
Node.ImageIndex:=-1;
|
||||
Node.SelectedIndex:=Node.ImageIndex;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAddAssignMethodDialog.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FItems.FreeAndClear;
|
||||
FreeAndNil(FItems);
|
||||
end;
|
||||
|
||||
procedure TAddAssignMethodDialog.ParamNameEditChange(Sender: TObject);
|
||||
begin
|
||||
FParamChanged:=true;
|
||||
IdleConnected:=true;
|
||||
end;
|
||||
|
||||
procedure TAddAssignMethodDialog.ProcNameEditChange(Sender: TObject);
|
||||
begin
|
||||
FProcNameEditChanged:=true;
|
||||
IdleConnected:=true;
|
||||
end;
|
||||
|
||||
procedure TAddAssignMethodDialog.SetIdleConnected(const AValue: boolean);
|
||||
begin
|
||||
if FIdleConnected=AValue then exit;
|
||||
FIdleConnected:=AValue;
|
||||
if IdleConnected then
|
||||
Application.AddOnIdleHandler(@OnIdle)
|
||||
else
|
||||
Application.RemoveOnIdleHandler(@OnIdle);
|
||||
end;
|
||||
|
||||
procedure TAddAssignMethodDialog.OnIdle(Sender: TObject; var Done: Boolean);
|
||||
begin
|
||||
IdleConnected:=false;
|
||||
Init(FCode,FX,FY,FProcNameEditChanged);
|
||||
end;
|
||||
|
||||
function TAddAssignMethodDialog.Init(NewCode: TCodeBuffer; NewX, NewY: integer;
|
||||
UseInheritedParam: boolean): boolean;
|
||||
var
|
||||
FTool: TCodeTool;
|
||||
FClassNode: TCodeTreeNode;
|
||||
FAssignDeclNode: TCodeTreeNode;
|
||||
FMemberNodeExts: TAVLTree;
|
||||
FAssignBodyNode: TCodeTreeNode;
|
||||
FInheritedDeclContext: TFindContext;
|
||||
FClassName: String;
|
||||
FInheritedParamName: String;
|
||||
FInheritedParamType: String;
|
||||
FInheritedIsTPersistent: Boolean;
|
||||
InheritedClassNode: TCodeTreeNode;
|
||||
ParamNode: TCodeTreeNode;
|
||||
AVLNode: TAVLTreeNode;
|
||||
NodeExt: TCodeTreeNodeExtension;
|
||||
s: String;
|
||||
VisibilityNode: TCodeTreeNode;
|
||||
TVNode: TTreeNode;
|
||||
Item: TAAMDItem;
|
||||
NewProcName: String;
|
||||
begin
|
||||
if FChecking then exit;
|
||||
FCode:=NewCode;
|
||||
FX:=NewX;
|
||||
FY:=NewY;
|
||||
|
||||
FItems.FreeAndClear;
|
||||
|
||||
FMemberNodeExts:=nil;
|
||||
try
|
||||
FChecking:=true;
|
||||
FTool:=nil;
|
||||
FClassNode:=nil;
|
||||
FAssignDeclNode:=nil;
|
||||
FMemberNodeExts:=nil;
|
||||
FAssignBodyNode:=nil;
|
||||
FInheritedDeclContext:=CleanFindContext;
|
||||
NewProcName:=ProcNameEdit.Text;
|
||||
if (NewProcName<>'') and IsValidIdent(NewProcName) then
|
||||
FProcName:=NewProcName;
|
||||
|
||||
Result:=(FCode<>nil) and CodeToolBoss.FindAssignMethod(FCode,FX,FY,
|
||||
FTool,FClassNode,FAssignDeclNode,FMemberNodeExts,FAssignBodyNode,
|
||||
FInheritedDeclContext,FProcName);
|
||||
|
||||
if FTool<>nil then
|
||||
FClassName:=FTool.ExtractClassName(FClassNode,false)
|
||||
else
|
||||
FClassName:='';
|
||||
|
||||
FInheritedParamName:='Source';
|
||||
FInheritedParamType:='TObject';
|
||||
FInheritedIsTPersistent:=false;
|
||||
|
||||
// check if inherited exists, if it is TPersistent.Assign and use the
|
||||
// inherited parameter name and type
|
||||
if FInheritedDeclContext.Node<>nil then begin
|
||||
InheritedClassNode:=fInheritedDeclContext.Tool.FindClassOrInterfaceNode(fInheritedDeclContext.Node);
|
||||
FInheritedIsTPersistent:=(InheritedClassNode<>nil)
|
||||
and (InheritedClassNode.Parent.Desc=ctnTypeDefinition)
|
||||
and (CompareIdentifiers('TPersistent',@fInheritedDeclContext.Tool.Src[InheritedClassNode.Parent.StartPos])=0);
|
||||
ParamNode:=fInheritedDeclContext.Tool.GetProcParamList(fInheritedDeclContext.Node);
|
||||
if ParamNode<>nil then begin
|
||||
ParamNode:=ParamNode.FirstChild;
|
||||
if ParamNode<>nil then begin
|
||||
FInheritedParamName:=fInheritedDeclContext.Tool.ExtractDefinitionName(ParamNode);
|
||||
if (ParamNode.FirstChild<>nil) and (ParamNode.FirstChild.Desc=ctnIdentifier) then
|
||||
FInheritedParamType:=GetIdentifier(@fInheritedDeclContext.Tool.Src[ParamNode.FirstChild.StartPos]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
ButtonPanel1.OKButton.Enabled:=Result and (FMemberNodeExts<>nil)
|
||||
and (FMemberNodeExts.Count>0);
|
||||
Caption:='Add Assign method to class '+FClassName;
|
||||
|
||||
// show some context information about the inherited method
|
||||
InheritedGroupBox.Caption:='Inherited:';
|
||||
InhOverrideCheckBox.Caption:='Override';
|
||||
InhCallCheckBox.Caption:='Call inherited';
|
||||
InhCallOnlyInElseCheckBox.Caption:='Call inherited only if wrong class';
|
||||
InheritedEdit.ReadOnly:=true;
|
||||
if FInheritedDeclContext.Node<>nil then begin
|
||||
InheritedGroupBox.Enabled:=true;
|
||||
InheritedLabel.Caption:='Method:';
|
||||
InheritedEdit.Text:=FInheritedDeclContext.Tool.ExtractProcHead(
|
||||
FInheritedDeclContext.Node,
|
||||
[phpAddClassName,phpWithDefaultValues,phpWithParameterNames]);
|
||||
InheritedEdit.Enabled:=true;
|
||||
InhOverrideCheckBox.Checked:=true;
|
||||
InhCallCheckBox.Checked:=true;
|
||||
InhCallOnlyInElseCheckBox.Checked:=FInheritedIsTPersistent;
|
||||
end else begin
|
||||
InheritedGroupBox.Enabled:=false;
|
||||
InheritedLabel.Caption:='There is no inherited method.';
|
||||
InheritedEdit.Text:='';
|
||||
InheritedEdit.Enabled:=false;
|
||||
end;
|
||||
|
||||
DeclGroupBox.Caption:='New method:';
|
||||
ProcNameLabel.Caption:='Method name:';
|
||||
if (NewProcName='') or (not IsValidIdent(NewProcName)) then
|
||||
ProcNameErrorLabel.Caption:='invalid identifier'
|
||||
else if not Result then
|
||||
ProcNameErrorLabel.Caption:='cursor is not in a pascal class declaration'
|
||||
else if FAssignDeclNode<>nil then
|
||||
ProcNameErrorLabel.Caption:='exists already'
|
||||
else
|
||||
ProcNameErrorLabel.Caption:='';
|
||||
|
||||
ParamNameLabel.Caption:='Parameter name:';
|
||||
if UseInheritedParam then
|
||||
ParamNameEdit.Text:=FInheritedParamName;
|
||||
if (ParamNameEdit.Text='') or not IsValidIdent(ParamNameEdit.Text) then
|
||||
ParamNameErrorLabel.Caption:='invalid identifier'
|
||||
else
|
||||
ParamNameErrorLabel.Caption:='';
|
||||
|
||||
ParamTypeLabel.Caption:='Parameter type:';
|
||||
if UseInheritedParam then
|
||||
ParamTypeEdit.Text:=FInheritedParamType;
|
||||
if (ParamTypeEdit.Text='') or not IsValidIdent(ParamTypeEdit.Text) then
|
||||
ParamTypeErrorLabel.Caption:='invalid identifier'
|
||||
else
|
||||
ParamTypeErrorLabel.Caption:='';
|
||||
|
||||
MembersGroupBox.Caption:='Select members to assign:';
|
||||
MembersTreeView.BeginUpdate;
|
||||
MembersTreeView.Items.Clear;
|
||||
if FMemberNodeExts<>nil then begin
|
||||
AVLNode:=FMemberNodeExts.FindLowest;
|
||||
while AVLNode<>nil do begin
|
||||
NodeExt:=TCodeTreeNodeExtension(AVLNode.Data);
|
||||
Item:=TAAMDItem.Create;
|
||||
|
||||
// visibility
|
||||
VisibilityNode:=NodeExt.Node.Parent;
|
||||
if VisibilityNode.Desc in AllClassSubSections then
|
||||
VisibilityNode:=VisibilityNode.Parent;
|
||||
Item.Visibility:=VisibilityNode.Desc;
|
||||
// kind
|
||||
Item.Desc:=NodeExt.Node.Desc;
|
||||
// name
|
||||
Item.Name:=NodeExt.Txt;
|
||||
// written by property
|
||||
if NodeExt.Data<>nil then
|
||||
Item.WrittenByProperty:=FTool.ExtractPropName(TCodeTreeNode(NodeExt.Data),false)
|
||||
else
|
||||
Item.Selected:=true;
|
||||
case Item.Visibility of
|
||||
ctnClassPrivate: s:='private';
|
||||
ctnClassProtected: s:='protected';
|
||||
ctnClassPublic: s:='public';
|
||||
ctnClassPublished: s:='published';
|
||||
else s:='?visibility?';
|
||||
end;
|
||||
if Item.Desc=ctnVarDefinition then
|
||||
s:=s+' var'
|
||||
else
|
||||
s:=s+' property';
|
||||
s:=s+' '+Item.Name;
|
||||
if Item.WrittenByProperty<>'' then
|
||||
s:=s+', written by property '+Item.WrittenByProperty;
|
||||
FItems.Add(Item);
|
||||
TVNode:=MembersTreeView.Items.AddObject(nil,s,Item);
|
||||
TVNode.ImageIndex:=-1;
|
||||
if Item.Selected then
|
||||
TVNode.ImageIndex:=ImgIDImplementation;
|
||||
TVNode.SelectedIndex:=TVNode.ImageIndex;
|
||||
AVLNode:=FMemberNodeExts.FindSuccessor(AVLNode);
|
||||
end;
|
||||
end;
|
||||
MembersTreeView.EndUpdate;
|
||||
|
||||
finally
|
||||
DisposeAVLTree(FMemberNodeExts);
|
||||
FChecking:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
end.
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<CompilerOptions>
|
||||
<Version Value="10"/>
|
||||
<SearchPaths>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)/"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Other>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
@ -15,7 +15,7 @@
|
||||
<Description Value="IDE extensions using Codetools."/>
|
||||
<License Value="GPL2"/>
|
||||
<Version Major="1" Release="1"/>
|
||||
<Files Count="2">
|
||||
<Files Count="4">
|
||||
<Item1>
|
||||
<Filename Value="ppulistdlg.pas"/>
|
||||
<HasRegisterProc Value="True"/>
|
||||
@ -25,6 +25,16 @@
|
||||
<Filename Value="codystrconsts.pas"/>
|
||||
<UnitName Value="CodyStrConsts"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Filename Value="addassignmethoddlg.pas"/>
|
||||
<HasRegisterProc Value="True"/>
|
||||
<UnitName Value="AddAssignMethodDlg"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<Filename Value="codyctrls.pas"/>
|
||||
<HasRegisterProc Value="True"/>
|
||||
<UnitName Value="codyctrls"/>
|
||||
</Item4>
|
||||
</Files>
|
||||
<LazDoc Paths="doc"/>
|
||||
<i18n>
|
||||
|
||||
@ -7,13 +7,15 @@ unit Cody;
|
||||
interface
|
||||
|
||||
uses
|
||||
PPUListDlg, CodyStrConsts, LazarusPackageIntf;
|
||||
PPUListDlg, CodyStrConsts, AddAssignMethodDlg, CodyCtrls, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterUnit('PPUListDlg', @PPUListDlg.Register);
|
||||
RegisterUnit('AddAssignMethodDlg', @AddAssignMethodDlg.Register);
|
||||
RegisterUnit('CodyCtrls', @CodyCtrls.Register);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
72
components/codetools/ide/codyctrls.pas
Normal file
72
components/codetools/ide/codyctrls.pas
Normal file
@ -0,0 +1,72 @@
|
||||
{
|
||||
***************************************************************************
|
||||
* *
|
||||
* This source is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This code is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* A copy of the GNU General Public License is available on the World *
|
||||
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||
* obtain it by writing to the Free Software Foundation, *
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
Author: Mattias Gaertner
|
||||
|
||||
Abstract:
|
||||
LCL controls for Cody.
|
||||
}
|
||||
unit CodyCtrls;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, ComCtrls, Controls;
|
||||
|
||||
type
|
||||
|
||||
{ TCodyTreeView }
|
||||
|
||||
TCodyTreeView = class(TTreeView)
|
||||
public
|
||||
procedure FreeNodeData;
|
||||
end;
|
||||
|
||||
procedure Register;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterComponents('LazControls',[TCodyTreeView]);
|
||||
end;
|
||||
|
||||
{ TCodyTreeView }
|
||||
|
||||
procedure TCodyTreeView.FreeNodeData;
|
||||
var
|
||||
Node: TTreeNode;
|
||||
begin
|
||||
BeginUpdate;
|
||||
Node:=Items.GetFirstNode;
|
||||
while Node<>nil do begin
|
||||
if Node.Data<>nil then begin
|
||||
TObject(Node.Data).Free;
|
||||
Node.Data:=nil;
|
||||
end;
|
||||
Node:=Node.GetNext;
|
||||
end;
|
||||
EndUpdate;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -58,6 +58,8 @@ resourcestring
|
||||
crsVirtualUnit = 'Virtual unit';
|
||||
crsProjectOutput = 'Project output';
|
||||
crsClose = '&Close';
|
||||
crsAddAssignMethod = 'Add Assign method';
|
||||
crsAddAssignMethod2 = 'Add Assign method ...';
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
@ -10,6 +10,14 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Virtaal 0.5.1\n"
|
||||
|
||||
#: codystrconsts.crsaddassignmethod
|
||||
msgid "Add Assign method"
|
||||
msgstr ""
|
||||
|
||||
#: codystrconsts.crsaddassignmethod2
|
||||
msgid "Add Assign method ..."
|
||||
msgstr ""
|
||||
|
||||
#: codystrconsts.crsbyfpccfg
|
||||
msgid "by fpc.cfg"
|
||||
msgstr "da fpc.cfg"
|
||||
@ -75,7 +83,9 @@ msgid "searching ..."
|
||||
msgstr "Ricerca in corso..."
|
||||
|
||||
#: codystrconsts.crsshowusedppufiles
|
||||
msgid "Show used .ppu files"
|
||||
#, fuzzy
|
||||
#| msgid "Show used .ppu files"
|
||||
msgid "Show used .ppu files ..."
|
||||
msgstr "Mostra file .ppu usati"
|
||||
|
||||
#: codystrconsts.crssizeofofile
|
||||
@ -121,3 +131,4 @@ msgstr "Generale"
|
||||
#: codystrconsts.liscousespath
|
||||
msgid "Uses path"
|
||||
msgstr "Cammino clausola uses"
|
||||
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: codystrconsts.crsaddassignmethod
|
||||
msgid "Add Assign method"
|
||||
msgstr ""
|
||||
|
||||
#: codystrconsts.crsaddassignmethod2
|
||||
msgid "Add Assign method ..."
|
||||
msgstr ""
|
||||
|
||||
#: codystrconsts.crsbyfpccfg
|
||||
msgid "by fpc.cfg"
|
||||
msgstr ""
|
||||
|
||||
@ -9,6 +9,14 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: codystrconsts.crsaddassignmethod
|
||||
msgid "Add Assign method"
|
||||
msgstr ""
|
||||
|
||||
#: codystrconsts.crsaddassignmethod2
|
||||
msgid "Add Assign method ..."
|
||||
msgstr ""
|
||||
|
||||
#: codystrconsts.crsbyfpccfg
|
||||
msgid "by fpc.cfg"
|
||||
msgstr "por fpc.cfg"
|
||||
|
||||
@ -9,6 +9,14 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: codystrconsts.crsaddassignmethod
|
||||
msgid "Add Assign method"
|
||||
msgstr ""
|
||||
|
||||
#: codystrconsts.crsaddassignmethod2
|
||||
msgid "Add Assign method ..."
|
||||
msgstr ""
|
||||
|
||||
#: codystrconsts.crsbyfpccfg
|
||||
msgid "by fpc.cfg"
|
||||
msgstr "в fpc.cfg"
|
||||
|
||||
@ -12,12 +12,8 @@ msgstr ""
|
||||
"X-Generator: Virtaal 0.5.1\n"
|
||||
|
||||
#: anchordockstr.adrsafreesideofasplittermustnotbeanchorednodetypeancho
|
||||
msgid ""
|
||||
"A free side of a splitter must not be anchored: Node=%s%s%s Type=%s Anchors["
|
||||
"%s]=%s%s%s"
|
||||
msgstr ""
|
||||
"Un lato libero di uno splitter non deve essere ancorato: Nodo=%s%s%s Tipo=%s "
|
||||
"Ancore[%s]=%s%s%s"
|
||||
msgid "A free side of a splitter must not be anchored: Node=%s%s%s Type=%s Anchors[%s]=%s%s%s"
|
||||
msgstr "Un lato libero di uno splitter non deve essere ancorato: Nodo=%s%s%s Tipo=%s Ancore[%s]=%s%s%s"
|
||||
|
||||
#: anchordockstr.adrsallfiles
|
||||
msgid "All files"
|
||||
@ -25,8 +21,7 @@ msgstr "Tutti i file"
|
||||
|
||||
#: anchordockstr.adrsamountofpixelthemousehastodragbeforedragstarts
|
||||
msgid "Amount of pixel the mouse has to drag before drag starts"
|
||||
msgstr ""
|
||||
"Di quanti pixel deve spostarsi il mouse per far partire il trascinamento"
|
||||
msgstr "Di quanti pixel deve spostarsi il mouse per far partire il trascinamento"
|
||||
|
||||
#: anchordockstr.adrsanchordockinglayout
|
||||
msgid "Anchor Docking Layout"
|
||||
@ -42,16 +37,11 @@ msgstr "Ancora non trovata: Nodo=%s%s%s Ancore[%s]=%s%s%s"
|
||||
|
||||
#: anchordockstr.adrsanchortowrongsideofsplitternodeanchors
|
||||
msgid "Anchor to wrong side of splitter: Node=%s%s%s Anchors[%s]=%s%s%s"
|
||||
msgstr ""
|
||||
"L'ancora è sul lato sbagliato dello splitter: Nodo=%s%s%s Ancore[%s]=%s%s%s"
|
||||
msgstr "L'ancora è sul lato sbagliato dello splitter: Nodo=%s%s%s Ancore[%s]=%s%s%s"
|
||||
|
||||
#: anchordockstr.adrsapagemustnotbeanchorednodeparentparenttypeanchors
|
||||
msgid ""
|
||||
"A page must not be anchored: Node=%s%s%s Parent=%s ParentType=%s Anchors[%"
|
||||
"s]=%s%s%s"
|
||||
msgstr ""
|
||||
"Una pagina non deve essere ancorata:Nodo=%s%s%s Padre=%s ParentType=%s "
|
||||
"Ancore[%s]=%s%s%s"
|
||||
msgid "A page must not be anchored: Node=%s%s%s Parent=%s ParentType=%s Anchors[%s]=%s%s%s"
|
||||
msgstr "Una pagina non deve essere ancorata:Nodo=%s%s%s Padre=%s ParentType=%s Ancore[%s]=%s%s%s"
|
||||
|
||||
#: anchordockstr.adrsautomatically
|
||||
msgid "Automatically"
|
||||
@ -134,12 +124,8 @@ msgid "Header position"
|
||||
msgstr "Posizione testata"
|
||||
|
||||
#: anchordockstr.adrshideheadercaptionsforsiteswithonlyonedockedcontrol
|
||||
msgid ""
|
||||
"Hide header captions for sites with only one docked control, as that is "
|
||||
"already shown in the normal window title"
|
||||
msgstr ""
|
||||
"Nascondi il titolo della testata per siti con un solo controllo ospite, "
|
||||
"perché è già mostrato nel normale titolo della finestra"
|
||||
msgid "Hide header captions for sites with only one docked control, as that is already shown in the normal window title"
|
||||
msgstr "Nascondi il titolo della testata per siti con un solo controllo ospite, perché è già mostrato nel normale titolo della finestra"
|
||||
|
||||
#: anchordockstr.adrsleft
|
||||
msgid "left"
|
||||
@ -171,14 +157,11 @@ msgstr "I form modali non possono essere dockabili"
|
||||
|
||||
#: anchordockstr.adrsmoveheadertoleftwhenwidthheight100headeralignleft
|
||||
msgid "Move header to left when (Width/Height)*100>=HeaderAlignLeft"
|
||||
msgstr ""
|
||||
"Sposta la testata a sinistra quando (larghezza/altezza)*100 >= "
|
||||
"HeaderAlignLeft"
|
||||
msgstr "Sposta la testata a sinistra quando (larghezza/altezza)*100 >= HeaderAlignLeft"
|
||||
|
||||
#: anchordockstr.adrsmoveheadertotopwhenwidthheight100headeraligntop
|
||||
msgid "Move header to top when (Width/Height)*100<=HeaderAlignTop"
|
||||
msgstr ""
|
||||
"Sposta la testata in alto quando (larghezza/altezza)*100 <= HeaderAlignTop"
|
||||
msgstr "Sposta la testata in alto quando (larghezza/altezza)*100 <= HeaderAlignTop"
|
||||
|
||||
#: anchordockstr.adrsmovepageleft
|
||||
msgid "Move page left"
|
||||
@ -261,14 +244,8 @@ msgid "Tab position"
|
||||
msgstr "Posizione dei tab"
|
||||
|
||||
#: anchordockstr.adrsthereisanotherdockmasterinstalledonlyonedockingpac
|
||||
msgid ""
|
||||
"There is another dock master installed. Only one docking package can be "
|
||||
"installed at a time. Please uninstall the other dock master %s and restart "
|
||||
"the IDE"
|
||||
msgstr ""
|
||||
"C'è un altro pacchetto dock master installato: ci può essere un solo dock "
|
||||
"master nell'IDE, quindi dovete prima disinstallare l'attuale dockmaster %s e "
|
||||
"poi riavviare l'IDE."
|
||||
msgid "There is another dock master installed. Only one docking package can be installed at a time. Please uninstall the other dock master %s and restart the IDE"
|
||||
msgstr "C'è un altro pacchetto dock master installato: ci può essere un solo dock master nell'IDE, quindi dovete prima disinstallare l'attuale dockmaster %s e poi riavviare l'IDE."
|
||||
|
||||
#: anchordockstr.adrstop
|
||||
msgid "top"
|
||||
@ -281,3 +258,4 @@ msgstr "Per usare l'anchordocking dovete prima disinstallare %s"
|
||||
#: anchordockstr.adrsundock
|
||||
msgid "Undock"
|
||||
msgstr "Libera"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user