1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-26 01:09:08 -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
Width = 328
Columns = <>
SmallImages = Form1.Mufasa_Image_List
TabOrder = 0
OnSelectItem = ChangeViewData
end
@ -35,6 +34,7 @@ object ColourHistoryForm: TColourHistoryForm
Top = 16
Width = 112
OnChange = ChangeName
OnKeyPress = SelectionNameKeyPress
TabOrder = 2
Text = 'Name'
end
@ -69,4 +69,13 @@ object ColourHistoryForm: TColourHistoryForm
Top = 209
Width = 56
end
object OkButton: TButton
Left = 392
Height = 24
Top = 209
Width = 80
Caption = 'Ok'
OnClick = OkButtonClick
TabOrder = 5
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'
+'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'
+'ght'#3#176#0#3'Top'#2#16#5'Width'#3'H'#1#7'Columns'#14#0#11'SmallImages'#7
+#23'Form1.Mufasa_Image_List'#8'TabOrder'#2#0#12'OnSelectItem'#7#14'ChangeVie'
+'wData'#0#0#7'TButton'#12'DeleteButton'#4'Left'#2#16#6'Height'#2#25#3'Top'#3
+#208#0#5'Width'#3#128#0#7'Caption'#6#6'Delete'#7'OnClick'#7#14'DeleteSelecte'
+'d'#8'TabOrder'#2#1#0#0#5'TEdit'#13'SelectionName'#4'Left'#3'h'#1#6'Height'#2
+#21#3'Top'#2#16#5'Width'#2'p'#8'OnChange'#7#10'ChangeName'#8'TabOrder'#2#2#4
+'Text'#6#4'Name'#0#0#7'TButton'#19'PickNewColourButton'#4'Left'#3#216#0#6'He'
+'ight'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Caption'#6#15'Pick New Colour'
+#8'TabOrder'#2#3#0#0#5'TEdit'#11'ColourValue'#4'Left'#3'h'#1#6'Height'#2#21#3
+'Top'#2'8'#5'Width'#2'p'#8'ReadOnly'#9#8'TabOrder'#2#4#4'Text'#6#11'ColourVa'
+'lue'#0#0#6'TLabel'#10'CoordValue'#4'Left'#3'h'#1#6'Height'#2#14#3'Top'#2'`'
+#5'Width'#2'8'#7'Caption'#6#10'CoordValue'#11'ParentColor'#8#0#0#6'TImage'#11
+'ColourImage'#4'Left'#3#152#0#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'8'#0#0
+#0
+'ght'#3#176#0#3'Top'#2#16#5'Width'#3'H'#1#7'Columns'#14#0#8'TabOrder'#2#0#12
+'OnSelectItem'#7#14'ChangeViewData'#0#0#7'TButton'#12'DeleteButton'#4'Left'#2
+#16#6'Height'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Caption'#6#6'Delete'#7
+'OnClick'#7#14'DeleteSelected'#8'TabOrder'#2#1#0#0#5'TEdit'#13'SelectionName'
+#4'Left'#3'h'#1#6'Height'#2#21#3'Top'#2#16#5'Width'#2'p'#8'OnChange'#7#10'Ch'
+'angeName'#10'OnKeyPress'#7#21'SelectionNameKeyPress'#8'TabOrder'#2#2#4'Text'
+#6#4'Name'#0#0#7'TButton'#19'PickNewColourButton'#4'Left'#3#216#0#6'Height'#2
+#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Caption'#6#15'Pick New Colour'#8'TabOr'
+'der'#2#3#0#0#5'TEdit'#11'ColourValue'#4'Left'#3'h'#1#6'Height'#2#21#3'Top'#2
+'8'#5'Width'#2'p'#8'ReadOnly'#9#8'TabOrder'#2#4#4'Text'#6#11'ColourValue'#0#0
+#6'TLabel'#10'CoordValue'#4'Left'#3'h'#1#6'Height'#2#14#3'Top'#2'`'#5'Width'
+#2'8'#7'Caption'#6#10'CoordValue'#11'ParentColor'#8#0#0#6'TImage'#11'ColourI'
+'mage'#4'Left'#3#152#0#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'8'#0#0#7'TBu'
+'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 = class(TForm)
OkButton: TButton;
ColourValue: TEdit;
CoordValue: TLabel;
ColourImage: TImage;
@ -37,6 +38,8 @@ type
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure OkButtonClick(Sender: TObject);
procedure SelectionNameKeyPress(Sender: TObject; var Key: char);
procedure SetCHShowMenu(Sender: TObject);
procedure UnSetCHShowMenu(Sender: TObject);
private
@ -92,7 +95,6 @@ begin
it := ColourList.Items.Add;
it.Data := c;
it.Caption:= c.Name;
it.ImageIndex:= 7;//just an example
ColourList.Selected := it;
end;
@ -164,6 +166,21 @@ begin
inherited Destroy;
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);
begin
Form1.View_CH_Menu.Checked := True;