added checklistboxeditordlg.pas, added Apply button to checklist editor from Salvatore

git-svn-id: trunk@9619 -
This commit is contained in:
mattias 2006-07-16 07:48:22 +00:00
parent a233f11c99
commit e5a64772a0
8 changed files with 379 additions and 251 deletions

1
.gitattributes vendored
View File

@ -1346,6 +1346,7 @@ ideintf/checkgroupeditordlg.lfm svneol=native#text/plain
ideintf/checkgroupeditordlg.lrs svneol=native#text/plain
ideintf/checklistboxeditordlg.lfm svneol=native#text/plain
ideintf/checklistboxeditordlg.lrs svneol=native#text/plain
ideintf/checklistboxeditordlg.pas svneol=native#text/plain
ideintf/collectionpropeditform.lfm svneol=native#text/plain
ideintf/collectionpropeditform.lrs svneol=native#text/plain
ideintf/columndlg.pp svneol=native#text/pascal

View File

@ -1,2 +1,2 @@
// Created by Svn2RevisionInc
const RevisionStr = '9500M';
const RevisionStr = '9599';

View File

@ -1,134 +1,180 @@
object CheckListBoxEditorDlg: TCheckListBoxEditorDlg
ActiveControl = FBtnAdd
AutoSize = True
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'CheckListBoxEditorDlg'
ClientHeight = 299
ClientWidth = 395
ClientHeight = 284
ClientWidth = 438
PixelsPerInch = 96
Position = poScreenCenter
HorzScrollBar.Page = 394
VertScrollBar.Page = 298
Left = 290
Height = 299
Top = 149
Width = 395
object FPanelButtons: TPanel
Align = alTop
AutoSize = True
ClientHeight = 31
ClientWidth = 395
HorzScrollBar.Page = 437
VertScrollBar.Page = 283
Left = 316
Height = 284
Top = 154
Width = 438
object FCheck: TCheckListBox
Align = alClient
TabOrder = 0
Height = 31
Width = 395
object FBtnAdd: TButton
AutoSize = True
Caption = 'FBtnAdd'
OnClick = AddItem
TabOrder = 0
Left = 1
Height = 29
Top = 1
Width = 65
end
object FBtnDelete: TButton
AutoSize = True
Caption = 'FBtnDelete'
OnClick = DeleteItem
TabOrder = 1
AnchorSideLeft.Control = FBtnAdd
AnchorSideLeft.Side = asrBottom
Left = 66
Height = 29
Top = 1
Width = 77
end
object FBtnUp: TButton
AutoSize = True
Caption = 'FBtnUp'
OnClick = MoveUpItem
TabOrder = 2
AnchorSideLeft.Control = FBtnDelete
AnchorSideLeft.Side = asrBottom
Left = 143
Height = 29
Top = 1
Width = 60
end
object FBtnDown: TButton
AutoSize = True
Caption = 'FBtnDown'
OnClick = MoveDownItem
TabOrder = 3
AnchorSideLeft.Control = FBtnUp
AnchorSideLeft.Side = asrBottom
Left = 203
Height = 29
Top = 1
Width = 74
end
object FBtnModify: TButton
AutoSize = True
Caption = 'FBtnModify'
OnClick = ModifyItem
TabOrder = 4
AnchorSideLeft.Control = FBtnDown
AnchorSideLeft.Side = asrBottom
Left = 277
Height = 29
Top = 1
Width = 77
end
Height = 205
Top = 43
Width = 438
end
object FPanelOKCancel: TPanel
Align = alBottom
AutoSize = True
BevelInner = bvLowered
ClientHeight = 36
ClientWidth = 395
ClientWidth = 438
TabOrder = 1
Height = 36
Top = 263
Width = 395
object FBtnOK: TBitBtn
AutoSize = True
Top = 248
Width = 438
object BtnHelp: TBitBtn
Anchors = [akRight, akBottom]
BorderSpacing.Around = 6
Caption = '&Help'
Kind = bkHelp
NumGlyphs = 0
TabOrder = 0
AnchorSideRight.Control = FPanelOKCancel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = FPanelOKCancel
AnchorSideBottom.Side = asrBottom
Left = 357
Height = 25
Top = 5
Width = 75
end
object BtnApply: TBitBtn
Anchors = [akRight, akBottom]
BorderSpacing.Around = 6
Caption = '&Apply'
NumGlyphs = 0
OnClick = ApplyCheck
TabOrder = 1
AnchorSideRight.Control = BtnHelp
AnchorSideBottom.Control = FPanelOKCancel
AnchorSideBottom.Side = asrBottom
Left = 276
Height = 25
Top = 5
Width = 75
end
object BtnCancel: TBitBtn
Anchors = [akRight, akBottom]
BorderSpacing.Around = 6
Caption = 'Cancel'
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
TabOrder = 2
AnchorSideRight.Control = BtnApply
AnchorSideBottom.Control = FPanelOKCancel
AnchorSideBottom.Side = asrBottom
Left = 195
Height = 25
Top = 5
Width = 75
end
object BtnOK: TBitBtn
Anchors = [akRight, akBottom]
BorderSpacing.Around = 6
Caption = '&OK'
Default = True
Kind = bkOK
ModalResult = 1
NumGlyphs = 0
TabOrder = 0
Left = 1
Height = 34
Top = 1
Width = 68
end
object FBtnCancel: TBitBtn
AutoSize = True
Caption = 'Cancel'
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
TabOrder = 1
AnchorSideLeft.Control = FBtnOK
AnchorSideLeft.Side = asrBottom
Left = 69
Height = 34
Top = 1
Width = 80
TabOrder = 3
AnchorSideRight.Control = BtnCancel
AnchorSideBottom.Control = FPanelOKCancel
AnchorSideBottom.Side = asrBottom
Left = 114
Height = 25
Top = 5
Width = 75
end
end
object FCheck: TCheckListBox
Align = alClient
object FPanelButtons: TPanel
Align = alTop
AutoSize = True
BevelInner = bvLowered
ClientHeight = 43
ClientWidth = 438
TabOrder = 2
Height = 232
Top = 31
Width = 395
Height = 43
Width = 438
object BtnAdd: TButton
AutoSize = True
BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 4
Caption = 'BtnAdd'
OnClick = AddItem
TabOrder = 0
AnchorSideLeft.Control = FPanelButtons
AnchorSideTop.Control = FPanelButtons
Left = 6
Height = 33
Top = 6
Width = 69
end
object BtnDelete: TButton
AutoSize = True
BorderSpacing.InnerBorder = 4
Caption = 'BtnDelete'
OnClick = DeleteItem
TabOrder = 1
AnchorSideLeft.Control = BtnAdd
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BtnAdd
Left = 75
Height = 33
Top = 6
Width = 81
end
object BtnUp: TButton
AutoSize = True
BorderSpacing.Left = 6
BorderSpacing.InnerBorder = 4
Caption = 'BtnUp'
OnClick = MoveUpItem
TabOrder = 2
AnchorSideLeft.Control = BtnDelete
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BtnDelete
Left = 162
Height = 33
Top = 6
Width = 64
end
object BtnDown: TButton
AutoSize = True
BorderSpacing.InnerBorder = 4
Caption = 'BtnDown'
OnClick = MoveDownItem
TabOrder = 3
AnchorSideLeft.Control = BtnUp
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BtnUp
Left = 226
Height = 33
Top = 6
Width = 78
end
object BtnModify: TButton
AutoSize = True
BorderSpacing.Left = 6
BorderSpacing.InnerBorder = 4
Caption = 'BtnModify'
OnClick = ModifyItem
TabOrder = 4
AnchorSideLeft.Control = BtnDown
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BtnDown
Left = 310
Height = 33
Top = 6
Width = 81
end
end
end

View File

@ -1,35 +1,59 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TCheckListBoxEditorDlg','FORMDATA',[
'TPF0'#22'TCheckListBoxEditorDlg'#21'CheckListBoxEditorDlg'#13'ActiveControl'
+#7#7'FBtnAdd'#8'AutoSize'#9#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#21'Ch'
+'eckListBoxEditorDlg'#12'ClientHeight'#3'+'#1#11'ClientWidth'#3#139#1#13'Pix'
+'elsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3
+#138#1#18'VertScrollBar.Page'#3'*'#1#4'Left'#3'"'#1#6'Height'#3'+'#1#3'Top'#3
+#149#0#5'Width'#3#139#1#0#6'TPanel'#13'FPanelButtons'#5'Align'#7#5'alTop'#8
+'AutoSize'#9#12'ClientHeight'#2#31#11'ClientWidth'#3#139#1#8'TabOrder'#2#0#6
+'Height'#2#31#5'Width'#3#139#1#0#7'TButton'#7'FBtnAdd'#8'AutoSize'#9#7'Capti'
+'on'#6#7'FBtnAdd'#7'OnClick'#7#7'AddItem'#8'TabOrder'#2#0#4'Left'#2#1#6'Heig'
+'ht'#2#29#3'Top'#2#1#5'Width'#2'A'#0#0#7'TButton'#10'FBtnDelete'#8'AutoSize'
+#9#7'Caption'#6#10'FBtnDelete'#7'OnClick'#7#10'DeleteItem'#8'TabOrder'#2#1#22
+'AnchorSideLeft.Control'#7#7'FBtnAdd'#19'AnchorSideLeft.Side'#7#9'asrBottom'
+#4'Left'#2'B'#6'Height'#2#29#3'Top'#2#1#5'Width'#2'M'#0#0#7'TButton'#6'FBtnU'
+'p'#8'AutoSize'#9#7'Caption'#6#6'FBtnUp'#7'OnClick'#7#10'MoveUpItem'#8'TabOr'
+'der'#2#2#22'AnchorSideLeft.Control'#7#10'FBtnDelete'#19'AnchorSideLeft.Side'
+#7#9'asrBottom'#4'Left'#3#143#0#6'Height'#2#29#3'Top'#2#1#5'Width'#2'<'#0#0#7
+'TButton'#8'FBtnDown'#8'AutoSize'#9#7'Caption'#6#8'FBtnDown'#7'OnClick'#7#12
+'MoveDownItem'#8'TabOrder'#2#3#22'AnchorSideLeft.Control'#7#6'FBtnUp'#19'Anc'
+'horSideLeft.Side'#7#9'asrBottom'#4'Left'#3#203#0#6'Height'#2#29#3'Top'#2#1#5
+'Width'#2'J'#0#0#7'TButton'#10'FBtnModify'#8'AutoSize'#9#7'Caption'#6#10'FBt'
+'nModify'#7'OnClick'#7#10'ModifyItem'#8'TabOrder'#2#4#22'AnchorSideLeft.Cont'
+'rol'#7#8'FBtnDown'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#3#21#1#6
+'Height'#2#29#3'Top'#2#1#5'Width'#2'M'#0#0#0#6'TPanel'#14'FPanelOKCancel'#5
+'Align'#7#8'alBottom'#8'AutoSize'#9#12'ClientHeight'#2'$'#11'ClientWidth'#3
+#139#1#8'TabOrder'#2#1#6'Height'#2'$'#3'Top'#3#7#1#5'Width'#3#139#1#0#7'TBit'
+'Btn'#6'FBtnOK'#8'AutoSize'#9#7'Caption'#6#3'&OK'#7'Default'#9#4'Kind'#7#4'b'
+'kOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2#0#4'Left'#2#1#6'Hei'
+'ght'#2'"'#3'Top'#2#1#5'Width'#2'D'#0#0#7'TBitBtn'#10'FBtnCancel'#8'AutoSize'
+#9#7'Caption'#6#6'Cancel'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGly'
+'phs'#2#0#8'TabOrder'#2#1#22'AnchorSideLeft.Control'#7#6'FBtnOK'#19'AnchorSi'
+'deLeft.Side'#7#9'asrBottom'#4'Left'#2'E'#6'Height'#2'"'#3'Top'#2#1#5'Width'
+#2'P'#0#0#0#13'TCheckListBox'#6'FCheck'#5'Align'#7#8'alClient'#8'TabOrder'#2
+#2#6'Height'#3#232#0#3'Top'#2#31#5'Width'#3#139#1#0#0#0
'TPF0'#22'TCheckListBoxEditorDlg'#21'CheckListBoxEditorDlg'#8'AutoSize'#9#11
+'BorderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'
+#6#21'CheckListBoxEditorDlg'#12'ClientHeight'#3#28#1#11'ClientWidth'#3#182#1
+#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Pa'
+'ge'#3#181#1#18'VertScrollBar.Page'#3#27#1#4'Left'#3'<'#1#6'Height'#3#28#1#3
+'Top'#3#154#0#5'Width'#3#182#1#0#13'TCheckListBox'#6'FCheck'#5'Align'#7#8'al'
+'Client'#8'TabOrder'#2#0#6'Height'#3#205#0#3'Top'#2'+'#5'Width'#3#182#1#0#0#6
+'TPanel'#14'FPanelOKCancel'#5'Align'#7#8'alBottom'#10'BevelInner'#7#9'bvLowe'
+'red'#12'ClientHeight'#2'$'#11'ClientWidth'#3#182#1#8'TabOrder'#2#1#6'Height'
+#2'$'#3'Top'#3#248#0#5'Width'#3#182#1#0#7'TBitBtn'#7'BtnHelp'#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#23'AnchorSideRight.Contr'
+'ol'#7#14'FPanelOKCancel'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorS'
+'ideBottom.Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'asrBo'
+'ttom'#4'Left'#3'e'#1#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#0#0#7'TBitBtn'
+#8'BtnApply'#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'T'
+'abOrder'#2#1#23'AnchorSideRight.Control'#7#7'BtnHelp'#24'AnchorSideBottom.C'
+'ontrol'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Lef'
+'t'#3#20#1#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#0#0#7'TBitBtn'#9'BtnCance'
+'l'#7'Anchors'#11#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Ca'
+'ption'#6#6'Cancel'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyphs'#2
+#0#8'TabOrder'#2#2#23'AnchorSideRight.Control'#7#8'BtnApply'#24'AnchorSideBo'
+'ttom.Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9'asrBottom'
+#4'Left'#3#195#0#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#0#0#7'TBitBtn'#5'Bt'
+'nOK'#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'NumG'
+'lyphs'#2#0#8'TabOrder'#2#3#23'AnchorSideRight.Control'#7#9'BtnCancel'#24'An'
+'chorSideBottom.Control'#7#14'FPanelOKCancel'#21'AnchorSideBottom.Side'#7#9
+'asrBottom'#4'Left'#2'r'#6'Height'#2#25#3'Top'#2#5#5'Width'#2'K'#0#0#0#6'TPa'
+'nel'#13'FPanelButtons'#5'Align'#7#5'alTop'#8'AutoSize'#9#10'BevelInner'#7#9
+'bvLowered'#12'ClientHeight'#2'+'#11'ClientWidth'#3#182#1#8'TabOrder'#2#2#6
+'Height'#2'+'#5'Width'#3#182#1#0#7'TButton'#6'BtnAdd'#8'AutoSize'#9#18'Borde'
+'rSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#25'BorderSpacing.InnerBorder'#2
+#4#7'Caption'#6#6'BtnAdd'#7'OnClick'#7#7'AddItem'#8'TabOrder'#2#0#22'AnchorS'
+'ideLeft.Control'#7#13'FPanelButtons'#21'AnchorSideTop.Control'#7#13'FPanelB'
+'uttons'#4'Left'#2#6#6'Height'#2'!'#3'Top'#2#6#5'Width'#2'E'#0#0#7'TButton'#9
+'BtnDelete'#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#9'B'
+'tnDelete'#7'OnClick'#7#10'DeleteItem'#8'TabOrder'#2#1#22'AnchorSideLeft.Con'
+'trol'#7#6'BtnAdd'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.C'
+'ontrol'#7#6'BtnAdd'#4'Left'#2'K'#6'Height'#2'!'#3'Top'#2#6#5'Width'#2'Q'#0#0
+#7'TButton'#5'BtnUp'#8'AutoSize'#9#18'BorderSpacing.Left'#2#6#25'BorderSpaci'
+'ng.InnerBorder'#2#4#7'Caption'#6#5'BtnUp'#7'OnClick'#7#10'MoveUpItem'#8'Tab'
+'Order'#2#2#22'AnchorSideLeft.Control'#7#9'BtnDelete'#19'AnchorSideLeft.Side'
+#7#9'asrBottom'#21'AnchorSideTop.Control'#7#9'BtnDelete'#4'Left'#3#162#0#6'H'
+'eight'#2'!'#3'Top'#2#6#5'Width'#2'@'#0#0#7'TButton'#7'BtnDown'#8'AutoSize'#9
+#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#7'BtnDown'#7'OnClick'#7#12'M'
+'oveDownItem'#8'TabOrder'#2#3#22'AnchorSideLeft.Control'#7#5'BtnUp'#19'Ancho'
+'rSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7#5'BtnUp'#4'Left'
+#3#226#0#6'Height'#2'!'#3'Top'#2#6#5'Width'#2'N'#0#0#7'TButton'#9'BtnModify'
+#8'AutoSize'#9#18'BorderSpacing.Left'#2#6#25'BorderSpacing.InnerBorder'#2#4#7
+'Caption'#6#9'BtnModify'#7'OnClick'#7#10'ModifyItem'#8'TabOrder'#2#4#22'Anch'
+'orSideLeft.Control'#7#7'BtnDown'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21
+'AnchorSideTop.Control'#7#7'BtnDown'#4'Left'#3'6'#1#6'Height'#2'!'#3'Top'#2#6
+#5'Width'#2'Q'#0#0#0#0
]);

View File

@ -0,0 +1,142 @@
{
*****************************************************************************
* *
* See the file COPYING.modifiedLGPL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
unit CheckListboxEditorDlg;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, CheckLst,
ExtCtrls, Buttons;
type
{ TCheckListBoxEditorDlg }
TCheckListBoxEditorDlg = class(TForm)
BtnApply: TBitBtn;
BtnCancel: TBitBtn;
BtnHelp: TBitBtn;
BtnOK: TBitBtn;
BtnAdd: TButton;
BtnDelete: TButton;
BtnDown: TButton;
BtnModify: TButton;
BtnUp: TButton;
FCheck: TCheckListBox;
aCheck: TCheckListBox;
FPanelOKCancel: TPanel;
FPanelButtons: TPanel;
procedure AddItem(Sender: TObject);
procedure DeleteItem(Sender: TObject);
procedure ModifyItem(Sender: TObject);
procedure MoveDownItem(Sender: TObject);
procedure MoveUpItem(Sender: TObject);
procedure ApplyCheck(Sender: TObject);
private
{ private declarations }
FModified: Boolean;
public
{ public declarations }
property Modified: Boolean read FModified write FModified;
end;
procedure AssignCheck(dstCheck, srcCheck: TCheckListBox);
implementation
uses ObjInspStrConsts;
procedure AssignCheck(dstCheck, srcCheck: TCheckListBox);
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
if srcCheck.Items[i]<>dstCheck.Items[i] then
dstCheck.Items[i]:=srcCheck.Items[i];
dstCheck.Checked[i]:=srcCheck.Checked[i]
end;
end;
{ TCheckListBoxEditorDlg }
procedure TCheckListBoxEditorDlg.AddItem(Sender:TObject);
var strItem:string;
begin
if InputQuery(clbCheckListBoxEditor, clbAdd, strItem) then
FCheck.Items.Add(strItem);
end;
procedure TCheckListBoxEditorDlg.DeleteItem(Sender:TObject);
begin
if FCheck.ItemIndex=-1 then exit;
if MessageDlg(clbCheckListBoxEditor,Format(clbDelete,[FCheck.ItemIndex,FCheck.Items[FCheck.ItemIndex]]),
mtConfirmation, mbYesNo, 0)=mrYes then
FCheck.Items.Delete(FCheck.ItemIndex);
end;
procedure TCheckListBoxEditorDlg.MoveUpItem(Sender:TObject);
var itemtmp:string;
checkedtmp:boolean;
begin
if (FCheck.Items.Count<=1)or(FCheck.ItemIndex<1) then exit;
itemtmp:=FCheck.Items[FCheck.ItemIndex-1];
checkedtmp:=FCheck.Checked[FCheck.ItemIndex-1];
FCheck.Items[FCheck.ItemIndex-1]:=FCheck.Items[FCheck.ItemIndex];
FCheck.Checked[FCheck.ItemIndex-1]:=FCheck.Checked[FCheck.ItemIndex];
FCheck.Items[FCheck.ItemIndex]:=itemtmp;
FCheck.Checked[FCheck.ItemIndex]:=checkedtmp;
FCheck.ItemIndex:=FCheck.ItemIndex-1
end;
procedure TCheckListBoxEditorDlg.MoveDownItem(Sender:TObject);
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];
checkedtmp:=FCheck.Checked[FCheck.ItemIndex+1];
FCheck.Items[FCheck.ItemIndex+1]:=FCheck.Items[FCheck.ItemIndex];
FCheck.Checked[FCheck.ItemIndex+1]:=FCheck.Checked[FCheck.ItemIndex];
FCheck.Items[FCheck.ItemIndex]:=itemtmp;
FCheck.Checked[FCheck.ItemIndex]:=checkedtmp;
FCheck.ItemIndex:=FCheck.ItemIndex+1
end;
procedure TCheckListBoxEditorDlg.ModifyItem(Sender:TObject);
begin
if FCheck.ItemIndex=-1 then exit;
FCheck.Items[FCheck.ItemIndex]:=InputBox(clbCheckListBoxEditor,clbModify,FCheck.Items[FCheck.ItemIndex]);
end;
procedure TCheckListBoxEditorDlg.ApplyCheck(Sender:TObject);
//var aCheck:TCheckListBox; //coppola
begin
// if FCheck.ItemIndex=-1 then exit;
if Assigned(FCheck) then begin
AssignCheck(aCheck, FCheck);
FModified := True;
end;
// AssignCheck(aCheck, FCheck);
// Modified; coppola
end;
initialization
{$I checklistboxeditordlg.lrs}
end.

View File

@ -27,7 +27,7 @@ interface
uses
Classes, SysUtils, LResources, TypInfo, LCLProc, Forms, Controls, Menus,
ExtCtrls, StdCtrls, Graphics, Grids, CheckLst, Buttons, ComCtrls, Dialogs,
LazStringGridEdit, GraphType, PropEdits, ObjInspStrConsts;
LazStringGridEdit, CheckListboxEditorDlg, GraphType, PropEdits, ObjInspStrConsts;
type
{ TComponentEditorDesigner }
@ -289,7 +289,6 @@ type
TCheckListBoxComponentEditor = class(TDefaultComponentEditor)
protected
procedure DoShowEditor;
procedure AssignCheck(dstCheck, srcCheck: TCheckListBox);
public
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): string; override;
@ -838,132 +837,45 @@ begin
Result := 1;
end;
{ TCheckListBoxEditorDlg }
type
TCheckListBoxEditorDlg = class(TForm)
FCheck: TCheckListBox;
FBtnCancel: TBitBtn;
FBtnOK: TBitBtn;
FBtnModify: TButton;
FBtnDown: TButton;
FBtnUp: TButton;
FBtnDelete: TButton;
FBtnAdd: TButton;
FPanelButtons: TPanel;
FPanelOKCancel: TPanel;
procedure AddItem(Sender: TObject);
procedure DeleteItem(Sender: TObject);
procedure ModifyItem(Sender: TObject);
procedure MoveDownItem(Sender: TObject);
procedure MoveUpItem(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
procedure TCheckListBoxEditorDlg.AddItem(Sender:TObject);
var strItem:string;
begin
if InputQuery(clbCheckListBoxEditor, clbAdd, strItem) then
FCheck.Items.Add(strItem);
end;
procedure TCheckListBoxEditorDlg.DeleteItem(Sender:TObject);
begin
if FCheck.ItemIndex=-1 then exit;
if MessageDlg(clbCheckListBoxEditor,Format(clbDelete,[FCheck.ItemIndex,FCheck.Items[FCheck.ItemIndex]]),
mtConfirmation, mbYesNo, 0)=mrYes then
FCheck.Items.Delete(FCheck.ItemIndex);
end;
procedure TCheckListBoxEditorDlg.MoveUpItem(Sender:TObject);
var itemtmp:string;
checkedtmp:boolean;
begin
if (FCheck.Items.Count<=1)or(FCheck.ItemIndex<1) then exit;
itemtmp:=FCheck.Items[FCheck.ItemIndex-1];
checkedtmp:=FCheck.Checked[FCheck.ItemIndex-1];
FCheck.Items[FCheck.ItemIndex-1]:=FCheck.Items[FCheck.ItemIndex];
FCheck.Checked[FCheck.ItemIndex-1]:=FCheck.Checked[FCheck.ItemIndex];
FCheck.Items[FCheck.ItemIndex]:=itemtmp;
FCheck.Checked[FCheck.ItemIndex]:=checkedtmp;
FCheck.ItemIndex:=FCheck.ItemIndex-1
end;
procedure TCheckListBoxEditorDlg.MoveDownItem(Sender:TObject);
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];
checkedtmp:=FCheck.Checked[FCheck.ItemIndex+1];
FCheck.Items[FCheck.ItemIndex+1]:=FCheck.Items[FCheck.ItemIndex];
FCheck.Checked[FCheck.ItemIndex+1]:=FCheck.Checked[FCheck.ItemIndex];
FCheck.Items[FCheck.ItemIndex]:=itemtmp;
FCheck.Checked[FCheck.ItemIndex]:=checkedtmp;
FCheck.ItemIndex:=FCheck.ItemIndex+1
end;
procedure TCheckListBoxEditorDlg.ModifyItem(Sender:TObject);
begin
if FCheck.ItemIndex=-1 then exit;
FCheck.Items[FCheck.ItemIndex]:=InputBox(clbCheckListBoxEditor,clbModify,FCheck.Items[FCheck.ItemIndex]);
end;
{ TCheckListBoxComponentEditor }
procedure TCheckListBoxComponentEditor.DoShowEditor;
var Dlg: TCheckListBoxEditorDlg;
Hook: TPropertyEditorHook;
aCheck: TCheckListBox;
begin
Dlg:=TCheckListBoxEditorDlg.Create(nil);
with Dlg do begin
Caption:=clbCheckListBoxEditor;
FBtnAdd.Caption:=oiscAdd;
FBtnDelete.Caption:=oiscDelete;
FBtnUp.Caption:=clbUp;
FBtnDown.Caption:=clbDown;
FBtnModify.Caption:='...';
FBtnModify.ShowHint:=true;
FBtnModify.Hint:=clbModify;
BtnAdd.Caption:=oiscAdd;
BtnDelete.Caption:=oiscDelete;
BtnUp.Caption:=clbUp;
BtnDown.Caption:=clbDown;
BtnModify.Caption:='...';
BtnModify.ShowHint:=true;
BtnModify.Hint:=clbModify;
Modified:=false;
end;
try
if GetComponent is TCheckListBox then begin
aCheck:=TCheckListBox(GetComponent);
Dlg.aCheck:=TCheckListBox(GetComponent);
GetHook(Hook);
AssignCheck(Dlg.FCheck, aCheck);
AssignCheck(Dlg.FCheck, Dlg.aCheck);
//ShowEditor
if Dlg.ShowModal=mrOK then begin
//Apply the modifications
AssignCheck(aCheck, Dlg.FCheck);
AssignCheck(Dlg.aCheck, Dlg.FCheck);
Modified;
end;
if Dlg.Modified then
Modified;
end;
finally
Dlg.Free;
end;
end;
procedure TCheckListBoxComponentEditor.AssignCheck(dstCheck, srcCheck: TCheckListBox);
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
if srcCheck.Items[i]<>dstCheck.Items[i] then
dstCheck.Items[i]:=srcCheck.Items[i];
dstCheck.Checked[i]:=srcCheck.Checked[i]
end;
end;
procedure TCheckListBoxComponentEditor.ExecuteVerb(Index: Integer);
begin
doShowEditor;
@ -1402,7 +1314,6 @@ begin
end;
initialization
{$I checklistboxeditordlg.lrs}
{$I checkgroupeditordlg.lrs}
RegisterComponentEditorProc:=@DefaultRegisterComponentEditorProc;

View File

@ -37,7 +37,10 @@ uses
type
TGraphicsColor = -$7FFFFFFF-1..$7FFFFFFF;
TGraphicsFillStyle = (fsSurface, fsBorder);
TGraphicsFillStyle = (
fsSurface, // fill till the color (it fills all execpt this color)
fsBorder // fill this color (it fills only conneted pixels of this color)
);
TGraphicsBevelCut = (bvNone, bvLowered, bvRaised, bvSpace);
//------------------------------------------------------------------------------

View File

@ -817,10 +817,11 @@ end;
Method: TCanvas.FillRect
Params: X, Y: Integer; Color: TColor; FillStyle: TFillStyle
Returns: Nothing
------------------------------------------------------------------------------}
procedure TCanvas.FloodFill(X, Y: Integer; FillColor: TColor; FillStyle: TFillStyle
);
procedure TCanvas.FloodFill(X, Y: Integer; FillColor: TColor;
FillStyle: TFillStyle);
begin
Changing;
RequiredState([csHandleValid, csBrushValid]);