mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 08:00:34 +02:00
IDE: renamed cbmntBuildVar
git-svn-id: trunk@21407 -
This commit is contained in:
parent
8115d392f9
commit
30c59bfba2
@ -4361,12 +4361,12 @@ resourcestring
|
|||||||
lisValues = 'Values';
|
lisValues = 'Values';
|
||||||
lisDefaultValue = 'Default value';
|
lisDefaultValue = 'Default value';
|
||||||
lisConfirmDelete = 'Confirm delete';
|
lisConfirmDelete = 'Confirm delete';
|
||||||
lisDeleteBuildMode = 'Delete build mode %s%s%s?';
|
lisDeleteBuildVar = 'Delete build variable %s%s%s?';
|
||||||
lisValue2 = 'Value%s';
|
lisValue2 = 'Value%s';
|
||||||
lisDeleteValue = 'Delete value %s%s%s';
|
lisDeleteValue = 'Delete value %s%s%s';
|
||||||
lisInvalidBuildModeTheBuildModeMustBeAPascalIdentifie = 'Invalid build '
|
lisInvalidBuildVarTheBuildVarMustBeAPascalIdentifie = 'Invalid build '
|
||||||
+'mode %s%s%s. The build mode must be a pascal identifier.';
|
+'variable %s%s%s. The build variable must be a pascal identifier.';
|
||||||
lisThereIsAlreadyABuildModeWithTheName = 'There is already a build mode '
|
lisThereIsAlreadyABuildVarWithTheName = 'There is already a build variable '
|
||||||
+'with the name %s%s%s.';
|
+'with the name %s%s%s.';
|
||||||
lisDuplicateFoundOfValue = 'Duplicate found of value %s%s%s.';
|
lisDuplicateFoundOfValue = 'Duplicate found of value %s%s%s.';
|
||||||
lisSetValue = 'Set value';
|
lisSetValue = 'Set value';
|
||||||
|
@ -32,7 +32,7 @@ uses
|
|||||||
type
|
type
|
||||||
TCBMNodeType = (
|
TCBMNodeType = (
|
||||||
cbmntNone,
|
cbmntNone,
|
||||||
cbmntBuildMode,
|
cbmntBuildVar,
|
||||||
cbmntValues,
|
cbmntValues,
|
||||||
cbmntValue,
|
cbmntValue,
|
||||||
cbmntDefaultValue,
|
cbmntDefaultValue,
|
||||||
@ -52,8 +52,8 @@ type
|
|||||||
procedure BuildVarsTreeViewStartDrag(Sender: TObject;
|
procedure BuildVarsTreeViewStartDrag(Sender: TObject;
|
||||||
var DragObject: TDragObject);
|
var DragObject: TDragObject);
|
||||||
procedure BuildVarsTVPopupMenuPopup(Sender: TObject);
|
procedure BuildVarsTVPopupMenuPopup(Sender: TObject);
|
||||||
procedure DeleteBuildModeClick(Sender: TObject);
|
procedure DeleteBuildVarClick(Sender: TObject);
|
||||||
procedure NewBuildModeClick(Sender: TObject);
|
procedure NewBuildVarClick(Sender: TObject);
|
||||||
procedure NewValueClick(Sender: TObject);
|
procedure NewValueClick(Sender: TObject);
|
||||||
procedure DeleteValueClick(Sender: TObject);
|
procedure DeleteValueClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
@ -65,12 +65,12 @@ type
|
|||||||
FEditors: TFPList;// list of TCompOptsExprEditor
|
FEditors: TFPList;// list of TCompOptsExprEditor
|
||||||
procedure SetBuildProperties(const AValue: TIDEBuildProperties);
|
procedure SetBuildProperties(const AValue: TIDEBuildProperties);
|
||||||
procedure RebuildTreeView;
|
procedure RebuildTreeView;
|
||||||
procedure TreeViewAddBuildMode(BuildProperty: TLazBuildProperty);
|
procedure TreeViewAddBuildVar(BuildProperty: TLazBuildProperty);
|
||||||
procedure TreeViewAddValue(ValuesTVNode: TTreeNode; aValue: string);
|
procedure TreeViewAddValue(ValuesTVNode: TTreeNode; aValue: string);
|
||||||
function GetNodeInfo(Node: TTreeNode; out BuildProperty: TLazBuildProperty): TCBMNodeType;
|
function GetNodeInfo(Node: TTreeNode; out BuildProperty: TLazBuildProperty): TCBMNodeType;
|
||||||
function GetSelectedNode(out BuildProperty: TLazBuildProperty;
|
function GetSelectedNode(out BuildProperty: TLazBuildProperty;
|
||||||
out NodeType: TCBMNodeType): TTreeNode;
|
out NodeType: TCBMNodeType): TTreeNode;
|
||||||
function GetBuildModeTVNode(BuildProperty: TLazBuildProperty): TTreeNode;
|
function GetBuildVarTVNode(BuildProperty: TLazBuildProperty): TTreeNode;
|
||||||
function GetValuesTVNode(BuildProperty: TLazBuildProperty): TTreeNode;
|
function GetValuesTVNode(BuildProperty: TLazBuildProperty): TTreeNode;
|
||||||
procedure FreeEditors;
|
procedure FreeEditors;
|
||||||
function GetEditor(BuildProperty: TLazBuildProperty): TCompOptsExprEditor;
|
function GetEditor(BuildProperty: TLazBuildProperty): TCompOptsExprEditor;
|
||||||
@ -84,7 +84,7 @@ implementation
|
|||||||
|
|
||||||
{ TCompOptBuildVarsFrame }
|
{ TCompOptBuildVarsFrame }
|
||||||
|
|
||||||
procedure TCompOptBuildVarsFrame.NewBuildModeClick(Sender: TObject);
|
procedure TCompOptBuildVarsFrame.NewBuildVarClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
NewIdentifier: String;
|
NewIdentifier: String;
|
||||||
NewBuildProperty: TLazBuildProperty;
|
NewBuildProperty: TLazBuildProperty;
|
||||||
@ -99,7 +99,7 @@ begin
|
|||||||
NewBuildProperty.DefaultValue.Root.AddLast(SetResultNode);
|
NewBuildProperty.DefaultValue.Root.AddLast(SetResultNode);
|
||||||
// add to TreeView
|
// add to TreeView
|
||||||
BuildVarsTreeView.BeginUpdate;
|
BuildVarsTreeView.BeginUpdate;
|
||||||
TreeViewAddBuildMode(NewBuildProperty);
|
TreeViewAddBuildVar(NewBuildProperty);
|
||||||
BuildVarsTreeView.EndUpdate;
|
BuildVarsTreeView.EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ begin
|
|||||||
BuildVarsTreeView.EndUpdate;
|
BuildVarsTreeView.EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCompOptBuildVarsFrame.DeleteBuildModeClick(Sender: TObject);
|
procedure TCompOptBuildVarsFrame.DeleteBuildVarClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
BuildProperty: TIDEBuildProperty;
|
BuildProperty: TIDEBuildProperty;
|
||||||
SelTVNode: TTreeNode;
|
SelTVNode: TTreeNode;
|
||||||
@ -160,7 +160,7 @@ begin
|
|||||||
SelTVNode:=GetSelectedNode(TLazBuildProperty(BuildProperty),NodeType);
|
SelTVNode:=GetSelectedNode(TLazBuildProperty(BuildProperty),NodeType);
|
||||||
if BuildProperty=nil then exit;
|
if BuildProperty=nil then exit;
|
||||||
if MessageDlg(lisConfirmDelete,
|
if MessageDlg(lisConfirmDelete,
|
||||||
Format(lisDeleteBuildMode, ['"', BuildProperty.Identifier, '"']),
|
Format(lisDeleteBuildVar, ['"', BuildProperty.Identifier, '"']),
|
||||||
mtConfirmation,[mbYes,mbCancel],0)<>mrYes
|
mtConfirmation,[mbYes,mbCancel],0)<>mrYes
|
||||||
then exit;
|
then exit;
|
||||||
i:=BuildProperties.IndexOfIdentifier(BuildProperty.Identifier);
|
i:=BuildProperties.IndexOfIdentifier(BuildProperty.Identifier);
|
||||||
@ -200,14 +200,14 @@ begin
|
|||||||
BuildVarsTVPopupMenu.Items.Clear;
|
BuildVarsTVPopupMenu.Items.Clear;
|
||||||
GetSelectedNode(BuildProperty,NodeType);
|
GetSelectedNode(BuildProperty,NodeType);
|
||||||
|
|
||||||
if NodeType in [cbmntBuildMode,cbmntValues,cbmntValue] then
|
if NodeType in [cbmntBuildVar,cbmntValues,cbmntValue] then
|
||||||
Add('New value',@NewValueClick);
|
Add('New value',@NewValueClick);
|
||||||
if NodeType in [cbmntValue] then
|
if NodeType in [cbmntValue] then
|
||||||
Add('Delete value ...',@DeleteValueClick);
|
Add('Delete value ...',@DeleteValueClick);
|
||||||
AddSeparator;
|
AddSeparator;
|
||||||
Add('New build mode',@NewBuildModeClick);
|
Add('New build mode',@NewBuildVarClick);
|
||||||
if NodeType in [cbmntBuildMode] then
|
if NodeType in [cbmntBuildVar] then
|
||||||
Add('Delete build mode ...',@DeleteBuildModeClick);
|
Add('Delete build mode ...',@DeleteBuildVarClick);
|
||||||
if NodeType in [cbmntDefaultValue,cbmntDefaultValueEditor] then begin
|
if NodeType in [cbmntDefaultValue,cbmntDefaultValueEditor] then begin
|
||||||
Editor:=GetEditor(BuildProperty);
|
Editor:=GetEditor(BuildProperty);
|
||||||
Editor.FillPopupMenu(BuildVarsTVPopupMenu);
|
Editor.FillPopupMenu(BuildVarsTVPopupMenu);
|
||||||
@ -221,7 +221,7 @@ var
|
|||||||
NodeType: TCBMNodeType;
|
NodeType: TCBMNodeType;
|
||||||
begin
|
begin
|
||||||
NodeType:=GetNodeInfo(Node,BuildProperty);
|
NodeType:=GetNodeInfo(Node,BuildProperty);
|
||||||
AllowEdit:=NodeType in [cbmntBuildMode,cbmntValue];
|
AllowEdit:=NodeType in [cbmntBuildVar,cbmntValue];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCompOptBuildVarsFrame.BuildVarsTreeViewStartDrag(Sender: TObject;
|
procedure TCompOptBuildVarsFrame.BuildVarsTreeViewStartDrag(Sender: TObject;
|
||||||
@ -241,12 +241,12 @@ begin
|
|||||||
NodeType:=GetNodeInfo(Node,BuildProperty);
|
NodeType:=GetNodeInfo(Node,BuildProperty);
|
||||||
case NodeType of
|
case NodeType of
|
||||||
|
|
||||||
cbmntBuildMode:
|
cbmntBuildVar:
|
||||||
if S<>BuildProperty.Identifier then begin
|
if S<>BuildProperty.Identifier then begin
|
||||||
// rename build mode
|
// rename build mode
|
||||||
if (S='') or (not IsValidIdent(S)) then begin
|
if (S='') or (not IsValidIdent(S)) then begin
|
||||||
MessageDlg(lisCCOErrorCaption,
|
MessageDlg(lisCCOErrorCaption,
|
||||||
Format(lisInvalidBuildModeTheBuildModeMustBeAPascalIdentifie, ['"',
|
Format(lisInvalidBuildVarTheBuildVarMustBeAPascalIdentifie, ['"',
|
||||||
S, '"']),
|
S, '"']),
|
||||||
mtError,[mbCancel],0);
|
mtError,[mbCancel],0);
|
||||||
S:=BuildProperty.Identifier;
|
S:=BuildProperty.Identifier;
|
||||||
@ -256,7 +256,7 @@ begin
|
|||||||
if (ConflictBuildProperty<>nil) and (ConflictBuildProperty<>BuildProperty) then
|
if (ConflictBuildProperty<>nil) and (ConflictBuildProperty<>BuildProperty) then
|
||||||
begin
|
begin
|
||||||
MessageDlg(lisCCOErrorCaption,
|
MessageDlg(lisCCOErrorCaption,
|
||||||
Format(lisThereIsAlreadyABuildModeWithTheName, ['"', S, '"']),
|
Format(lisThereIsAlreadyABuildVarWithTheName, ['"', S, '"']),
|
||||||
mtError,[mbCancel],0);
|
mtError,[mbCancel],0);
|
||||||
S:=BuildProperty.Identifier;
|
S:=BuildProperty.Identifier;
|
||||||
exit;
|
exit;
|
||||||
@ -299,12 +299,12 @@ begin
|
|||||||
if BuildProperties<>nil then begin
|
if BuildProperties<>nil then begin
|
||||||
// first level: build modes
|
// first level: build modes
|
||||||
for i:=0 to BuildProperties.Count-1 do
|
for i:=0 to BuildProperties.Count-1 do
|
||||||
TreeViewAddBuildMode(BuildProperties.Items[i]);
|
TreeViewAddBuildVar(BuildProperties.Items[i]);
|
||||||
end;
|
end;
|
||||||
BuildVarsTreeView.EndUpdate;
|
BuildVarsTreeView.EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCompOptBuildVarsFrame.TreeViewAddBuildMode(
|
procedure TCompOptBuildVarsFrame.TreeViewAddBuildVar(
|
||||||
BuildProperty: TLazBuildProperty);
|
BuildProperty: TLazBuildProperty);
|
||||||
var
|
var
|
||||||
TVNode: TTreeNode;
|
TVNode: TTreeNode;
|
||||||
@ -341,7 +341,7 @@ begin
|
|||||||
Editor.Setup(BuildVarsTreeView,DefValueTVNode,
|
Editor.Setup(BuildVarsTreeView,DefValueTVNode,
|
||||||
BuildProperty.DefaultValue as TCompOptConditionals,[cocvtResult]);
|
BuildProperty.DefaultValue as TCompOptConditionals,[cocvtResult]);
|
||||||
end;
|
end;
|
||||||
//DebugLn(['TCompOptBuildModesFrame.TreeViewAddBuildMode ',TVNode.Text]);
|
//DebugLn(['TCompOptBuildVarsFrame.TreeViewAddBuildVar ',TVNode.Text]);
|
||||||
TVNode.Expand(true);
|
TVNode.Expand(true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -366,11 +366,11 @@ function TCompOptBuildVarsFrame.GetNodeInfo(Node: TTreeNode; out
|
|||||||
Result:=cbmntNone
|
Result:=cbmntNone
|
||||||
else if TObject(CurNode.Data) is TLazBuildProperty then begin
|
else if TObject(CurNode.Data) is TLazBuildProperty then begin
|
||||||
BuildProperty:=TLazBuildProperty(CurNode.Data);
|
BuildProperty:=TLazBuildProperty(CurNode.Data);
|
||||||
Result:=cbmntBuildMode;
|
Result:=cbmntBuildVar;
|
||||||
end else begin
|
end else begin
|
||||||
ParentType:=GetNodeType(CurNode.Parent);
|
ParentType:=GetNodeType(CurNode.Parent);
|
||||||
case ParentType of
|
case ParentType of
|
||||||
cbmntBuildMode:
|
cbmntBuildVar:
|
||||||
if CurNode.Text=lisValues then
|
if CurNode.Text=lisValues then
|
||||||
Result:=cbmntValues
|
Result:=cbmntValues
|
||||||
else if CurNode.Text=lisDefaultValue then
|
else if CurNode.Text=lisDefaultValue then
|
||||||
@ -395,7 +395,7 @@ begin
|
|||||||
NodeType:=GetNodeInfo(Result,BuildProperty);
|
NodeType:=GetNodeInfo(Result,BuildProperty);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCompOptBuildVarsFrame.GetBuildModeTVNode(BuildProperty: TLazBuildProperty
|
function TCompOptBuildVarsFrame.GetBuildVarTVNode(BuildProperty: TLazBuildProperty
|
||||||
): TTreeNode;
|
): TTreeNode;
|
||||||
begin
|
begin
|
||||||
Result:=BuildVarsTreeView.Items.GetFirstNode;
|
Result:=BuildVarsTreeView.Items.GetFirstNode;
|
||||||
@ -406,11 +406,11 @@ end;
|
|||||||
function TCompOptBuildVarsFrame.GetValuesTVNode(BuildProperty: TLazBuildProperty
|
function TCompOptBuildVarsFrame.GetValuesTVNode(BuildProperty: TLazBuildProperty
|
||||||
): TTreeNode;
|
): TTreeNode;
|
||||||
var
|
var
|
||||||
BuildModeTVNode: TTreeNode;
|
BuildVarTVNode: TTreeNode;
|
||||||
begin
|
begin
|
||||||
BuildModeTVNode:=GetBuildModeTVNode(BuildProperty);
|
BuildVarTVNode:=GetBuildVarTVNode(BuildProperty);
|
||||||
if (BuildModeTVNode<>nil) then
|
if (BuildVarTVNode<>nil) then
|
||||||
Result:=BuildModeTVNode.GetFirstChild
|
Result:=BuildVarTVNode.GetFirstChild
|
||||||
else
|
else
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user