mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 10:59:29 +02:00
improve view of checklistbox items editor
git-svn-id: trunk@13355 -
This commit is contained in:
parent
ec9401b001
commit
86b9d6a98d
@ -1,31 +1,30 @@
|
||||
object CheckListBoxEditorDlg: TCheckListBoxEditorDlg
|
||||
Left = 316
|
||||
Height = 198
|
||||
Height = 294
|
||||
Top = 154
|
||||
Width = 445
|
||||
HorzScrollBar.Page = 444
|
||||
VertScrollBar.Page = 197
|
||||
VertScrollBar.Page = 293
|
||||
ActiveControl = FCheck
|
||||
AutoSize = True
|
||||
BorderIcons = [biSystemMenu]
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'CheckListBoxEditorDlg'
|
||||
ClientHeight = 198
|
||||
ClientHeight = 294
|
||||
ClientWidth = 445
|
||||
Constraints.MinHeight = 100
|
||||
Constraints.MinWidth = 200
|
||||
OnCreate = FormCreate
|
||||
Position = poScreenCenter
|
||||
object FCheck: TCheckListBox
|
||||
Height = 127
|
||||
Top = 35
|
||||
Height = 234
|
||||
Top = 24
|
||||
Width = 445
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
end
|
||||
object FPanelOKCancel: TPanel
|
||||
Height = 36
|
||||
Top = 162
|
||||
Top = 258
|
||||
Width = 445
|
||||
Align = alBottom
|
||||
BevelInner = bvLowered
|
||||
@ -97,82 +96,56 @@ object CheckListBoxEditorDlg: TCheckListBoxEditorDlg
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
object FPanelButtons: TPanel
|
||||
Height = 35
|
||||
object ToolBar: TToolBar
|
||||
Height = 24
|
||||
Width = 445
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BevelInner = bvLowered
|
||||
ClientHeight = 35
|
||||
ClientWidth = 445
|
||||
Caption = 'ToolBar'
|
||||
Flat = True
|
||||
TabOrder = 2
|
||||
object BtnAdd: TButton
|
||||
AnchorSideLeft.Control = FPanelButtons
|
||||
AnchorSideTop.Control = FPanelButtons
|
||||
Left = 6
|
||||
Height = 29
|
||||
Top = 6
|
||||
Width = 59
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'BtnAdd'
|
||||
object tbAdd: TToolButton
|
||||
Left = 1
|
||||
Top = 2
|
||||
Caption = 'tbAdd'
|
||||
OnClick = AddItem
|
||||
TabOrder = 0
|
||||
end
|
||||
object BtnDelete: TButton
|
||||
AnchorSideLeft.Control = BtnAdd
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = BtnAdd
|
||||
Left = 65
|
||||
Height = 29
|
||||
Top = 6
|
||||
Width = 76
|
||||
AutoSize = True
|
||||
Caption = 'BtnDelete'
|
||||
object tbDelete: TToolButton
|
||||
Left = 24
|
||||
Top = 2
|
||||
Caption = 'tbDelete'
|
||||
OnClick = DeleteItem
|
||||
TabOrder = 1
|
||||
end
|
||||
object BtnUp: TButton
|
||||
AnchorSideLeft.Control = BtnDelete
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = BtnDelete
|
||||
Left = 147
|
||||
Height = 29
|
||||
Top = 6
|
||||
Width = 52
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'BtnUp'
|
||||
object ToolButton3: TToolButton
|
||||
Left = 47
|
||||
Top = 2
|
||||
Width = 9
|
||||
Caption = 'ToolButton3'
|
||||
Style = tbsDivider
|
||||
end
|
||||
object tbUp: TToolButton
|
||||
Left = 56
|
||||
Top = 2
|
||||
Caption = 'tbUp'
|
||||
OnClick = MoveUpItem
|
||||
TabOrder = 2
|
||||
end
|
||||
object BtnDown: TButton
|
||||
AnchorSideLeft.Control = BtnUp
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = BtnUp
|
||||
Left = 199
|
||||
Height = 29
|
||||
Top = 6
|
||||
Width = 69
|
||||
AutoSize = True
|
||||
Caption = 'BtnDown'
|
||||
object tbDown: TToolButton
|
||||
Left = 79
|
||||
Top = 2
|
||||
Caption = 'tbDown'
|
||||
OnClick = MoveDownItem
|
||||
TabOrder = 3
|
||||
end
|
||||
object BtnModify: TButton
|
||||
AnchorSideLeft.Control = BtnDown
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = BtnDown
|
||||
Left = 274
|
||||
Height = 29
|
||||
Top = 6
|
||||
Width = 75
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'BtnModify'
|
||||
object ToolButton6: TToolButton
|
||||
Left = 102
|
||||
Top = 2
|
||||
Width = 10
|
||||
Caption = 'ToolButton6'
|
||||
Style = tbsDivider
|
||||
end
|
||||
object tbEdit: TToolButton
|
||||
Left = 112
|
||||
Top = 2
|
||||
Caption = 'tbEdit'
|
||||
OnClick = ModifyItem
|
||||
TabOrder = 4
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -2,57 +2,46 @@
|
||||
|
||||
LazarusResources.Add('TCheckListBoxEditorDlg','FORMDATA',[
|
||||
'TPF0'#22'TCheckListBoxEditorDlg'#21'CheckListBoxEditorDlg'#4'Left'#3'<'#1#6
|
||||
+'Height'#3#198#0#3'Top'#3#154#0#5'Width'#3#189#1#18'HorzScrollBar.Page'#3#188
|
||||
+#1#18'VertScrollBar.Page'#3#197#0#13'ActiveControl'#7#6'FCheck'#8'AutoSize'#9
|
||||
+#11'BorderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Capti'
|
||||
+'on'#6#21'CheckListBoxEditorDlg'#12'ClientHeight'#3#198#0#11'ClientWidth'#3
|
||||
+#189#1#21'Constraints.MinHeight'#2'd'#20'Constraints.MinWidth'#3#200#0#8'Pos'
|
||||
+'ition'#7#14'poScreenCenter'#0#13'TCheckListBox'#6'FCheck'#6'Height'#2''#3
|
||||
+'Top'#2'#'#5'Width'#3#189#1#5'Align'#7#8'alClient'#8'TabOrder'#2#0#8'TopInde'
|
||||
+'x'#2#255#0#0#6'TPanel'#14'FPanelOKCancel'#6'Height'#2'$'#3'Top'#3#162#0#5'W'
|
||||
+'idth'#3#189#1#5'Align'#7#8'alBottom'#10'BevelInner'#7#9'bvLowered'#12'Clien'
|
||||
+'tHeight'#2'$'#11'ClientWidth'#3#189#1#8'TabOrder'#2#1#0#7'TBitBtn'#7'BtnHel'
|
||||
+'p'#23'AnchorSideRight.Control'#7#14'FPanelOKCancel'#20'AnchorSideRight.Side'
|
||||
+#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#14'FPanelOKCancel'#21'AnchorS'
|
||||
+'ideBottom.Side'#7#9'asrBottom'#4'Left'#3'l'#1#6'Height'#2#25#3'Top'#2#5#5'W'
|
||||
+'idth'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2
|
||||
+#6#7'Caption'#6#5'&Help'#4'Kind'#7#6'bkHelp'#9'NumGlyphs'#2#0#8'TabOrder'#2#0
|
||||
+#0#0#7'TBitBtn'#8'BtnApply'#23'AnchorSideRight.Control'#7#7'BtnHelp'#24'Anch'
|
||||
+'orSideBottom.Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'as'
|
||||
+'rBottom'#4'Left'#3#27#1#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#7'Anchors'
|
||||
+#11#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#6'&Ap'
|
||||
+'ply'#9'NumGlyphs'#2#0#7'OnClick'#7#10'ApplyCheck'#8'TabOrder'#2#1#0#0#7'TBi'
|
||||
+'tBtn'#9'BtnCancel'#23'AnchorSideRight.Control'#7#8'BtnApply'#24'AnchorSideB'
|
||||
+'ottom.Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'asrBottom'
|
||||
+#4'Left'#3#202#0#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#7'Anchors'#11#7'akR'
|
||||
+'ight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#6'Cancel'#4'K'
|
||||
+'ind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0
|
||||
+#7'TBitBtn'#5'BtnOK'#23'AnchorSideRight.Control'#7#9'BtnCancel'#24'AnchorSid'
|
||||
+'eBottom.Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'asrBott'
|
||||
+'om'#4'Left'#2'y'#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#7'Anchors'#11#7'ak'
|
||||
+'Right'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#3'&OK'#7'Def'
|
||||
+'ault'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2
|
||||
+#3#0#0#0#6'TPanel'#13'FPanelButtons'#6'Height'#2'#'#5'Width'#3#189#1#5'Align'
|
||||
+#7#5'alTop'#8'AutoSize'#9#10'BevelInner'#7#9'bvLowered'#12'ClientHeight'#2'#'
|
||||
+#11'ClientWidth'#3#189#1#8'TabOrder'#2#2#0#7'TButton'#6'BtnAdd'#22'AnchorSid'
|
||||
+'eLeft.Control'#7#13'FPanelButtons'#21'AnchorSideTop.Control'#7#13'FPanelBut'
|
||||
+'tons'#4'Left'#2#6#6'Height'#2#29#3'Top'#2#6#5'Width'#2';'#8'AutoSize'#9#18
|
||||
+'BorderSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#7'Caption'#6#6'BtnAdd'#7
|
||||
+'OnClick'#7#7'AddItem'#8'TabOrder'#2#0#0#0#7'TButton'#9'BtnDelete'#22'Anchor'
|
||||
+'SideLeft.Control'#7#6'BtnAdd'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'Anc'
|
||||
+'horSideTop.Control'#7#6'BtnAdd'#4'Left'#2'A'#6'Height'#2#29#3'Top'#2#6#5'Wi'
|
||||
+'dth'#2'L'#8'AutoSize'#9#7'Caption'#6#9'BtnDelete'#7'OnClick'#7#10'DeleteIte'
|
||||
+'m'#8'TabOrder'#2#1#0#0#7'TButton'#5'BtnUp'#22'AnchorSideLeft.Control'#7#9'B'
|
||||
+'tnDelete'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7
|
||||
+#9'BtnDelete'#4'Left'#3#147#0#6'Height'#2#29#3'Top'#2#6#5'Width'#2'4'#8'Auto'
|
||||
+'Size'#9#18'BorderSpacing.Left'#2#6#7'Caption'#6#5'BtnUp'#7'OnClick'#7#10'Mo'
|
||||
+'veUpItem'#8'TabOrder'#2#2#0#0#7'TButton'#7'BtnDown'#22'AnchorSideLeft.Contr'
|
||||
+'ol'#7#5'BtnUp'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Cont'
|
||||
+'rol'#7#5'BtnUp'#4'Left'#3#199#0#6'Height'#2#29#3'Top'#2#6#5'Width'#2'E'#8'A'
|
||||
+'utoSize'#9#7'Caption'#6#7'BtnDown'#7'OnClick'#7#12'MoveDownItem'#8'TabOrder'
|
||||
+#2#3#0#0#7'TButton'#9'BtnModify'#22'AnchorSideLeft.Control'#7#7'BtnDown'#19
|
||||
+'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7#7'BtnDown'#4
|
||||
+'Left'#3#18#1#6'Height'#2#29#3'Top'#2#6#5'Width'#2'K'#8'AutoSize'#9#18'Borde'
|
||||
+'rSpacing.Left'#2#6#7'Caption'#6#9'BtnModify'#7'OnClick'#7#10'ModifyItem'#8
|
||||
+'TabOrder'#2#4#0#0#0#0
|
||||
+'Height'#3'&'#1#3'Top'#3#154#0#5'Width'#3#189#1#18'HorzScrollBar.Page'#3#188
|
||||
+#1#18'VertScrollBar.Page'#3'%'#1#13'ActiveControl'#7#6'FCheck'#11'BorderIcon'
|
||||
+'s'#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#21'Chec'
|
||||
+'kListBoxEditorDlg'#12'ClientHeight'#3'&'#1#11'ClientWidth'#3#189#1#21'Const'
|
||||
+'raints.MinHeight'#2'd'#20'Constraints.MinWidth'#3#200#0#8'OnCreate'#7#10'Fo'
|
||||
+'rmCreate'#8'Position'#7#14'poScreenCenter'#0#13'TCheckListBox'#6'FCheck'#6
|
||||
+'Height'#3#234#0#3'Top'#2#24#5'Width'#3#189#1#5'Align'#7#8'alClient'#8'TabOr'
|
||||
+'der'#2#0#0#0#6'TPanel'#14'FPanelOKCancel'#6'Height'#2'$'#3'Top'#3#2#1#5'Wid'
|
||||
+'th'#3#189#1#5'Align'#7#8'alBottom'#10'BevelInner'#7#9'bvLowered'#12'ClientH'
|
||||
+'eight'#2'$'#11'ClientWidth'#3#189#1#8'TabOrder'#2#1#0#7'TBitBtn'#7'BtnHelp'
|
||||
+#23'AnchorSideRight.Control'#7#14'FPanelOKCancel'#20'AnchorSideRight.Side'#7
|
||||
+#9'asrBottom'#24'AnchorSideBottom.Control'#7#14'FPanelOKCancel'#21'AnchorSid'
|
||||
+'eBottom.Side'#7#9'asrBottom'#4'Left'#3'l'#1#6'Height'#2#25#3'Top'#2#5#5'Wid'
|
||||
+'th'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6
|
||||
+#7'Caption'#6#5'&Help'#4'Kind'#7#6'bkHelp'#9'NumGlyphs'#2#0#8'TabOrder'#2#0#0
|
||||
+#0#7'TBitBtn'#8'BtnApply'#23'AnchorSideRight.Control'#7#7'BtnHelp'#24'Anchor'
|
||||
+'SideBottom.Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'asrB'
|
||||
+'ottom'#4'Left'#3#27#1#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#7'Anchors'#11
|
||||
+#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#6'&Apply'
|
||||
+#9'NumGlyphs'#2#0#7'OnClick'#7#10'ApplyCheck'#8'TabOrder'#2#1#0#0#7'TBitBtn'
|
||||
+#9'BtnCancel'#23'AnchorSideRight.Control'#7#8'BtnApply'#24'AnchorSideBottom.'
|
||||
+'Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Le'
|
||||
+'ft'#3#202#0#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#7'Anchors'#11#7'akRight'
|
||||
+#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#6'Cancel'#4'Kind'#7
|
||||
+#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TBit'
|
||||
+'Btn'#5'BtnOK'#23'AnchorSideRight.Control'#7#9'BtnCancel'#24'AnchorSideBotto'
|
||||
+'m.Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4
|
||||
+'Left'#2'y'#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#7'Anchors'#11#7'akRight'
|
||||
+#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#3'&OK'#7'Default'#9
|
||||
+#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2#3#0#0#0
|
||||
+#8'TToolBar'#7'ToolBar'#6'Height'#2#24#5'Width'#3#189#1#8'AutoSize'#9#7'Capt'
|
||||
+'ion'#6#7'ToolBar'#4'Flat'#9#8'TabOrder'#2#2#0#11'TToolButton'#5'tbAdd'#4'Le'
|
||||
+'ft'#2#1#3'Top'#2#2#7'Caption'#6#5'tbAdd'#7'OnClick'#7#7'AddItem'#0#0#11'TTo'
|
||||
+'olButton'#8'tbDelete'#4'Left'#2#24#3'Top'#2#2#7'Caption'#6#8'tbDelete'#7'On'
|
||||
+'Click'#7#10'DeleteItem'#0#0#11'TToolButton'#11'ToolButton3'#4'Left'#2'/'#3
|
||||
+'Top'#2#2#5'Width'#2#9#7'Caption'#6#11'ToolButton3'#5'Style'#7#10'tbsDivider'
|
||||
+#0#0#11'TToolButton'#4'tbUp'#4'Left'#2'8'#3'Top'#2#2#7'Caption'#6#4'tbUp'#7
|
||||
+'OnClick'#7#10'MoveUpItem'#0#0#11'TToolButton'#6'tbDown'#4'Left'#2'O'#3'Top'
|
||||
+#2#2#7'Caption'#6#6'tbDown'#7'OnClick'#7#12'MoveDownItem'#0#0#11'TToolButton'
|
||||
+#11'ToolButton6'#4'Left'#2'f'#3'Top'#2#2#5'Width'#2#10#7'Caption'#6#11'ToolB'
|
||||
+'utton6'#5'Style'#7#10'tbsDivider'#0#0#11'TToolButton'#6'tbEdit'#4'Left'#2'p'
|
||||
+#3'Top'#2#2#7'Caption'#6#6'tbEdit'#7'OnClick'#7#10'ModifyItem'#0#0#0#0
|
||||
]);
|
||||
|
@ -18,7 +18,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, CheckLst,
|
||||
ExtCtrls, Buttons;
|
||||
ExtCtrls, Buttons, ComCtrls, IDEImagesIntf;
|
||||
|
||||
type
|
||||
|
||||
@ -29,17 +29,20 @@ type
|
||||
BtnCancel: TBitBtn;
|
||||
BtnHelp: TBitBtn;
|
||||
BtnOK: TBitBtn;
|
||||
BtnAdd: TButton;
|
||||
BtnDelete: TButton;
|
||||
BtnDown: TButton;
|
||||
BtnModify: TButton;
|
||||
BtnUp: TButton;
|
||||
FCheck: TCheckListBox;
|
||||
aCheck: TCheckListBox;
|
||||
FPanelOKCancel: TPanel;
|
||||
FPanelButtons: TPanel;
|
||||
ToolBar: TToolBar;
|
||||
tbAdd: TToolButton;
|
||||
tbDelete: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
tbUp: TToolButton;
|
||||
tbDown: TToolButton;
|
||||
ToolButton6: TToolButton;
|
||||
tbEdit: TToolButton;
|
||||
procedure AddItem(Sender: TObject);
|
||||
procedure DeleteItem(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure ModifyItem(Sender: TObject);
|
||||
procedure MoveDownItem(Sender: TObject);
|
||||
procedure MoveUpItem(Sender: TObject);
|
||||
@ -59,14 +62,16 @@ implementation
|
||||
uses ObjInspStrConsts;
|
||||
|
||||
procedure AssignCheckList(dstCheck, srcCheck: TCheckListBox);
|
||||
var i: integer;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
dstCheck.Items.Clear;
|
||||
dstCheck.Items:=srcCheck.Items;
|
||||
dstCheck.ItemHeight:=srcCheck.ItemHeight;
|
||||
for i:=0 to srcCheck.Items.Count-1 do begin
|
||||
for i := 0 to srcCheck.Items.Count-1 do
|
||||
begin
|
||||
if srcCheck.Items[i]<>dstCheck.Items[i] then
|
||||
dstCheck.Items[i]:=srcCheck.Items[i];
|
||||
dstCheck.Items[i] := srcCheck.Items[i];
|
||||
dstCheck.Checked[i]:=srcCheck.Checked[i]
|
||||
end;
|
||||
end;
|
||||
@ -74,7 +79,8 @@ end;
|
||||
{ TCheckListBoxEditorDlg }
|
||||
|
||||
procedure TCheckListBoxEditorDlg.AddItem(Sender:TObject);
|
||||
var strItem:string;
|
||||
var
|
||||
strItem: string;
|
||||
begin
|
||||
if InputQuery(clbCheckListBoxEditor, clbAdd, strItem) then
|
||||
FCheck.Items.Add(strItem);
|
||||
@ -82,15 +88,38 @@ end;
|
||||
|
||||
procedure TCheckListBoxEditorDlg.DeleteItem(Sender:TObject);
|
||||
begin
|
||||
if FCheck.ItemIndex=-1 then exit;
|
||||
if FCheck.ItemIndex = -1 then exit;
|
||||
if MessageDlg(clbCheckListBoxEditor,Format(clbDelete,[FCheck.ItemIndex,FCheck.Items[FCheck.ItemIndex]]),
|
||||
mtConfirmation, mbYesNo, 0)=mrYes then
|
||||
mtConfirmation, mbYesNo, 0) = mrYes then
|
||||
FCheck.Items.Delete(FCheck.ItemIndex);
|
||||
end;
|
||||
|
||||
procedure TCheckListBoxEditorDlg.FormCreate(Sender: TObject);
|
||||
begin
|
||||
ToolBar.Images := IDEImages.Images_16;
|
||||
tbAdd.ImageIndex := IDEImages.LoadImage(16, 'add');
|
||||
tbDelete.ImageIndex := IDEImages.LoadImage(16, 'delete');
|
||||
tbUp.ImageIndex := IDEImages.LoadImage(16, 'arrow_up');
|
||||
tbDown.ImageIndex := IDEImages.LoadImage(16, 'arrow_down');
|
||||
tbEdit.ImageIndex := IDEImages.LoadImage(16, 'edit');
|
||||
|
||||
Caption := clbCheckListBoxEditor;
|
||||
BtnOK.Caption := oisOk;
|
||||
BtnCancel.Caption := oisCancel;
|
||||
BtnHelp.Caption := cActionListEditorHelpCategory;
|
||||
|
||||
tbAdd.Hint := oiscAdd;
|
||||
tbDelete.Hint := oiscDelete;
|
||||
tbUp.Hint := clbUp;
|
||||
tbDown.Hint := clbDown;
|
||||
tbEdit.Hint := clbModify;
|
||||
Modified := False;
|
||||
end;
|
||||
|
||||
procedure TCheckListBoxEditorDlg.MoveUpItem(Sender:TObject);
|
||||
var itemtmp:string;
|
||||
checkedtmp:boolean;
|
||||
var
|
||||
itemtmp: string;
|
||||
checkedtmp: boolean;
|
||||
begin
|
||||
if (FCheck.Items.Count<=1)or(FCheck.ItemIndex<1) then exit;
|
||||
itemtmp:=FCheck.Items[FCheck.ItemIndex-1];
|
||||
@ -103,8 +132,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCheckListBoxEditorDlg.MoveDownItem(Sender:TObject);
|
||||
var itemtmp:string;
|
||||
checkedtmp:boolean;
|
||||
var
|
||||
itemtmp: string;
|
||||
checkedtmp: boolean;
|
||||
begin
|
||||
if (FCheck.Items.Count<=1)or(FCheck.ItemIndex=FCheck.Items.Count-1)or(FCheck.ItemIndex=-1) then exit;
|
||||
itemtmp:=FCheck.Items[FCheck.ItemIndex+1];
|
||||
@ -118,13 +148,14 @@ end;
|
||||
|
||||
procedure TCheckListBoxEditorDlg.ModifyItem(Sender:TObject);
|
||||
begin
|
||||
if FCheck.ItemIndex=-1 then exit;
|
||||
if FCheck.ItemIndex = -1 then exit;
|
||||
FCheck.Items[FCheck.ItemIndex]:=InputBox(clbCheckListBoxEditor,clbModify,FCheck.Items[FCheck.ItemIndex]);
|
||||
end;
|
||||
|
||||
procedure TCheckListBoxEditorDlg.ApplyCheck(Sender:TObject);
|
||||
begin
|
||||
if Assigned(FCheck) then begin
|
||||
if Assigned(FCheck) then
|
||||
begin
|
||||
AssignCheckList(aCheck, FCheck);
|
||||
FModified := True;
|
||||
end;
|
||||
|
@ -847,33 +847,21 @@ end;
|
||||
{ TCheckListBoxComponentEditor }
|
||||
|
||||
procedure TCheckListBoxComponentEditor.DoShowEditor;
|
||||
var Dlg: TCheckListBoxEditorDlg;
|
||||
var
|
||||
Dlg: TCheckListBoxEditorDlg;
|
||||
begin
|
||||
Dlg:=TCheckListBoxEditorDlg.Create(nil);
|
||||
with Dlg do begin
|
||||
Caption:=clbCheckListBoxEditor;
|
||||
BtnOK.Caption:=oisOk;
|
||||
BtnCancel.Caption:=oisCancel;
|
||||
BtnHelp.Caption:=cActionListEditorHelpCategory;
|
||||
BtnAdd.Caption:=oiscAdd;
|
||||
BtnDelete.Caption:=oiscDelete;
|
||||
BtnUp.Caption:=clbUp;
|
||||
BtnDown.Caption:=clbDown;
|
||||
BtnModify.Caption:='...';
|
||||
BtnModify.ShowHint:=true;
|
||||
BtnModify.Hint:=clbModify;
|
||||
Modified:=false;
|
||||
end;
|
||||
|
||||
Dlg := TCheckListBoxEditorDlg.Create(nil);
|
||||
try
|
||||
if GetComponent is TCheckListBox then begin
|
||||
Dlg.aCheck:=TCheckListBox(GetComponent);
|
||||
if GetComponent is TCheckListBox then
|
||||
begin
|
||||
Dlg.aCheck := TCheckListBox(GetComponent);
|
||||
if not HasHook then exit;
|
||||
|
||||
AssignCheckList(Dlg.FCheck, Dlg.aCheck);
|
||||
|
||||
//ShowEditor
|
||||
if Dlg.ShowModal=mrOK then begin
|
||||
if Dlg.ShowModal=mrOK then
|
||||
begin
|
||||
AssignCheckList(Dlg.aCheck, Dlg.FCheck);
|
||||
Modified;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user