mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:19:18 +02:00
IDE, Component list: improved layout and now using standard ButtonPanel, bug #26585
git-svn-id: trunk@46043 -
This commit is contained in:
parent
acde1c2b82
commit
c93b53eafc
@ -19,38 +19,37 @@ object ComponentListForm: TComponentListForm
|
|||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = ButtonPanel
|
AnchorSideBottom.Control = ButtonPanel
|
||||||
Left = 1
|
Left = 0
|
||||||
Height = 409
|
Height = 404
|
||||||
Top = 28
|
Top = 25
|
||||||
Width = 298
|
Width = 300
|
||||||
ActivePage = TabSheetList
|
ActivePage = TabSheetList
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 1
|
|
||||||
TabIndex = 0
|
TabIndex = 0
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnChange = PageControlChange
|
OnChange = PageControlChange
|
||||||
object TabSheetList: TTabSheet
|
object TabSheetList: TTabSheet
|
||||||
Caption = 'List'
|
Caption = 'List'
|
||||||
ClientHeight = 384
|
ClientHeight = 378
|
||||||
ClientWidth = 294
|
ClientWidth = 292
|
||||||
object Panel7: TPanel
|
object Panel7: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 384
|
Height = 378
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 294
|
Width = 292
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
BorderWidth = 2
|
BorderWidth = 2
|
||||||
ClientHeight = 384
|
ClientHeight = 378
|
||||||
ClientWidth = 294
|
ClientWidth = 292
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object ListTree: TTreeView
|
object ListTree: TTreeView
|
||||||
Left = 2
|
Left = 2
|
||||||
Height = 380
|
Height = 374
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 290
|
Width = 288
|
||||||
Align = alClient
|
Align = alClient
|
||||||
DefaultItemHeight = 18
|
DefaultItemHeight = 16
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnClick = ComponentsClick
|
OnClick = ComponentsClick
|
||||||
@ -128,22 +127,22 @@ object ComponentListForm: TComponentListForm
|
|||||||
object FilterPanel: TPanel
|
object FilterPanel: TPanel
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 27
|
Height = 25
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 300
|
Width = 300
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 27
|
ClientHeight = 25
|
||||||
ClientWidth = 300
|
ClientWidth = 300
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object LabelSearch: TLabel
|
object LabelSearch: TLabel
|
||||||
AnchorSideLeft.Control = FilterPanel
|
AnchorSideLeft.Control = FilterPanel
|
||||||
AnchorSideTop.Control = FilterPanel
|
AnchorSideTop.Control = FilterPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 15
|
Height = 13
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 77
|
Width = 58
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'LabelSearch'
|
Caption = 'LabelSearch'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
@ -153,10 +152,10 @@ object ComponentListForm: TComponentListForm
|
|||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = LabelSearch
|
AnchorSideTop.Control = LabelSearch
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 89
|
Left = 70
|
||||||
Height = 25
|
Height = 21
|
||||||
Top = 1
|
Top = 2
|
||||||
Width = 184
|
Width = 203
|
||||||
OnAfterFilter = TreeFilterEdAfterFilter
|
OnAfterFilter = TreeFilterEdAfterFilter
|
||||||
ButtonWidth = 23
|
ButtonWidth = 23
|
||||||
NumGlyphs = 1
|
NumGlyphs = 1
|
||||||
@ -167,37 +166,22 @@ object ComponentListForm: TComponentListForm
|
|||||||
FilteredTreeview = ListTree
|
FilteredTreeview = ListTree
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ButtonPanel: TPanel
|
object ButtonPanel: TButtonPanel
|
||||||
AnchorSideLeft.Control = Owner
|
Left = 6
|
||||||
AnchorSideRight.Control = Owner
|
Height = 26
|
||||||
AnchorSideRight.Side = asrBottom
|
Top = 435
|
||||||
AnchorSideBottom.Control = Owner
|
Width = 288
|
||||||
AnchorSideBottom.Side = asrBottom
|
OKButton.Name = 'OKButton'
|
||||||
Left = 0
|
OKButton.DefaultCaption = True
|
||||||
Height = 29
|
OKButton.OnClick = OKButtonClick
|
||||||
Top = 438
|
HelpButton.Name = 'HelpButton'
|
||||||
Width = 300
|
HelpButton.DefaultCaption = True
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
CloseButton.Name = 'CloseButton'
|
||||||
AutoSize = True
|
CloseButton.DefaultCaption = True
|
||||||
ClientHeight = 29
|
CancelButton.Name = 'CancelButton'
|
||||||
ClientWidth = 300
|
CancelButton.DefaultCaption = True
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object UseAndCloseButton: TBitBtn
|
ShowButtons = [pbOK]
|
||||||
AnchorSideTop.Control = ButtonPanel
|
ShowBevel = False
|
||||||
AnchorSideRight.Control = ButtonPanel
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 158
|
|
||||||
Height = 27
|
|
||||||
Top = 1
|
|
||||||
Width = 132
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Right = 9
|
|
||||||
Caption = 'Use and &Close'
|
|
||||||
Kind = bkOK
|
|
||||||
ModalResult = 1
|
|
||||||
OnClick = UseAndCloseButtonClick
|
|
||||||
TabOrder = 0
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -44,8 +44,8 @@ type
|
|||||||
|
|
||||||
TComponentListForm = class(TForm)
|
TComponentListForm = class(TForm)
|
||||||
ListTree: TTreeView;
|
ListTree: TTreeView;
|
||||||
UseAndCloseButton: TBitBtn;
|
ButtonPanel: TButtonPanel;
|
||||||
ButtonPanel: TPanel;
|
OKButton: TPanelBitBtn;
|
||||||
LabelSearch: TLabel;
|
LabelSearch: TLabel;
|
||||||
PageControl: TPageControl;
|
PageControl: TPageControl;
|
||||||
FilterPanel: TPanel;
|
FilterPanel: TPanel;
|
||||||
@ -59,7 +59,7 @@ type
|
|||||||
PalletteTree: TTreeView;
|
PalletteTree: TTreeView;
|
||||||
TreeFilterEd: TTreeFilterEdit;
|
TreeFilterEd: TTreeFilterEdit;
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure UseAndCloseButtonClick(Sender: TObject);
|
procedure OKButtonClick(Sender: TObject);
|
||||||
procedure ComponentsDblClick(Sender: TObject);
|
procedure ComponentsDblClick(Sender: TObject);
|
||||||
procedure ComponentsClick(Sender: TObject);
|
procedure ComponentsClick(Sender: TObject);
|
||||||
//procedure ComponentsListboxDrawItem(Control: TWinControl; Index: Integer;
|
//procedure ComponentsListboxDrawItem(Control: TWinControl; Index: Integer;
|
||||||
@ -106,7 +106,7 @@ begin
|
|||||||
TabSheetList.Caption := lisCmpLstList;
|
TabSheetList.Caption := lisCmpLstList;
|
||||||
TabSheetPaletteTree.Caption := lisCmpLstPalette;
|
TabSheetPaletteTree.Caption := lisCmpLstPalette;
|
||||||
TabSheetInheritance.Caption := lisCmpLstInheritance;
|
TabSheetInheritance.Caption := lisCmpLstInheritance;
|
||||||
UseAndCloseButton.Caption := lisUseAndClose;
|
ButtonPanel.OKButton.Caption := lisUseAndClose;
|
||||||
|
|
||||||
ListTree.DefaultItemHeight := ComponentPaletteImageHeight + 1;
|
ListTree.DefaultItemHeight := ComponentPaletteImageHeight + 1;
|
||||||
InheritanceTree.DefaultItemHeight:= ComponentPaletteImageHeight + 1;
|
InheritanceTree.DefaultItemHeight:= ComponentPaletteImageHeight + 1;
|
||||||
@ -205,7 +205,7 @@ end;
|
|||||||
|
|
||||||
procedure TComponentListForm.UpdateButtonState;
|
procedure TComponentListForm.UpdateButtonState;
|
||||||
begin
|
begin
|
||||||
UseAndCloseButton.Enabled := Assigned(GetSelectedComponent);
|
ButtonPanel.OKButton.Enabled := Assigned(GetSelectedComponent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TComponentListForm.UpdateComponentSelection(Sender: TObject);
|
procedure TComponentListForm.UpdateComponentSelection(Sender: TObject);
|
||||||
@ -393,7 +393,7 @@ end;
|
|||||||
procedure TComponentListForm.ComponentsDblClick(Sender: TObject);
|
procedure TComponentListForm.ComponentsDblClick(Sender: TObject);
|
||||||
// This is used for all 3 treeviews
|
// This is used for all 3 treeviews
|
||||||
begin
|
begin
|
||||||
UseAndCloseButtonClick(nil); // Select and close this form
|
OKButtonClick(nil); // Select and close this form
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TComponentListForm.ComponentsClick(Sender: TObject);
|
procedure TComponentListForm.ComponentsClick(Sender: TObject);
|
||||||
@ -458,7 +458,7 @@ begin
|
|||||||
Close;
|
Close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TComponentListForm.UseAndCloseButtonClick(Sender: TObject);
|
procedure TComponentListForm.OKButtonClick(Sender: TObject);
|
||||||
// Select component from palette and close this form. User can insert the component.
|
// Select component from palette and close this form. User can insert the component.
|
||||||
var
|
var
|
||||||
AComponent: TRegisteredComponent;
|
AComponent: TRegisteredComponent;
|
||||||
|
Loading…
Reference in New Issue
Block a user