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:
parent
1879c42602
commit
3e2a64cc7e
@ -1,103 +1,116 @@
|
|||||||
object ColourHistoryForm: TColourHistoryForm
|
object ColourHistoryForm: TColourHistoryForm
|
||||||
Left = 420
|
Left = 420
|
||||||
Height = 250
|
Height = 250
|
||||||
Top = 318
|
Top = 318
|
||||||
Width = 490
|
Width = 490
|
||||||
ActiveControl = SelectionName
|
ActiveControl = SelectionName
|
||||||
Caption = 'Colour Picker History'
|
Caption = 'Colour Picker History'
|
||||||
ClientHeight = 250
|
ClientHeight = 250
|
||||||
ClientWidth = 490
|
ClientWidth = 490
|
||||||
Constraints.MinHeight = 200
|
Constraints.MinHeight = 200
|
||||||
Constraints.MinWidth = 490
|
Constraints.MinWidth = 490
|
||||||
OnHide = UnSetCHShowMenu
|
OnCreate = FormCreate
|
||||||
OnShow = SetCHShowMenu
|
OnHide = UnSetCHShowMenu
|
||||||
LCLVersion = '0.9.29'
|
OnShow = SetCHShowMenu
|
||||||
object ColourList: TListView
|
LCLVersion = '0.9.29'
|
||||||
Left = 16
|
object ColourList: TListView
|
||||||
Height = 176
|
Left = 16
|
||||||
Top = 16
|
Height = 176
|
||||||
Width = 329
|
Top = 16
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Width = 329
|
||||||
Columns = <>
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
ItemIndex = -1
|
Columns = <
|
||||||
TabOrder = 0
|
item
|
||||||
OnSelectItem = ChangeViewData
|
Caption = 'Colour'
|
||||||
end
|
MaxWidth = 50
|
||||||
object DeleteButton: TButton
|
MinWidth = 50
|
||||||
Left = 16
|
Width = 10
|
||||||
Height = 25
|
end
|
||||||
Top = 208
|
item
|
||||||
Width = 128
|
Caption = 'Woot'
|
||||||
Anchors = [akLeft, akBottom]
|
Width = 10
|
||||||
Caption = 'Delete'
|
end>
|
||||||
OnClick = DeleteSelected
|
ItemIndex = -1
|
||||||
TabOrder = 1
|
TabOrder = 0
|
||||||
end
|
ViewStyle = vsReport
|
||||||
object SelectionName: TEdit
|
OnAdvancedCustomDrawSubItem = ColourListAdvancedCustomDrawSubItem
|
||||||
Left = 361
|
OnSelectItem = ChangeViewData
|
||||||
Height = 27
|
end
|
||||||
Top = 16
|
object DeleteButton: TButton
|
||||||
Width = 112
|
Left = 16
|
||||||
Anchors = [akTop, akRight]
|
Height = 25
|
||||||
OnChange = ChangeName
|
Top = 208
|
||||||
OnKeyPress = SelectionNameKeyPress
|
Width = 128
|
||||||
TabOrder = 2
|
Anchors = [akLeft, akBottom]
|
||||||
Text = 'Name'
|
Caption = 'Delete'
|
||||||
end
|
OnClick = DeleteSelected
|
||||||
object PickNewColourButton: TButton
|
TabOrder = 1
|
||||||
Left = 217
|
end
|
||||||
Height = 25
|
object SelectionName: TEdit
|
||||||
Top = 208
|
Left = 361
|
||||||
Width = 128
|
Height = 21
|
||||||
Anchors = [akRight, akBottom]
|
Top = 16
|
||||||
Caption = 'Pick New Colour'
|
Width = 112
|
||||||
TabOrder = 3
|
Anchors = [akTop, akRight]
|
||||||
end
|
OnChange = ChangeName
|
||||||
object ColourValue: TEdit
|
OnKeyPress = SelectionNameKeyPress
|
||||||
Left = 361
|
TabOrder = 2
|
||||||
Height = 27
|
Text = 'Name'
|
||||||
Top = 56
|
end
|
||||||
Width = 112
|
object PickNewColourButton: TButton
|
||||||
Anchors = [akTop, akRight]
|
Left = 217
|
||||||
ReadOnly = True
|
Height = 25
|
||||||
TabOrder = 4
|
Top = 208
|
||||||
Text = 'ColourValue'
|
Width = 128
|
||||||
end
|
Anchors = [akRight, akBottom]
|
||||||
object CoordValue: TLabel
|
Caption = 'Pick New Colour'
|
||||||
Left = 361
|
TabOrder = 3
|
||||||
Height = 18
|
end
|
||||||
Top = 96
|
object ColourValue: TEdit
|
||||||
Width = 112
|
Left = 361
|
||||||
Anchors = [akTop, akRight]
|
Height = 21
|
||||||
Caption = 'CoordValue'
|
Top = 56
|
||||||
Constraints.MinWidth = 112
|
Width = 112
|
||||||
ParentColor = False
|
Anchors = [akTop, akRight]
|
||||||
end
|
ReadOnly = True
|
||||||
object ColourImage: TImage
|
TabOrder = 4
|
||||||
Left = 152
|
Text = 'ColourValue'
|
||||||
Height = 24
|
end
|
||||||
Top = 209
|
object CoordValue: TLabel
|
||||||
Width = 57
|
Left = 361
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
Height = 14
|
||||||
end
|
Top = 96
|
||||||
object OkButton: TButton
|
Width = 112
|
||||||
Left = 393
|
Anchors = [akTop, akRight]
|
||||||
Height = 24
|
Caption = 'CoordValue'
|
||||||
Top = 209
|
Constraints.MinWidth = 112
|
||||||
Width = 80
|
ParentColor = False
|
||||||
Anchors = [akRight, akBottom]
|
end
|
||||||
Caption = 'Ok'
|
object ColourImage: TImage
|
||||||
OnClick = OkButtonClick
|
Left = 152
|
||||||
TabOrder = 5
|
Height = 24
|
||||||
end
|
Top = 209
|
||||||
object CH_RGB_Label: TLabel
|
Width = 57
|
||||||
Left = 361
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
Height = 18
|
end
|
||||||
Top = 128
|
object OkButton: TButton
|
||||||
Width = 112
|
Left = 393
|
||||||
Anchors = [akTop, akRight]
|
Height = 24
|
||||||
Caption = 'RGBValues'
|
Top = 209
|
||||||
Constraints.MinWidth = 112
|
Width = 80
|
||||||
ParentColor = False
|
Anchors = [akRight, akBottom]
|
||||||
end
|
Caption = 'Ok'
|
||||||
end
|
OnClick = OkButtonClick
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
object CH_RGB_Label: TLabel
|
||||||
|
Left = 361
|
||||||
|
Height = 14
|
||||||
|
Top = 128
|
||||||
|
Width = 112
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
Caption = 'RGBValues'
|
||||||
|
Constraints.MinWidth = 112
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@ -1,33 +1,36 @@
|
|||||||
{ This is an automatically generated lazarus resource file }
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
LazarusResources.Add('TColourHistoryForm','FORMDATA',[
|
LazarusResources.Add('TColourHistoryForm','FORMDATA',[
|
||||||
'TPF0'#18'TColourHistoryForm'#17'ColourHistoryForm'#4'Left'#3#164#1#6'Height'
|
'TPF0'#18'TColourHistoryForm'#17'ColourHistoryForm'#4'Left'#3#164#1#6'Height'
|
||||||
+#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
|
||||||
|
]);
|
||||||
|
@ -1,206 +1,226 @@
|
|||||||
unit colourhistory;
|
unit colourhistory;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
ComCtrls, StdCtrls, ExtCtrls;
|
ComCtrls, StdCtrls, ExtCtrls;
|
||||||
|
|
||||||
type
|
type
|
||||||
TColourPickerObject = class(TObject)
|
TColourPickerObject = class(TObject)
|
||||||
constructor Create(C: Integer; P: TPoint; N: String);
|
constructor Create(C: Integer; P: TPoint; N: String);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
Colour: Integer;
|
Colour: Integer;
|
||||||
Pos: TPoint;
|
Pos: TPoint;
|
||||||
Name: String;
|
Name: String;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TColourHistoryForm }
|
{ TColourHistoryForm }
|
||||||
|
|
||||||
TColourHistoryForm = class(TForm)
|
TColourHistoryForm = class(TForm)
|
||||||
CH_RGB_Label: TLabel;
|
CH_RGB_Label: TLabel;
|
||||||
OkButton: TButton;
|
OkButton: TButton;
|
||||||
ColourValue: TEdit;
|
ColourValue: TEdit;
|
||||||
CoordValue: TLabel;
|
CoordValue: TLabel;
|
||||||
ColourImage: TImage;
|
ColourImage: TImage;
|
||||||
PickNewColourButton: TButton;
|
PickNewColourButton: TButton;
|
||||||
DeleteButton: TButton;
|
DeleteButton: TButton;
|
||||||
ColourList: TListView;
|
ColourList: TListView;
|
||||||
SelectionName: TEdit;
|
SelectionName: TEdit;
|
||||||
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 DeleteSelected(Sender: TObject);
|
procedure ColourListAdvancedCustomDrawSubItem(Sender: TCustomListView;
|
||||||
procedure AddColObj(c: TColourPickerObject; autoName: Boolean);
|
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
|
||||||
|
Stage: TCustomDrawStage; var DefaultDraw: Boolean);
|
||||||
constructor Create(TheOwner: TComponent); override;
|
procedure DeleteSelected(Sender: TObject);
|
||||||
destructor Destroy; override;
|
procedure AddColObj(c: TColourPickerObject; autoName: Boolean);
|
||||||
procedure OkButtonClick(Sender: TObject);
|
|
||||||
procedure SelectionNameKeyPress(Sender: TObject; var Key: char);
|
constructor Create(TheOwner: TComponent); override;
|
||||||
procedure SetCHShowMenu(Sender: TObject);
|
destructor Destroy; override;
|
||||||
procedure UnSetCHShowMenu(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
private
|
procedure OkButtonClick(Sender: TObject);
|
||||||
Colour_Count: Integer;
|
procedure SelectionNameKeyPress(Sender: TObject; var Key: char);
|
||||||
{ private declarations }
|
procedure SetCHShowMenu(Sender: TObject);
|
||||||
protected
|
procedure UnSetCHShowMenu(Sender: TObject);
|
||||||
procedure AddColObj(c: TColourPickerObject);
|
private
|
||||||
public
|
Colour_Count: Integer;
|
||||||
IndexSelected: Integer;
|
{ private declarations }
|
||||||
{ public declarations }
|
protected
|
||||||
end;
|
procedure AddColObj(c: TColourPickerObject);
|
||||||
|
public
|
||||||
|
IndexSelected: Integer;
|
||||||
|
{ public declarations }
|
||||||
var
|
end;
|
||||||
ColourHistoryForm: TColourHistoryForm;
|
|
||||||
|
|
||||||
implementation
|
|
||||||
uses
|
var
|
||||||
colour_conv, TestUnit;
|
ColourHistoryForm: TColourHistoryForm;
|
||||||
|
|
||||||
constructor TColourPickerObject.Create(C: Integer; P: TPoint; N: String);
|
implementation
|
||||||
begin
|
uses
|
||||||
inherited Create;
|
colour_conv, TestUnit;
|
||||||
Self.Colour := C;
|
|
||||||
Self.Pos := P;
|
constructor TColourPickerObject.Create(C: Integer; P: TPoint; N: String);
|
||||||
Self.Name:= N;
|
begin
|
||||||
end;
|
inherited Create;
|
||||||
|
Self.Colour := C;
|
||||||
destructor TColourPickerObject.Destroy;
|
Self.Pos := P;
|
||||||
begin
|
Self.Name:= N;
|
||||||
|
end;
|
||||||
inherited Destroy;
|
|
||||||
end;
|
destructor TColourPickerObject.Destroy;
|
||||||
|
begin
|
||||||
{ TColourHistoryForm }
|
|
||||||
|
inherited Destroy;
|
||||||
procedure TColourHistoryForm.AddColObj(c: TColourPickerObject; autoName: Boolean);
|
end;
|
||||||
begin
|
|
||||||
if autoName then
|
{ TColourHistoryForm }
|
||||||
begin
|
|
||||||
Inc(Colour_Count);
|
procedure TColourHistoryForm.AddColObj(c: TColourPickerObject; autoName: Boolean);
|
||||||
// TODO: Proper name
|
begin
|
||||||
c.Name := IntToStr(c.Colour) + ' (' + IntToStr(Colour_Count) + ')';
|
if autoName then
|
||||||
end;
|
begin
|
||||||
Self.AddColObj(c);
|
Inc(Colour_Count);
|
||||||
end;
|
// TODO: Proper name
|
||||||
|
c.Name := IntToStr(c.Colour) + ' (' + IntToStr(Colour_Count) + ')';
|
||||||
procedure TColourHistoryForm.AddColObj(c: TColourPickerObject);
|
end;
|
||||||
|
Self.AddColObj(c);
|
||||||
var
|
end;
|
||||||
it: TListItem;
|
|
||||||
begin
|
procedure TColourHistoryForm.AddColObj(c: TColourPickerObject);
|
||||||
it := ColourList.Items.Add;
|
|
||||||
it.Data := c;
|
var
|
||||||
it.Caption:= c.Name;
|
it: TListItem;
|
||||||
ColourList.Selected := it;
|
begin
|
||||||
end;
|
it := ColourList.Items.Add;
|
||||||
|
it.Data := c;
|
||||||
procedure TColourHistoryForm.DeleteSelected(Sender: TObject);
|
it.Caption:= c.Name;
|
||||||
|
ColourList.Selected := it;
|
||||||
begin
|
end;
|
||||||
if (Assigned(ColourList.Selected)) then
|
|
||||||
begin
|
procedure TColourHistoryForm.DeleteSelected(Sender: TObject);
|
||||||
TColourPickerObject(ColourList.Selected.Data).Free;
|
|
||||||
ColourList.Selected.Delete;
|
begin
|
||||||
end;
|
if (Assigned(ColourList.Selected)) then
|
||||||
end;
|
begin
|
||||||
|
TColourPickerObject(ColourList.Selected.Data).Free;
|
||||||
procedure TColourHistoryForm.ChangeViewData(Sender: TObject; Item: TListItem;
|
ColourList.Selected.Delete;
|
||||||
Selected: Boolean);
|
end;
|
||||||
var
|
end;
|
||||||
r,g,b:integer;
|
|
||||||
begin
|
procedure TColourHistoryForm.ChangeViewData(Sender: TObject; Item: TListItem;
|
||||||
if not Assigned(Item) then
|
Selected: Boolean);
|
||||||
exit;
|
var
|
||||||
if not Item.Selected then
|
r,g,b:integer;
|
||||||
exit;
|
begin
|
||||||
|
if not Assigned(Item) then
|
||||||
{ This only occurs when we have manually added an item with the Form Editor }
|
exit;
|
||||||
if not Assigned(Item.Data) then
|
if not Item.Selected then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
colour_conv.ColorToRGB(TColourPickerObject(Item.Data).Colour, r, g, b);
|
{ This only occurs when we have manually added an item with the Form Editor }
|
||||||
|
if not Assigned(Item.Data) then
|
||||||
{ Change Form Text / Values }
|
exit;
|
||||||
ColourValue.Caption := IntToStr(TColourPickerObject(Item.Data).Colour);
|
|
||||||
CoordValue.Caption := 'Coords: ' + IntToStr(TColourPickerObject(Item.Data).Pos.X) +
|
colour_conv.ColorToRGB(TColourPickerObject(Item.Data).Colour, r, g, b);
|
||||||
', ' + IntToStr(TColourPickerObject(Item.Data).Pos.Y);
|
|
||||||
SelectionName.Text := TColourPickerObject(Item.Data).Name;
|
{ Change Form Text / Values }
|
||||||
|
ColourValue.Caption := IntToStr(TColourPickerObject(Item.Data).Colour);
|
||||||
CH_RGB_Label.Caption:=Format('RGB:%d,%d,%d', [r,g,b]);
|
CoordValue.Caption := 'Coords: ' + IntToStr(TColourPickerObject(Item.Data).Pos.X) +
|
||||||
|
', ' + IntToStr(TColourPickerObject(Item.Data).Pos.Y);
|
||||||
{ Draw the Image }
|
SelectionName.Text := TColourPickerObject(Item.Data).Name;
|
||||||
ColourImage.Canvas.Brush.Color := TColourPickerObject(Item.Data).Colour;
|
|
||||||
ColourImage.Canvas.Rectangle(0,0,ColourImage.Width, ColourImage.Height);
|
CH_RGB_Label.Caption:=Format('RGB:%d,%d,%d', [r,g,b]);
|
||||||
|
|
||||||
if Self.Visible then
|
{ Draw the Image }
|
||||||
begin
|
ColourImage.Canvas.Brush.Color := TColourPickerObject(Item.Data).Colour;
|
||||||
try
|
ColourImage.Canvas.Rectangle(0,0,ColourImage.Width, ColourImage.Height);
|
||||||
SelectionName.SetFocus;
|
|
||||||
finally
|
if Self.Visible then
|
||||||
end;
|
begin
|
||||||
end;
|
try
|
||||||
end;
|
SelectionName.SetFocus;
|
||||||
|
finally
|
||||||
procedure TColourHistoryForm.ChangeName(Sender: TObject);
|
end;
|
||||||
begin
|
end;
|
||||||
if not Assigned(ColourList.Selected) then
|
end;
|
||||||
begin
|
|
||||||
WriteLn('We double clicked but have nothing Selected?');
|
procedure TColourHistoryForm.ColourListAdvancedCustomDrawSubItem(
|
||||||
exit;
|
Sender: TCustomListView; Item: TListItem; SubItem: Integer;
|
||||||
end;
|
State: TCustomDrawState; Stage: TCustomDrawStage; var DefaultDraw: Boolean);
|
||||||
ColourList.Selected.Caption := SelectionName.Text;
|
begin
|
||||||
TColourPickerObject(ColourList.Selected.Data).Name := SelectionName.Text;
|
if SubItem = 0 then
|
||||||
end;
|
ColourList.Canvas.Brush.Color := clWhite
|
||||||
|
else
|
||||||
constructor TColourHistoryForm.Create(TheOwner: TComponent);
|
ColourList.Canvas.Brush.Color := TColourPickerObject(Item.Data).Colour;
|
||||||
begin
|
end;
|
||||||
inherited Create(TheOwner);
|
|
||||||
|
procedure TColourHistoryForm.ChangeName(Sender: TObject);
|
||||||
Colour_Count := 0;
|
begin
|
||||||
PickNewColourButton.OnClick:= @Form1.ButtonPickClick;
|
if not Assigned(ColourList.Selected) then
|
||||||
end;
|
begin
|
||||||
|
WriteLn('We double clicked but have nothing Selected?');
|
||||||
destructor TColourHistoryForm.Destroy;
|
exit;
|
||||||
begin
|
end;
|
||||||
PickNewColourButton.OnClick := nil;
|
ColourList.Selected.Caption := SelectionName.Text;
|
||||||
Colour_Count := 0;
|
TColourPickerObject(ColourList.Selected.Data).Name := SelectionName.Text;
|
||||||
|
end;
|
||||||
inherited Destroy;
|
|
||||||
end;
|
constructor TColourHistoryForm.Create(TheOwner: TComponent);
|
||||||
|
begin
|
||||||
procedure TColourHistoryForm.OkButtonClick(Sender: TObject);
|
inherited Create(TheOwner);
|
||||||
begin
|
|
||||||
Self.close;
|
Colour_Count := 0;
|
||||||
end;
|
PickNewColourButton.OnClick:= @Form1.ButtonPickClick;
|
||||||
|
end;
|
||||||
procedure TColourHistoryForm.SelectionNameKeyPress(Sender: TObject;
|
|
||||||
var Key: char);
|
destructor TColourHistoryForm.Destroy;
|
||||||
begin
|
begin
|
||||||
if key = #13 then
|
PickNewColourButton.OnClick := nil;
|
||||||
begin
|
Colour_Count := 0;
|
||||||
key := #0;
|
|
||||||
Self.close;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
procedure TColourHistoryForm.FormCreate(Sender: TObject);
|
||||||
procedure TColourHistoryForm.SetCHShowMenu(Sender: TObject);
|
begin
|
||||||
begin
|
ColourList.Column[0].Width:= 100;
|
||||||
Form1.MenuItemColourHistory.Checked := True;
|
ColourList.Column[1].Width:= 500;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TColourHistoryForm.UnSetCHShowMenu(Sender: TObject);
|
procedure TColourHistoryForm.OkButtonClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Form1.MenuItemColourHistory.Checked := False;
|
Self.close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
procedure TColourHistoryForm.SelectionNameKeyPress(Sender: TObject;
|
||||||
{$I colourhistory.lrs}
|
var Key: char);
|
||||||
|
begin
|
||||||
end.
|
if key = #13 then
|
||||||
|
begin
|
||||||
|
key := #0;
|
||||||
|
Self.close;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TColourHistoryForm.SetCHShowMenu(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Form1.MenuItemColourHistory.Checked := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TColourHistoryForm.UnSetCHShowMenu(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Form1.MenuItemColourHistory.Checked := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I colourhistory.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user