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