1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-25 02:32:19 -05:00

Deleted imagelist + added OK button (+ enter in the name-edit box results in a close).

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@221 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Raymond 2009-11-09 20:15:26 +00:00
parent edbed662b3
commit f9b8611336
3 changed files with 43 additions and 16 deletions

View File

@ -16,7 +16,6 @@ object ColourHistoryForm: TColourHistoryForm
Top = 16 Top = 16
Width = 328 Width = 328
Columns = <> Columns = <>
SmallImages = Form1.Mufasa_Image_List
TabOrder = 0 TabOrder = 0
OnSelectItem = ChangeViewData OnSelectItem = ChangeViewData
end end
@ -35,6 +34,7 @@ object ColourHistoryForm: TColourHistoryForm
Top = 16 Top = 16
Width = 112 Width = 112
OnChange = ChangeName OnChange = ChangeName
OnKeyPress = SelectionNameKeyPress
TabOrder = 2 TabOrder = 2
Text = 'Name' Text = 'Name'
end end
@ -69,4 +69,13 @@ object ColourHistoryForm: TColourHistoryForm
Top = 209 Top = 209
Width = 56 Width = 56
end end
object OkButton: TButton
Left = 392
Height = 24
Top = 209
Width = 80
Caption = 'Ok'
OnClick = OkButtonClick
TabOrder = 5
end
end end

View File

@ -4,18 +4,19 @@ LazarusResources.Add('TColourHistoryForm','FORMDATA',[
+#7'Caption'#6#21'Colour Picker History'#12'ClientHeight'#3#250#0#11'ClientWi' +#7'Caption'#6#21'Colour Picker History'#12'ClientHeight'#3#250#0#11'ClientWi'
+'dth'#3#233#1#6'OnHide'#7#15'UnSetCHShowMenu'#6'OnShow'#7#13'SetCHShowMenu' +'dth'#3#233#1#6'OnHide'#7#15'UnSetCHShowMenu'#6'OnShow'#7#13'SetCHShowMenu'
+#10'LCLVersion'#6#6'0.9.29'#0#9'TListView'#10'ColourList'#4'Left'#2#16#6'Hei' +#10'LCLVersion'#6#6'0.9.29'#0#9'TListView'#10'ColourList'#4'Left'#2#16#6'Hei'
+'ght'#3#176#0#3'Top'#2#16#5'Width'#3'H'#1#7'Columns'#14#0#11'SmallImages'#7 +'ght'#3#176#0#3'Top'#2#16#5'Width'#3'H'#1#7'Columns'#14#0#8'TabOrder'#2#0#12
+#23'Form1.Mufasa_Image_List'#8'TabOrder'#2#0#12'OnSelectItem'#7#14'ChangeVie' +'OnSelectItem'#7#14'ChangeViewData'#0#0#7'TButton'#12'DeleteButton'#4'Left'#2
+'wData'#0#0#7'TButton'#12'DeleteButton'#4'Left'#2#16#6'Height'#2#25#3'Top'#3 +#16#6'Height'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Caption'#6#6'Delete'#7
+#208#0#5'Width'#3#128#0#7'Caption'#6#6'Delete'#7'OnClick'#7#14'DeleteSelecte' +'OnClick'#7#14'DeleteSelected'#8'TabOrder'#2#1#0#0#5'TEdit'#13'SelectionName'
+'d'#8'TabOrder'#2#1#0#0#5'TEdit'#13'SelectionName'#4'Left'#3'h'#1#6'Height'#2 +#4'Left'#3'h'#1#6'Height'#2#21#3'Top'#2#16#5'Width'#2'p'#8'OnChange'#7#10'Ch'
+#21#3'Top'#2#16#5'Width'#2'p'#8'OnChange'#7#10'ChangeName'#8'TabOrder'#2#2#4 +'angeName'#10'OnKeyPress'#7#21'SelectionNameKeyPress'#8'TabOrder'#2#2#4'Text'
+'Text'#6#4'Name'#0#0#7'TButton'#19'PickNewColourButton'#4'Left'#3#216#0#6'He' +#6#4'Name'#0#0#7'TButton'#19'PickNewColourButton'#4'Left'#3#216#0#6'Height'#2
+'ight'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Caption'#6#15'Pick New Colour' +#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Caption'#6#15'Pick New Colour'#8'TabOr'
+#8'TabOrder'#2#3#0#0#5'TEdit'#11'ColourValue'#4'Left'#3'h'#1#6'Height'#2#21#3 +'der'#2#3#0#0#5'TEdit'#11'ColourValue'#4'Left'#3'h'#1#6'Height'#2#21#3'Top'#2
+'Top'#2'8'#5'Width'#2'p'#8'ReadOnly'#9#8'TabOrder'#2#4#4'Text'#6#11'ColourVa' +'8'#5'Width'#2'p'#8'ReadOnly'#9#8'TabOrder'#2#4#4'Text'#6#11'ColourValue'#0#0
+'lue'#0#0#6'TLabel'#10'CoordValue'#4'Left'#3'h'#1#6'Height'#2#14#3'Top'#2'`' +#6'TLabel'#10'CoordValue'#4'Left'#3'h'#1#6'Height'#2#14#3'Top'#2'`'#5'Width'
+#5'Width'#2'8'#7'Caption'#6#10'CoordValue'#11'ParentColor'#8#0#0#6'TImage'#11 +#2'8'#7'Caption'#6#10'CoordValue'#11'ParentColor'#8#0#0#6'TImage'#11'ColourI'
+'ColourImage'#4'Left'#3#152#0#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'8'#0#0 +'mage'#4'Left'#3#152#0#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'8'#0#0#7'TBu'
+#0 +'tton'#8'OkButton'#4'Left'#3#136#1#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2
+'P'#7'Caption'#6#2'Ok'#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2#5#0#0#0
]); ]);

View File

@ -22,6 +22,7 @@ type
{ TColourHistoryForm } { TColourHistoryForm }
TColourHistoryForm = class(TForm) TColourHistoryForm = class(TForm)
OkButton: TButton;
ColourValue: TEdit; ColourValue: TEdit;
CoordValue: TLabel; CoordValue: TLabel;
ColourImage: TImage; ColourImage: TImage;
@ -37,6 +38,8 @@ type
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure OkButtonClick(Sender: TObject);
procedure SelectionNameKeyPress(Sender: TObject; var Key: char);
procedure SetCHShowMenu(Sender: TObject); procedure SetCHShowMenu(Sender: TObject);
procedure UnSetCHShowMenu(Sender: TObject); procedure UnSetCHShowMenu(Sender: TObject);
private private
@ -92,7 +95,6 @@ begin
it := ColourList.Items.Add; it := ColourList.Items.Add;
it.Data := c; it.Data := c;
it.Caption:= c.Name; it.Caption:= c.Name;
it.ImageIndex:= 7;//just an example
ColourList.Selected := it; ColourList.Selected := it;
end; end;
@ -164,6 +166,21 @@ begin
inherited Destroy; inherited Destroy;
end; end;
procedure TColourHistoryForm.OkButtonClick(Sender: TObject);
begin
Self.close;
end;
procedure TColourHistoryForm.SelectionNameKeyPress(Sender: TObject;
var Key: char);
begin
if key = #13 then
begin
key := #0;
Self.close;
end;
end;
procedure TColourHistoryForm.SetCHShowMenu(Sender: TObject); procedure TColourHistoryForm.SetCHShowMenu(Sender: TObject);
begin begin
Form1.View_CH_Menu.Checked := True; Form1.View_CH_Menu.Checked := True;