implemented TButtonPanel

git-svn-id: trunk@17001 -
This commit is contained in:
darius 2008-10-15 10:42:45 +00:00
parent 8c147b5f91
commit bfe53c3694
3 changed files with 180 additions and 152 deletions

View File

@ -3,133 +3,162 @@ object ViewUnitDialog: TViewUnitDialog
Height = 301
Top = 280
Width = 378
HelpContext = 0
ActiveControl = Edit
Align = alNone
AllowDropFiles = False
AutoScroll = True
AutoSize = False
BorderIcons = [biSystemMenu]
BorderStyle = bsSizeable
Caption = 'View Project Units'
ChildSizing.LeftRightSpacing = 0
ChildSizing.TopBottomSpacing = 0
ChildSizing.HorizontalSpacing = 0
ChildSizing.VerticalSpacing = 0
ChildSizing.ControlsPerLine = 0
ClientHeight = 301
ClientWidth = 378
OnCreate = FormCreate
DockSite = False
DragKind = dkDrag
DragMode = dmManual
Enabled = True
Font.Height = 0
Font.Style = []
FormStyle = fsNormal
ParentBiDiMode = True
ParentFont = False
Position = poScreenCenter
LCLVersion = '0.9.25'
ShowInTaskBar = stDefault
UseDockManager = False
LCLVersion = '0.9.27'
WindowState = wsNormal
object Edit: TEdit
Left = 6
Height = 25
Top = 6
Width = 366
HelpContext = 0
Align = alTop
Anchors = [akRight]
AutoSize = False
AutoSelect = False
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
CharCase = ecNormal
DragCursor = crDrag
DragMode = dmManual
EchoMode = emNormal
Enabled = True
MaxLength = -1
ParentBidiMode = True
OnChange = EditChange
OnEnter = EditEnter
OnKeyDown = EditKeyDown
ParentFont = True
ParentShowHint = True
PasswordChar = #0
ReadOnly = False
TabStop = True
TabOrder = 1
Visible = True
end
object Listbox: TListBox
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = MultiSelectCheckBox
Left = 6
Height = 183
Height = 182
Top = 37
Width = 366
Align = alTop
HelpContext = 0
Align = alClient
Anchors = [akBottom]
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
BorderStyle = bsSingle
ClickOnSelChange = False
Columns = 0
DragCursor = crDrag
DragKind = dkDrag
DragMode = dmManual
ExtendedSelect = True
Enabled = True
IntegralHeight = False
ItemHeight = 0
MultiSelect = False
OnClick = ListboxClick
OnDblClick = BTNOKCLICK
OnDblClick = OKButtonClick
OnKeyDown = ListboxKeyDown
ParentBidiMode = True
ParentShowHint = True
ParentFont = True
Sorted = False
Style = lbStandard
TabOrder = 0
TabStop = True
TopIndex = -1
Visible = True
end
object MultiSelectCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = BtnPanel
Left = 6
Height = 19
Top = 226
Width = 80
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
Caption = 'Multi Select'
OnClick = MultiselectCheckBoxClick
TabOrder = 2
end
object BtnPanel: TPanel
Height = 50
Top = 251
Width = 378
Height = 22
Top = 225
Width = 366
HelpContext = 0
Align = alBottom
BevelOuter = bvNone
ClientHeight = 50
ClientWidth = 378
AllowGrayed = False
Anchors = [akLeft, akBottom]
AutoSize = True
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
Caption = 'Multi Select'
Checked = False
DragCursor = crDrag
DragKind = dkDrag
DragMode = dmManual
Enabled = True
OnClick = MultiselectCheckBoxClick
ParentColor = True
ParentFont = True
ParentShowHint = True
ParentBidiMode = True
State = cbUnchecked
TabOrder = 2
TabStop = True
UseOnChange = False
Visible = True
end
object ButtonPanel: TButtonPanel
Left = 6
Height = 48
Top = 253
Width = 366
HelpContext = 0
Align = alBottom
AutoSize = True
ButtonOrder = boDefault
TabOrder = 3
object btnCancel: TBitBtn
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 297
Height = 38
Top = 6
Width = 75
Align = alRight
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Cancel = True
Caption = 'Cancel'
Constraints.MinHeight = 25
Constraints.MinWidth = 75
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
OnClick = BTNCANCELCLICK
TabOrder = 0
end
object btnOK: TBitBtn
AnchorSideRight.Control = btnCancel
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 216
Height = 38
Top = 6
Width = 75
Align = alRight
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = '&OK'
Constraints.MinHeight = 25
Constraints.MinWidth = 75
Default = True
Kind = bkOK
ModalResult = 1
NumGlyphs = 0
OnClick = BTNOKCLICK
TabOrder = 1
end
object HelpButton: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 38
Top = 6
Width = 75
Align = alLeft
Anchors = [akLeft, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = '&Help'
Constraints.MinHeight = 25
Constraints.MinWidth = 75
Kind = bkHelp
NumGlyphs = 0
OnClick = HelpButtonClick
TabOrder = 2
end
DefaultButton = pbOK
ShowButtons = [pbOK, pbCancel, pbHelp]
ShowGlyphs = [pbOK, pbCancel, pbClose, pbHelp]
Visible = True
end
end

View File

@ -2,45 +2,55 @@
LazarusResources.Add('TViewUnitDialog','FORMDATA',[
'TPF0'#15'TViewUnitDialog'#14'ViewUnitDialog'#4'Left'#3'J'#1#6'Height'#3'-'#1
+#3'Top'#3#24#1#5'Width'#3'z'#1#13'ActiveControl'#7#4'Edit'#11'BorderIcons'#11
+#12'biSystemMenu'#0#7'Caption'#6#18'View Project Units'#12'ClientHeight'#3'-'
+#1#11'ClientWidth'#3'z'#1#8'OnCreate'#7#10'FormCreate'#10'ParentFont'#8#8'Po'
+'sition'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.25'#0#5'TEdit'#4'Edit'#4
+'Left'#2#6#6'Height'#2#25#3'Top'#2#6#5'Width'#3'n'#1#5'Align'#7#5'alTop'#7'A'
+'nchors'#11#7'akRight'#0#20'BorderSpacing.Around'#2#6#8'OnChange'#7#10'EditC'
+'hange'#7'OnEnter'#7#9'EditEnter'#9'OnKeyDown'#7#11'EditKeyDown'#8'TabOrder'
+#2#1#0#0#8'TListBox'#7'Listbox'#18'AnchorSideTop.Side'#7#9'asrBottom'#20'Anc'
+'horSideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#19'MultiSe'
+'lectCheckBox'#4'Left'#2#6#6'Height'#3#183#0#3'Top'#2'%'#5'Width'#3'n'#1#5'A'
+'lign'#7#5'alTop'#7'Anchors'#11#8'akBottom'#0#20'BorderSpacing.Around'#2#6#16
+'ClickOnSelChange'#8#7'OnClick'#7#12'ListboxClick'#10'OnDblClick'#7#10'BTNOK'
+'CLICK'#9'OnKeyDown'#7#14'ListboxKeyDown'#8'TabOrder'#2#0#0#0#9'TCheckBox'#19
+'MultiSelectCheckBox'#22'AnchorSideLeft.Control'#7#5'Owner'#18'AnchorSideTop'
+'.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#8'BtnPanel'#4'Left'#2#6
+#6'Height'#2#19#3'Top'#3#226#0#5'Width'#2'P'#7'Anchors'#11#6'akLeft'#8'akBot'
+'tom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'Multi Select'#7'OnClick'
+#7#24'MultiselectCheckBoxClick'#8'TabOrder'#2#2#0#0#6'TPanel'#8'BtnPanel'#6
+'Height'#2'2'#3'Top'#3#251#0#5'Width'#3'z'#1#5'Align'#7#8'alBottom'#10'Bevel'
+'Outer'#7#6'bvNone'#12'ClientHeight'#2'2'#11'ClientWidth'#3'z'#1#8'TabOrder'
+#2#3#0#7'TBitBtn'#9'btnCancel'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'Anch'
+'orSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#24
+'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBotto'
+'m'#4'Left'#3')'#1#6'Height'#2'&'#3'Top'#2#6#5'Width'#2'K'#5'Align'#7#7'alRi'
+'ght'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.'
+'Around'#2#6#6'Cancel'#9#7'Caption'#6#6'Cancel'#21'Constraints.MinHeight'#2
+#25#20'Constraints.MinWidth'#2'K'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9
+'NumGlyphs'#2#0#7'OnClick'#7#14'BTNCANCELCLICK'#8'TabOrder'#2#0#0#0#7'TBitBt'
+'n'#5'btnOK'#23'AnchorSideRight.Control'#7#9'btnCancel'#24'AnchorSideBottom.'
+'Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#216#0
+#6'Height'#2'&'#3'Top'#2#6#5'Width'#2'K'#5'Align'#7#7'alRight'#7'Anchors'#11
+#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Capti'
+'on'#6#3'&OK'#21'Constraints.MinHeight'#2#25#20'Constraints.MinWidth'#2'K'#7
+'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#7'OnClick'
+#7#10'BTNOKCLICK'#8'TabOrder'#2#1#0#0#7'TBitBtn'#10'HelpButton'#22'AnchorSid'
+'eLeft.Control'#7#5'Owner'#24'AnchorSideBottom.Control'#7#5'Owner'#21'Anchor'
+'SideBottom.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2'&'#3'Top'#2#6#5'Wid'
+'th'#2'K'#5'Align'#7#6'alLeft'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoS'
+'ize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#5'&Help'#21'Constraints.Mi'
+'nHeight'#2#25#20'Constraints.MinWidth'#2'K'#4'Kind'#7#6'bkHelp'#9'NumGlyphs'
+#2#0#7'OnClick'#7#15'HelpButtonClick'#8'TabOrder'#2#2#0#0#0#0
+#3'Top'#3#24#1#5'Width'#3'z'#1#11'HelpContext'#2#0#13'ActiveControl'#7#4'Edi'
+'t'#5'Align'#7#6'alNone'#14'AllowDropFiles'#8#10'AutoScroll'#9#8'AutoSize'#8
+#11'BorderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'#7#10'bsSizeable'#7'Ca'
+'ption'#6#18'View Project Units'#28'ChildSizing.LeftRightSpacing'#2#0#28'Chi'
+'ldSizing.TopBottomSpacing'#2#0#29'ChildSizing.HorizontalSpacing'#2#0#27'Chi'
+'ldSizing.VerticalSpacing'#2#0#27'ChildSizing.ControlsPerLine'#2#0#12'Client'
+'Height'#3'-'#1#11'ClientWidth'#3'z'#1#8'DockSite'#8#8'DragKind'#7#6'dkDrag'
+#8'DragMode'#7#8'dmManual'#7'Enabled'#9#11'Font.Height'#2#0#10'Font.Style'#11
+#0#9'FormStyle'#7#8'fsNormal'#14'ParentBiDiMode'#9#10'ParentFont'#8#8'Positi'
+'on'#7#14'poScreenCenter'#13'ShowInTaskBar'#7#9'stDefault'#14'UseDockManager'
+#8#10'LCLVersion'#6#6'0.9.27'#11'WindowState'#7#8'wsNormal'#0#5'TEdit'#4'Edi'
+'t'#4'Left'#2#6#6'Height'#2#25#3'Top'#2#6#5'Width'#3'n'#1#11'HelpContext'#2#0
+#5'Align'#7#5'alTop'#7'Anchors'#11#7'akRight'#0#8'AutoSize'#8#10'AutoSelect'
+#8#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Rig'
+'ht'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#6'!BorderSp'
+'acing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellAlignVertical'
+#7#7'ccaFill'#8'CharCase'#7#8'ecNormal'#10'DragCursor'#7#6'crDrag'#8'DragMod'
+'e'#7#8'dmManual'#8'EchoMode'#7#8'emNormal'#7'Enabled'#9#9'MaxLength'#2#255
+#14'ParentBidiMode'#9#8'OnChange'#7#10'EditChange'#7'OnEnter'#7#9'EditEnter'
+#9'OnKeyDown'#7#11'EditKeyDown'#10'ParentFont'#9#14'ParentShowHint'#9#12'Pas'
+'swordChar'#6#1#0#8'ReadOnly'#8#7'TabStop'#9#8'TabOrder'#2#1#7'Visible'#9#0#0
+#8'TListBox'#7'Listbox'#18'AnchorSideTop.Side'#7#9'asrBottom'#20'AnchorSideR'
+'ight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#19'MultiSelectChec'
+'kBox'#4'Left'#2#6#6'Height'#3#182#0#3'Top'#2'%'#5'Width'#3'n'#1#11'HelpCont'
+'ext'#2#0#5'Align'#7#8'alClient'#7'Anchors'#11#8'akBottom'#0#18'BorderSpacin'
+'g.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'Border'
+'Spacing.Bottom'#2#0#20'BorderSpacing.Around'#2#6'!BorderSpacing.CellAlignHo'
+'rizontal'#7#7'ccaFill'#31'BorderSpacing.CellAlignVertical'#7#7'ccaFill'#11
+'BorderStyle'#7#8'bsSingle'#16'ClickOnSelChange'#8#7'Columns'#2#0#10'DragCur'
+'sor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#14'Exten'
+'dedSelect'#9#7'Enabled'#9#14'IntegralHeight'#8#10'ItemHeight'#2#0#11'MultiS'
+'elect'#8#7'OnClick'#7#12'ListboxClick'#10'OnDblClick'#7#13'OKButtonClick'#9
+'OnKeyDown'#7#14'ListboxKeyDown'#14'ParentBidiMode'#9#14'ParentShowHint'#9#10
+'ParentFont'#9#6'Sorted'#8#5'Style'#7#10'lbStandard'#8'TabOrder'#2#0#7'TabSt'
+'op'#9#8'TopIndex'#2#255#7'Visible'#9#0#0#9'TCheckBox'#19'MultiSelectCheckBo'
+'x'#22'AnchorSideLeft.Control'#7#5'Owner'#18'AnchorSideTop.Side'#7#9'asrBott'
+'om'#4'Left'#2#6#6'Height'#2#22#3'Top'#3#225#0#5'Width'#3'n'#1#11'HelpContex'
+'t'#2#0#5'Align'#7#8'alBottom'#11'AllowGrayed'#8#7'Anchors'#11#6'akLeft'#8'a'
+'kBottom'#0#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2
+#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing'
+'.Around'#2#6'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpac'
+'ing.CellAlignVertical'#7#7'ccaFill'#7'Caption'#6#12'Multi Select'#7'Checked'
+#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManu'
+'al'#7'Enabled'#9#7'OnClick'#7#24'MultiselectCheckBoxClick'#11'ParentColor'#9
+#10'ParentFont'#9#14'ParentShowHint'#9#14'ParentBidiMode'#9#5'State'#7#11'cb'
+'Unchecked'#8'TabOrder'#2#2#7'TabStop'#9#11'UseOnChange'#8#7'Visible'#9#0#0
+#12'TButtonPanel'#11'ButtonPanel'#4'Left'#2#6#6'Height'#2'0'#3'Top'#3#253#0#5
+'Width'#3'n'#1#11'HelpContext'#2#0#5'Align'#7#8'alBottom'#8'AutoSize'#9#11'B'
+'uttonOrder'#7#9'boDefault'#8'TabOrder'#2#3#13'DefaultButton'#7#4'pbOK'#11'S'
+'howButtons'#11#4'pbOK'#8'pbCancel'#6'pbHelp'#0#10'ShowGlyphs'#11#4'pbOK'#8
+'pbCancel'#7'pbClose'#6'pbHelp'#0#7'Visible'#9#0#0#0
]);

View File

@ -41,7 +41,7 @@ interface
uses
SysUtils, Classes, Math, Controls, Forms, Dialogs, LResources, Buttons, StdCtrls,
LazarusIdeStrConsts, LCLType, LCLIntf, LMessages, IDEWindowIntf, IDEContextHelpEdit,
ExtCtrls;
ExtCtrls, ButtonPanel;
type
TViewUnitsEntry = class
@ -55,20 +55,16 @@ type
{ TViewUnitDialog }
TViewUnitDialog = class(TForm)
HelpButton: TBitBtn;
ButtonPanel: TButtonPanel;
Edit: TEdit;
ListBox: TListBox;
btnOK: TBitBtn;
btnCancel: TBitBtn;
MultiSelectCheckBox: TCheckBox;
BtnPanel: TPanel;
procedure EditChange(Sender: TObject);
procedure EditEnter(Sender: TObject);
procedure EditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormCreate(Sender: TObject);
procedure HelpButtonClick(Sender: TObject);
Procedure btnOKClick(Sender :TObject);
Procedure btnCancelClick(Sender :TObject);
Procedure OKButtonClick(Sender :TObject);
Procedure CancelButtonClick(Sender :TObject);
procedure ListboxClick(Sender: TObject);
procedure ListboxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure MultiselectCheckBoxClick(Sender :TObject);
@ -149,16 +145,14 @@ constructor TViewUnitDialog.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
IDEDialogLayoutList.ApplyLayout(Self,450,300);
btnOK.Caption := lisOkBtn;
btnCancel.Caption := dlgCancel;
HelpButton.Caption := lisPckEditHelp;
MultiSelectCheckBox.Caption := dlgMultiSelect;
btnOK.LoadGlyphFromLazarusResource('btn_ok');
btnCancel.LoadGlyphFromLazarusResource('btn_cancel');
HelpButton.LoadGlyphFromLazarusResource('btn_help');
ButtonPanel.OKButton.OnClick := @OKButtonClick;
ButtonPanel.CancelButton.OnClick := @CancelButtonClick;
ButtonPanel.HelpButton.OnClick := @HelpButtonClick;
end;
Procedure TViewUnitDialog.btnOKClick(Sender : TOBject);
Procedure TViewUnitDialog.OKButtonClick(Sender : TOBject);
Begin
IDEDialogLayoutList.SaveLayout(Self);
ModalResult := mrOK;
@ -195,15 +189,10 @@ begin
VK_DOWN: MoveItemIndex(1);
VK_NEXT: MoveItemIndex(PageCount);
VK_PRIOR: MoveItemIndex(-PageCount);
VK_RETURN: btnOKClick(nil);
VK_RETURN: OKButtonClick(nil);
end;
end;
procedure TViewUnitDialog.FormCreate(Sender: TObject);
begin
end;
procedure TViewUnitDialog.EditChange(Sender: TObject);
var
Index: Integer;
@ -229,7 +218,7 @@ begin
FocusEdit;
end;
Procedure TViewUnitDialog.btnCancelClick(Sender : TOBject);
Procedure TViewUnitDialog.CancelButtonClick(Sender : TOBject);
Begin
IDEDialogLayoutList.SaveLayout(Self);
ModalResult := mrCancel;
@ -250,7 +239,7 @@ procedure TViewUnitDialog.ListboxKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_RETURN then
btnOKClick(nil);
OKButtonClick(nil);
end;
procedure TViewUnitDialog.MultiselectCheckBoxClick(Sender :TObject);