1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-24 18:22:25 -05:00

Testing purposes only

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@295 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Raymond 2009-12-19 22:55:50 +00:00
parent 1879c42602
commit 3e2a64cc7e
3 changed files with 378 additions and 342 deletions

View File

@ -9,6 +9,7 @@ object ColourHistoryForm: TColourHistoryForm
ClientWidth = 490 ClientWidth = 490
Constraints.MinHeight = 200 Constraints.MinHeight = 200
Constraints.MinWidth = 490 Constraints.MinWidth = 490
OnCreate = FormCreate
OnHide = UnSetCHShowMenu OnHide = UnSetCHShowMenu
OnShow = SetCHShowMenu OnShow = SetCHShowMenu
LCLVersion = '0.9.29' LCLVersion = '0.9.29'
@ -18,9 +19,21 @@ object ColourHistoryForm: TColourHistoryForm
Top = 16 Top = 16
Width = 329 Width = 329
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
Columns = <> Columns = <
item
Caption = 'Colour'
MaxWidth = 50
MinWidth = 50
Width = 10
end
item
Caption = 'Woot'
Width = 10
end>
ItemIndex = -1 ItemIndex = -1
TabOrder = 0 TabOrder = 0
ViewStyle = vsReport
OnAdvancedCustomDrawSubItem = ColourListAdvancedCustomDrawSubItem
OnSelectItem = ChangeViewData OnSelectItem = ChangeViewData
end end
object DeleteButton: TButton object DeleteButton: TButton
@ -35,7 +48,7 @@ object ColourHistoryForm: TColourHistoryForm
end end
object SelectionName: TEdit object SelectionName: TEdit
Left = 361 Left = 361
Height = 27 Height = 21
Top = 16 Top = 16
Width = 112 Width = 112
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -55,7 +68,7 @@ object ColourHistoryForm: TColourHistoryForm
end end
object ColourValue: TEdit object ColourValue: TEdit
Left = 361 Left = 361
Height = 27 Height = 21
Top = 56 Top = 56
Width = 112 Width = 112
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -65,7 +78,7 @@ object ColourHistoryForm: TColourHistoryForm
end end
object CoordValue: TLabel object CoordValue: TLabel
Left = 361 Left = 361
Height = 18 Height = 14
Top = 96 Top = 96
Width = 112 Width = 112
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -92,7 +105,7 @@ object ColourHistoryForm: TColourHistoryForm
end end
object CH_RGB_Label: TLabel object CH_RGB_Label: TLabel
Left = 361 Left = 361
Height = 18 Height = 14
Top = 128 Top = 128
Width = 112 Width = 112
Anchors = [akTop, akRight] Anchors = [akTop, akRight]

View File

@ -5,29 +5,32 @@ LazarusResources.Add('TColourHistoryForm','FORMDATA',[
+#3#250#0#3'Top'#3'>'#1#5'Width'#3#234#1#13'ActiveControl'#7#13'SelectionName' +#3#250#0#3'Top'#3'>'#1#5'Width'#3#234#1#13'ActiveControl'#7#13'SelectionName'
+#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#234#1#21'Constraints.MinHeight'#3#200#0#20'Constraints.MinWidth'#3 +'dth'#3#234#1#21'Constraints.MinHeight'#3#200#0#20'Constraints.MinWidth'#3
+#234#1#6'OnHide'#7#15'UnSetCHShowMenu'#6'OnShow'#7#13'SetCHShowMenu'#10'LCLV' +#234#1#8'OnCreate'#7#10'FormCreate'#6'OnHide'#7#15'UnSetCHShowMenu'#6'OnShow'
+'ersion'#6#6'0.9.29'#0#9'TListView'#10'ColourList'#4'Left'#2#16#6'Height'#3 +#7#13'SetCHShowMenu'#10'LCLVersion'#6#6'0.9.29'#0#9'TListView'#10'ColourList'
+#176#0#3'Top'#2#16#5'Width'#3'I'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRigh' +#4'Left'#2#16#6'Height'#3#176#0#3'Top'#2#16#5'Width'#3'I'#1#7'Anchors'#11#5
+'t'#8'akBottom'#0#7'Columns'#14#0#9'ItemIndex'#2#255#8'TabOrder'#2#0#12'OnSe' +'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Columns'#14#1#7'Caption'#6#6'Co'
+'lectItem'#7#14'ChangeViewData'#0#0#7'TButton'#12'DeleteButton'#4'Left'#2#16 +'lour'#8'MaxWidth'#2'2'#8'MinWidth'#2'2'#5'Width'#2#10#0#1#7'Caption'#6#4'Wo'
+#6'Height'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Anchors'#11#6'akLeft'#8'ak' +'ot'#5'Width'#2#10#0#0#9'ItemIndex'#2#255#8'TabOrder'#2#0#9'ViewStyle'#7#8'v'
+'Bottom'#0#7'Caption'#6#6'Delete'#7'OnClick'#7#14'DeleteSelected'#8'TabOrder' +'sReport'#27'OnAdvancedCustomDrawSubItem'#7'#ColourListAdvancedCustomDrawSub'
+#2#1#0#0#5'TEdit'#13'SelectionName'#4'Left'#3'i'#1#6'Height'#2#27#3'Top'#2#16 +'Item'#12'OnSelectItem'#7#14'ChangeViewData'#0#0#7'TButton'#12'DeleteButton'
+#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'OnChange'#7#10'ChangeNa' +#4'Left'#2#16#6'Height'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Anchors'#11#6
+'me'#10'OnKeyPress'#7#21'SelectionNameKeyPress'#8'TabOrder'#2#2#4'Text'#6#4 +'akLeft'#8'akBottom'#0#7'Caption'#6#6'Delete'#7'OnClick'#7#14'DeleteSelected'
+'Name'#0#0#7'TButton'#19'PickNewColourButton'#4'Left'#3#217#0#6'Height'#2#25 +#8'TabOrder'#2#1#0#0#5'TEdit'#13'SelectionName'#4'Left'#3'i'#1#6'Height'#2#21
+#3'Top'#3#208#0#5'Width'#3#128#0#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Ca' +#3'Top'#2#16#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'OnChange'#7
+'ption'#6#15'Pick New Colour'#8'TabOrder'#2#3#0#0#5'TEdit'#11'ColourValue'#4 +#10'ChangeName'#10'OnKeyPress'#7#21'SelectionNameKeyPress'#8'TabOrder'#2#2#4
+'Left'#3'i'#1#6'Height'#2#27#3'Top'#2'8'#5'Width'#2'p'#7'Anchors'#11#5'akTop' +'Text'#6#4'Name'#0#0#7'TButton'#19'PickNewColourButton'#4'Left'#3#217#0#6'He'
+#7'akRight'#0#8'ReadOnly'#9#8'TabOrder'#2#4#4'Text'#6#11'ColourValue'#0#0#6 +'ight'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Anchors'#11#7'akRight'#8'akBot'
+'TLabel'#10'CoordValue'#4'Left'#3'i'#1#6'Height'#2#18#3'Top'#2'`'#5'Width'#2 +'tom'#0#7'Caption'#6#15'Pick New Colour'#8'TabOrder'#2#3#0#0#5'TEdit'#11'Col'
+'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#10'CoordValue'#20'Const' +'ourValue'#4'Left'#3'i'#1#6'Height'#2#21#3'Top'#2'8'#5'Width'#2'p'#7'Anchors'
+'raints.MinWidth'#2'p'#11'ParentColor'#8#0#0#6'TImage'#11'ColourImage'#4'Lef' +#11#5'akTop'#7'akRight'#0#8'ReadOnly'#9#8'TabOrder'#2#4#4'Text'#6#11'ColourV'
+'t'#3#152#0#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'9'#7'Anchors'#11#6'akLe' +'alue'#0#0#6'TLabel'#10'CoordValue'#4'Left'#3'i'#1#6'Height'#2#14#3'Top'#2'`'
+'ft'#7'akRight'#8'akBottom'#0#0#0#7'TButton'#8'OkButton'#4'Left'#3#137#1#6'H' +#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#10'CoordValu'
+'eight'#2#24#3'Top'#3#209#0#5'Width'#2'P'#7'Anchors'#11#7'akRight'#8'akBotto' +'e'#20'Constraints.MinWidth'#2'p'#11'ParentColor'#8#0#0#6'TImage'#11'ColourI'
+'m'#0#7'Caption'#6#2'Ok'#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2#5#0#0#6 +'mage'#4'Left'#3#152#0#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'9'#7'Anchors'
+'TLabel'#12'CH_RGB_Label'#4'Left'#3'i'#1#6'Height'#2#18#3'Top'#3#128#0#5'Wid' +#11#6'akLeft'#7'akRight'#8'akBottom'#0#0#0#7'TButton'#8'OkButton'#4'Left'#3
+'th'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#9'RGBValues'#20'C' +#137#1#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'P'#7'Anchors'#11#7'akRight'#8
+'onstraints.MinWidth'#2'p'#11'ParentColor'#8#0#0#0 +'akBottom'#0#7'Caption'#6#2'Ok'#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2
+#5#0#0#6'TLabel'#12'CH_RGB_Label'#4'Left'#3'i'#1#6'Height'#2#14#3'Top'#3#128
+#0#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#9'RGBValue'
+'s'#20'Constraints.MinWidth'#2'p'#11'ParentColor'#8#0#0#0
]); ]);

View File

@ -34,11 +34,15 @@ type
procedure ChangeName(Sender: TObject); procedure ChangeName(Sender: TObject);
procedure ChangeViewData(Sender: TObject; Item: TListItem; Selected: Boolean procedure ChangeViewData(Sender: TObject; Item: TListItem; Selected: Boolean
); );
procedure ColourListAdvancedCustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
Stage: TCustomDrawStage; var DefaultDraw: Boolean);
procedure DeleteSelected(Sender: TObject); procedure DeleteSelected(Sender: TObject);
procedure AddColObj(c: TColourPickerObject; autoName: Boolean); procedure AddColObj(c: TColourPickerObject; autoName: Boolean);
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure FormCreate(Sender: TObject);
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure SelectionNameKeyPress(Sender: TObject; var Key: char); procedure SelectionNameKeyPress(Sender: TObject; var Key: char);
procedure SetCHShowMenu(Sender: TObject); procedure SetCHShowMenu(Sender: TObject);
@ -147,6 +151,16 @@ begin
end; end;
end; end;
procedure TColourHistoryForm.ColourListAdvancedCustomDrawSubItem(
Sender: TCustomListView; Item: TListItem; SubItem: Integer;
State: TCustomDrawState; Stage: TCustomDrawStage; var DefaultDraw: Boolean);
begin
if SubItem = 0 then
ColourList.Canvas.Brush.Color := clWhite
else
ColourList.Canvas.Brush.Color := TColourPickerObject(Item.Data).Colour;
end;
procedure TColourHistoryForm.ChangeName(Sender: TObject); procedure TColourHistoryForm.ChangeName(Sender: TObject);
begin begin
if not Assigned(ColourList.Selected) then if not Assigned(ColourList.Selected) then
@ -174,6 +188,12 @@ begin
inherited Destroy; inherited Destroy;
end; end;
procedure TColourHistoryForm.FormCreate(Sender: TObject);
begin
ColourList.Column[0].Width:= 100;
ColourList.Column[1].Width:= 500;
end;
procedure TColourHistoryForm.OkButtonClick(Sender: TObject); procedure TColourHistoryForm.OkButtonClick(Sender: TObject);
begin begin
Self.close; Self.close;