mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 10:39:15 +02:00
IDE: build macros: fixed layout of property dialog
git-svn-id: trunk@26868 -
This commit is contained in:
parent
ffdc91c193
commit
3d89257182
@ -31,6 +31,7 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
TabOrder = 0
|
||||
OnEdited = BuildMacrosTreeViewEdited
|
||||
OnEditing = BuildMacrosTreeViewEditing
|
||||
OnKeyDown = BuildMacrosTreeViewKeyDown
|
||||
OnStartDrag = BuildMacrosTreeViewStartDrag
|
||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ uses
|
||||
Classes, SysUtils, LCLProc, FileUtil, Controls, Forms, StdCtrls,
|
||||
Grids, Buttons, ExtCtrls, Dialogs, ComCtrls, Menus, AvgLvlTree,
|
||||
IDEImagesIntf, ProjectIntf, PackageIntf, CompilerOptions,
|
||||
Compiler_CondTree, LazarusIDEStrConsts, CompOptsModes;
|
||||
Compiler_CondTree, LazarusIDEStrConsts, CompOptsModes, PackageDefs;
|
||||
|
||||
type
|
||||
TCBMNodeType = (
|
||||
@ -49,6 +49,8 @@ type
|
||||
var S: string);
|
||||
procedure BuildMacrosTreeViewEditing(Sender: TObject; Node: TTreeNode;
|
||||
var AllowEdit: Boolean);
|
||||
procedure BuildMacrosTreeViewKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure BuildMacrosTreeViewStartDrag(Sender: TObject;
|
||||
var DragObject: TDragObject);
|
||||
procedure BuildMacrosTVPopupMenuPopup(Sender: TObject);
|
||||
@ -178,7 +180,7 @@ end;
|
||||
|
||||
procedure TCompOptBuildMacrosFrame.BuildMacrosTVPopupMenuPopup(Sender: TObject);
|
||||
var
|
||||
BuildProperty: TLazBuildMacro;
|
||||
aBuildMacro: TLazBuildMacro;
|
||||
NodeType: TCBMNodeType;
|
||||
Editor: TCompOptsExprEditor;
|
||||
|
||||
@ -201,7 +203,7 @@ var
|
||||
|
||||
begin
|
||||
BuildMacrosTVPopupMenu.Items.Clear;
|
||||
GetSelectedNode(BuildProperty,NodeType);
|
||||
GetSelectedNode(aBuildMacro,NodeType);
|
||||
|
||||
if NodeType in [cbmntBuildMacro,cbmntValues,cbmntValue] then
|
||||
Add('New value',@NewValueClick);
|
||||
@ -212,7 +214,7 @@ begin
|
||||
if NodeType in [cbmntBuildMacro] then
|
||||
Add('Delete build macro ...',@DeleteBuildMacroClick);
|
||||
if NodeType in [cbmntDefaultValue,cbmntDefaultValueEditor] then begin
|
||||
Editor:=GetEditor(BuildProperty);
|
||||
Editor:=GetEditor(aBuildMacro);
|
||||
Editor.FillPopupMenu(BuildMacrosTVPopupMenu);
|
||||
end;
|
||||
end;
|
||||
@ -227,6 +229,12 @@ begin
|
||||
AllowEdit:=NodeType in [cbmntBuildMacro,cbmntValue];
|
||||
end;
|
||||
|
||||
procedure TCompOptBuildMacrosFrame.BuildMacrosTreeViewKeyDown(Sender: TObject;
|
||||
var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TCompOptBuildMacrosFrame.BuildMacrosTreeViewStartDrag(Sender: TObject;
|
||||
var DragObject: TDragObject);
|
||||
begin
|
||||
@ -443,8 +451,8 @@ function TCompOptBuildMacrosFrame.GetMacroNamePrefix: string;
|
||||
begin
|
||||
Result:='BuildMacro';
|
||||
if (BuildMacros=nil) or (BuildMacros.Owner=nil) then exit;
|
||||
if BuildMacros.Owner is TIDEPackage then
|
||||
Result:=TIDEPackage(BuildMacros.Owner).Name+'_macro';
|
||||
if BuildMacros.Owner is TPkgCompilerOptions then
|
||||
Result:=TPkgCompilerOptions(BuildMacros.Owner).LazPackage.Name+'_macro';
|
||||
end;
|
||||
|
||||
constructor TCompOptBuildMacrosFrame.Create(TheOwner: TComponent);
|
||||
|
@ -16,6 +16,11 @@
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
Author: Mattias Gaertner
|
||||
|
||||
Abstract:
|
||||
TCompOptsCondTreeFrame is a frame to edit conditional compiler options.
|
||||
}
|
||||
unit Compiler_CondTree;
|
||||
|
||||
|
@ -8,34 +8,44 @@ object CompOptCondPropsDialog: TCompOptCondPropsDialog
|
||||
ClientHeight = 205
|
||||
ClientWidth = 635
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '0.9.27'
|
||||
LCLVersion = '0.9.29'
|
||||
object ButtonPanel1: TButtonPanel
|
||||
Left = 6
|
||||
Height = 26
|
||||
Top = 173
|
||||
Height = 34
|
||||
Top = 165
|
||||
Width = 623
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.Caption = '&OK'
|
||||
HelpButton.Name = 'HelpButton'
|
||||
HelpButton.Caption = '&Help'
|
||||
CloseButton.Name = 'CloseButton'
|
||||
CloseButton.Caption = '&Close'
|
||||
CloseButton.Enabled = False
|
||||
CancelButton.Name = 'CancelButton'
|
||||
CancelButton.Caption = 'Cancel'
|
||||
TabOrder = 0
|
||||
ShowButtons = [pbOK, pbCancel, pbHelp]
|
||||
ShowBevel = False
|
||||
end
|
||||
object PropsGroupBox: TGroupBox
|
||||
Left = 0
|
||||
Height = 167
|
||||
Height = 159
|
||||
Top = 0
|
||||
Width = 635
|
||||
Align = alClient
|
||||
Caption = 'PropsGroupBox'
|
||||
ClientHeight = 149
|
||||
ClientWidth = 631
|
||||
ClientHeight = 138
|
||||
ClientWidth = 627
|
||||
TabOrder = 1
|
||||
OnResize = PropsGroupBoxResize
|
||||
object NodeTypeLabel: TLabel
|
||||
AnchorSideLeft.Control = PropsGroupBox
|
||||
AnchorSideTop.Control = NodeTypeComboBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 14
|
||||
Top = 9
|
||||
Width = 75
|
||||
Height = 18
|
||||
Top = 10
|
||||
Width = 100
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'NodeTypeLabel'
|
||||
ParentColor = False
|
||||
@ -45,9 +55,9 @@ object CompOptCondPropsDialog: TCompOptCondPropsDialog
|
||||
AnchorSideTop.Control = ValueTypeComboBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 14
|
||||
Top = 36
|
||||
Width = 76
|
||||
Height = 18
|
||||
Top = 43
|
||||
Width = 102
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'ValueTypeLabel'
|
||||
ParentColor = False
|
||||
@ -57,29 +67,26 @@ object CompOptCondPropsDialog: TCompOptCondPropsDialog
|
||||
AnchorSideTop.Control = ValueEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 14
|
||||
Top = 64
|
||||
Width = 88
|
||||
Height = 18
|
||||
Top = 76
|
||||
Width = 108
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'ValueLabel.........'
|
||||
ParentColor = False
|
||||
end
|
||||
object NodeTypeComboBox: TComboBox
|
||||
AnchorSideLeft.Control = ValueLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = PropsGroupBox
|
||||
AnchorSideRight.Control = PropsGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 100
|
||||
Height = 21
|
||||
Left = 132
|
||||
Height = 27
|
||||
Top = 6
|
||||
Width = 525
|
||||
Width = 489
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoComplete = False
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
ItemHeight = 13
|
||||
ItemWidth = 0
|
||||
ItemHeight = 0
|
||||
OnEditingDone = NodeTypeComboBoxEditingDone
|
||||
TabOrder = 0
|
||||
Text = 'NodeTypeComboBox'
|
||||
@ -90,16 +97,14 @@ object CompOptCondPropsDialog: TCompOptCondPropsDialog
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = PropsGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 100
|
||||
Height = 21
|
||||
Top = 33
|
||||
Width = 525
|
||||
Left = 132
|
||||
Height = 27
|
||||
Top = 39
|
||||
Width = 489
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoComplete = False
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
ItemHeight = 13
|
||||
ItemWidth = 0
|
||||
ItemHeight = 0
|
||||
OnEditingDone = ValueTypeComboBoxEditingDone
|
||||
TabOrder = 1
|
||||
Text = 'ValueTypeComboBox'
|
||||
@ -109,12 +114,11 @@ object CompOptCondPropsDialog: TCompOptCondPropsDialog
|
||||
AnchorSideTop.Control = ValueTypeComboBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = ValueButton
|
||||
Left = 100
|
||||
Height = 23
|
||||
Top = 60
|
||||
Width = 490
|
||||
Left = 132
|
||||
Height = 27
|
||||
Top = 72
|
||||
Width = 404
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
OnEditingDone = ValueEditEditingDone
|
||||
TabOrder = 2
|
||||
@ -127,10 +131,10 @@ object CompOptCondPropsDialog: TCompOptCondPropsDialog
|
||||
AnchorSideRight.Control = PropsGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 590
|
||||
Height = 23
|
||||
Top = 60
|
||||
Width = 35
|
||||
Left = 536
|
||||
Height = 27
|
||||
Top = 72
|
||||
Width = 85
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 6
|
||||
|
@ -16,6 +16,11 @@
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
Author: Mattias Gaertner
|
||||
|
||||
Abstract:
|
||||
|
||||
}
|
||||
unit CompOptCondPropsDlg;
|
||||
|
||||
@ -24,7 +29,7 @@ unit CompOptCondPropsDlg;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||
Math, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||
ButtonPanel, StdCtrls,
|
||||
ProjectIntf,
|
||||
LazarusIDEStrConsts;
|
||||
@ -46,6 +51,7 @@ type
|
||||
procedure ButtonPanel1OkClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure NodeTypeComboBoxEditingDone(Sender: TObject);
|
||||
procedure PropsGroupBoxResize(Sender: TObject);
|
||||
procedure ValueEditEditingDone(Sender: TObject);
|
||||
procedure ValueTypeComboBoxEditingDone(Sender: TObject);
|
||||
private
|
||||
@ -129,6 +135,13 @@ begin
|
||||
UpdateValueControls;
|
||||
end;
|
||||
|
||||
procedure TCompOptCondPropsDialog.PropsGroupBoxResize(Sender: TObject);
|
||||
begin
|
||||
NodeTypeComboBox.Left:=6+Max(Max(NodeTypeLabel.Left+NodeTypeLabel.Width,
|
||||
ValueTypeLabel.Left+ValueTypeLabel.Width),
|
||||
ValueLabel.Left+ValueLabel.Width);
|
||||
end;
|
||||
|
||||
procedure TCompOptCondPropsDialog.ValueEditEditingDone(Sender: TObject);
|
||||
begin
|
||||
GetValue;
|
||||
@ -252,6 +265,7 @@ begin
|
||||
else ValueLabel.Caption:='?';
|
||||
end;
|
||||
ValueEdit.Text:=FValue;
|
||||
PropsGroupBoxResize(nil);
|
||||
end;
|
||||
|
||||
procedure TCompOptCondPropsDialog.SetValue(const AValue: string);
|
||||
|
Loading…
Reference in New Issue
Block a user