1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-02-07 10:40:19 -05:00
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@296 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2009-12-19 23:34:38 +00:00
parent 3e2a64cc7e
commit a74bd810c0
5 changed files with 484 additions and 503 deletions

View File

@ -1,116 +1,108 @@
object ColourHistoryForm: TColourHistoryForm object ColourHistoryForm: TColourHistoryForm
Left = 420 Left = 373
Height = 250 Height = 250
Top = 318 Top = 308
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
OnCreate = FormCreate OnHide = UnSetCHShowMenu
OnHide = UnSetCHShowMenu OnShow = SetCHShowMenu
OnShow = SetCHShowMenu LCLVersion = '0.9.29'
LCLVersion = '0.9.29' object DeleteButton: TButton
object ColourList: TListView Left = 16
Left = 16 Height = 25
Height = 176 Top = 208
Top = 16 Width = 128
Width = 329 Anchors = [akLeft, akBottom]
Anchors = [akTop, akLeft, akRight, akBottom] Caption = 'Delete'
Columns = < OnClick = DeleteSelected
item TabOrder = 0
Caption = 'Colour' end
MaxWidth = 50 object SelectionName: TEdit
MinWidth = 50 Left = 361
Width = 10 Height = 27
end Top = 16
item Width = 112
Caption = 'Woot' Anchors = [akTop, akRight]
Width = 10 OnChange = ChangeName
end> OnKeyPress = SelectionNameKeyPress
ItemIndex = -1 TabOrder = 1
TabOrder = 0 Text = 'Name'
ViewStyle = vsReport end
OnAdvancedCustomDrawSubItem = ColourListAdvancedCustomDrawSubItem object PickNewColourButton: TButton
OnSelectItem = ChangeViewData Left = 217
end Height = 25
object DeleteButton: TButton Top = 208
Left = 16 Width = 128
Height = 25 Anchors = [akRight, akBottom]
Top = 208 Caption = 'Pick New Colour'
Width = 128 TabOrder = 2
Anchors = [akLeft, akBottom] end
Caption = 'Delete' object ColourValue: TEdit
OnClick = DeleteSelected Left = 361
TabOrder = 1 Height = 27
end Top = 56
object SelectionName: TEdit Width = 112
Left = 361 Anchors = [akTop, akRight]
Height = 21 ReadOnly = True
Top = 16 TabOrder = 3
Width = 112 Text = 'ColourValue'
Anchors = [akTop, akRight] end
OnChange = ChangeName object CoordValue: TLabel
OnKeyPress = SelectionNameKeyPress Left = 361
TabOrder = 2 Height = 18
Text = 'Name' Top = 96
end Width = 112
object PickNewColourButton: TButton Anchors = [akTop, akRight]
Left = 217 Caption = 'CoordValue'
Height = 25 Constraints.MinWidth = 112
Top = 208 ParentColor = False
Width = 128 end
Anchors = [akRight, akBottom] object ColourImage: TImage
Caption = 'Pick New Colour' Left = 152
TabOrder = 3 Height = 24
end Top = 209
object ColourValue: TEdit Width = 57
Left = 361 Anchors = [akLeft, akRight, akBottom]
Height = 21 end
Top = 56 object OkButton: TButton
Width = 112 Left = 393
Anchors = [akTop, akRight] Height = 24
ReadOnly = True Top = 209
TabOrder = 4 Width = 80
Text = 'ColourValue' Anchors = [akRight, akBottom]
end Caption = 'Ok'
object CoordValue: TLabel OnClick = OkButtonClick
Left = 361 TabOrder = 4
Height = 14 end
Top = 96 object CH_RGB_Label: TLabel
Width = 112 Left = 361
Anchors = [akTop, akRight] Height = 18
Caption = 'CoordValue' Top = 128
Constraints.MinWidth = 112 Width = 112
ParentColor = False Anchors = [akTop, akRight]
end Caption = 'RGBValues'
object ColourImage: TImage Constraints.MinWidth = 112
Left = 152 ParentColor = False
Height = 24 end
Top = 209 object ColourTree: TTreeView
Width = 57 Left = 8
Anchors = [akLeft, akRight, akBottom] Height = 169
end Top = 16
object OkButton: TButton Width = 337
Left = 393 Anchors = [akTop, akLeft, akRight, akBottom]
Height = 24 DefaultItemHeight = 19
Top = 209 Images = CHImages
Width = 80 ScrollBars = ssAutoBoth
Anchors = [akRight, akBottom] TabOrder = 5
Caption = 'Ok' OnChange = ColourTreeChange
OnClick = OkButtonClick end
TabOrder = 5 object CHImages: TImageList
end left = 360
object CH_RGB_Label: TLabel top = 200
Left = 361 end
Height = 14 end
Top = 128
Width = 112
Anchors = [akTop, akRight]
Caption = 'RGBValues'
Constraints.MinWidth = 112
ParentColor = False
end
end

View File

@ -1,36 +1,34 @@
{ 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'u'#1#6'Height'#3
+#3#250#0#3'Top'#3'>'#1#5'Width'#3#234#1#13'ActiveControl'#7#13'SelectionName' +#250#0#3'Top'#3'4'#1#5'Width'#3#234#1#13'ActiveControl'#7#13'SelectionName'#7
+#7'Caption'#6#21'Colour Picker History'#12'ClientHeight'#3#250#0#11'ClientWi' +'Caption'#6#21'Colour Picker History'#12'ClientHeight'#3#250#0#11'ClientWidt'
+'dth'#3#234#1#21'Constraints.MinHeight'#3#200#0#20'Constraints.MinWidth'#3 +'h'#3#234#1#21'Constraints.MinHeight'#3#200#0#20'Constraints.MinWidth'#3#234
+#234#1#8'OnCreate'#7#10'FormCreate'#6'OnHide'#7#15'UnSetCHShowMenu'#6'OnShow' +#1#6'OnHide'#7#15'UnSetCHShowMenu'#6'OnShow'#7#13'SetCHShowMenu'#10'LCLVersi'
+#7#13'SetCHShowMenu'#10'LCLVersion'#6#6'0.9.29'#0#9'TListView'#10'ColourList' +'on'#6#6'0.9.29'#0#7'TButton'#12'DeleteButton'#4'Left'#2#16#6'Height'#2#25#3
+#4'Left'#2#16#6'Height'#3#176#0#3'Top'#2#16#5'Width'#3'I'#1#7'Anchors'#11#5 +'Top'#3#208#0#5'Width'#3#128#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Capti'
+'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Columns'#14#1#7'Caption'#6#6'Co' +'on'#6#6'Delete'#7'OnClick'#7#14'DeleteSelected'#8'TabOrder'#2#0#0#0#5'TEdit'
+'lour'#8'MaxWidth'#2'2'#8'MinWidth'#2'2'#5'Width'#2#10#0#1#7'Caption'#6#4'Wo' +#13'SelectionName'#4'Left'#3'i'#1#6'Height'#2#27#3'Top'#2#16#5'Width'#2'p'#7
+'ot'#5'Width'#2#10#0#0#9'ItemIndex'#2#255#8'TabOrder'#2#0#9'ViewStyle'#7#8'v' +'Anchors'#11#5'akTop'#7'akRight'#0#8'OnChange'#7#10'ChangeName'#10'OnKeyPres'
+'sReport'#27'OnAdvancedCustomDrawSubItem'#7'#ColourListAdvancedCustomDrawSub' +'s'#7#21'SelectionNameKeyPress'#8'TabOrder'#2#1#4'Text'#6#4'Name'#0#0#7'TBut'
+'Item'#12'OnSelectItem'#7#14'ChangeViewData'#0#0#7'TButton'#12'DeleteButton' +'ton'#19'PickNewColourButton'#4'Left'#3#217#0#6'Height'#2#25#3'Top'#3#208#0#5
+#4'Left'#2#16#6'Height'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Anchors'#11#6 +'Width'#3#128#0#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Caption'#6#15'Pick '
+'akLeft'#8'akBottom'#0#7'Caption'#6#6'Delete'#7'OnClick'#7#14'DeleteSelected' +'New Colour'#8'TabOrder'#2#2#0#0#5'TEdit'#11'ColourValue'#4'Left'#3'i'#1#6'H'
+#8'TabOrder'#2#1#0#0#5'TEdit'#13'SelectionName'#4'Left'#3'i'#1#6'Height'#2#21 +'eight'#2#27#3'Top'#2'8'#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#8
+#3'Top'#2#16#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'OnChange'#7 +'ReadOnly'#9#8'TabOrder'#2#3#4'Text'#6#11'ColourValue'#0#0#6'TLabel'#10'Coor'
+#10'ChangeName'#10'OnKeyPress'#7#21'SelectionNameKeyPress'#8'TabOrder'#2#2#4 +'dValue'#4'Left'#3'i'#1#6'Height'#2#18#3'Top'#2'`'#5'Width'#2'p'#7'Anchors'
+'Text'#6#4'Name'#0#0#7'TButton'#19'PickNewColourButton'#4'Left'#3#217#0#6'He' +#11#5'akTop'#7'akRight'#0#7'Caption'#6#10'CoordValue'#20'Constraints.MinWidt'
+'ight'#2#25#3'Top'#3#208#0#5'Width'#3#128#0#7'Anchors'#11#7'akRight'#8'akBot' +'h'#2'p'#11'ParentColor'#8#0#0#6'TImage'#11'ColourImage'#4'Left'#3#152#0#6'H'
+'tom'#0#7'Caption'#6#15'Pick New Colour'#8'TabOrder'#2#3#0#0#5'TEdit'#11'Col' +'eight'#2#24#3'Top'#3#209#0#5'Width'#2'9'#7'Anchors'#11#6'akLeft'#7'akRight'
+'ourValue'#4'Left'#3'i'#1#6'Height'#2#21#3'Top'#2'8'#5'Width'#2'p'#7'Anchors' +#8'akBottom'#0#0#0#7'TButton'#8'OkButton'#4'Left'#3#137#1#6'Height'#2#24#3'T'
+#11#5'akTop'#7'akRight'#0#8'ReadOnly'#9#8'TabOrder'#2#4#4'Text'#6#11'ColourV' +'op'#3#209#0#5'Width'#2'P'#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Caption'
+'alue'#0#0#6'TLabel'#10'CoordValue'#4'Left'#3'i'#1#6'Height'#2#14#3'Top'#2'`' +#6#2'Ok'#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2#4#0#0#6'TLabel'#12'CH_'
+#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#10'CoordValu' +'RGB_Label'#4'Left'#3'i'#1#6'Height'#2#18#3'Top'#3#128#0#5'Width'#2'p'#7'Anc'
+'e'#20'Constraints.MinWidth'#2'p'#11'ParentColor'#8#0#0#6'TImage'#11'ColourI' +'hors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#9'RGBValues'#20'Constraints.Min'
+'mage'#4'Left'#3#152#0#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'9'#7'Anchors' +'Width'#2'p'#11'ParentColor'#8#0#0#9'TTreeView'#10'ColourTree'#4'Left'#2#8#6
+#11#6'akLeft'#7'akRight'#8'akBottom'#0#0#0#7'TButton'#8'OkButton'#4'Left'#3 +'Height'#3#169#0#3'Top'#2#16#5'Width'#3'Q'#1#7'Anchors'#11#5'akTop'#6'akLeft'
+#137#1#6'Height'#2#24#3'Top'#3#209#0#5'Width'#2'P'#7'Anchors'#11#7'akRight'#8 +#7'akRight'#8'akBottom'#0#17'DefaultItemHeight'#2#19#6'Images'#7#8'CHImages'
+'akBottom'#0#7'Caption'#6#2'Ok'#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2 +#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#5#8'OnChange'#7#16'ColourTree'
+#5#0#0#6'TLabel'#12'CH_RGB_Label'#4'Left'#3'i'#1#6'Height'#2#14#3'Top'#3#128 +'Change'#0#0#10'TImageList'#8'CHImages'#4'left'#3'h'#1#3'top'#3#200#0#0#0#0
+#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

@ -1,226 +1,217 @@
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; CHImages: TImageList;
ColourValue: TEdit; OkButton: TButton;
CoordValue: TLabel; ColourValue: TEdit;
ColourImage: TImage; CoordValue: TLabel;
PickNewColourButton: TButton; ColourImage: TImage;
DeleteButton: TButton; PickNewColourButton: TButton;
ColourList: TListView; DeleteButton: TButton;
SelectionName: TEdit; SelectionName: TEdit;
procedure ChangeName(Sender: TObject); ColourTree: TTreeView;
procedure ChangeViewData(Sender: TObject; Item: TListItem; Selected: Boolean procedure ChangeName(Sender: TObject);
); procedure ColourTreeChange(Sender: TObject; Node: TTreeNode);
procedure ColourListAdvancedCustomDrawSubItem(Sender: TCustomListView; procedure DeleteSelected(Sender: TObject);
Item: TListItem; SubItem: Integer; State: TCustomDrawState; procedure AddColObj(c: TColourPickerObject; autoName: Boolean);
Stage: TCustomDrawStage; var DefaultDraw: Boolean);
procedure DeleteSelected(Sender: TObject); constructor Create(TheOwner: TComponent); override;
procedure AddColObj(c: TColourPickerObject; autoName: Boolean); destructor Destroy; override;
procedure OkButtonClick(Sender: TObject);
constructor Create(TheOwner: TComponent); override; procedure SelectionNameKeyPress(Sender: TObject; var Key: char);
destructor Destroy; override; procedure SetCHShowMenu(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure UnSetCHShowMenu(Sender: TObject);
procedure OkButtonClick(Sender: TObject); private
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
// TODO: Proper name
procedure TColourHistoryForm.AddColObj(c: TColourPickerObject; autoName: Boolean); c.Name := IntToStr(c.Colour);
begin end;
if autoName then Self.AddColObj(c);
begin end;
Inc(Colour_Count);
// TODO: Proper name procedure TColourHistoryForm.AddColObj(c: TColourPickerObject);
c.Name := IntToStr(c.Colour) + ' (' + IntToStr(Colour_Count) + ')';
end; var
Self.AddColObj(c); it: TTreeNode;
end; bmp: TBitmap;
begin
procedure TColourHistoryForm.AddColObj(c: TColourPickerObject); it := ColourTree.Items.Add(nil, c.Name);
it.Data := c;
var ColourTree.Selected := it;
it: TListItem;
begin bmp:=TBitmap.Create;
it := ColourList.Items.Add; bmp.SetSize(16,16);
it.Data := c; bmp.Canvas.Brush.Color:=c.Colour;
it.Caption:= c.Name; bmp.Canvas.Rectangle(0,0,16,16);
ColourList.Selected := it;
end; it.ImageIndex:= CHImages.Add(bmp,nil);
bmp.Free;
procedure TColourHistoryForm.DeleteSelected(Sender: TObject); end;
begin procedure TColourHistoryForm.DeleteSelected(Sender: TObject);
if (Assigned(ColourList.Selected)) then
begin var
TColourPickerObject(ColourList.Selected.Data).Free; i:integer;
ColourList.Selected.Delete;
end; begin
end; if (Assigned(ColourTree.Selected)) then
begin
procedure TColourHistoryForm.ChangeViewData(Sender: TObject; Item: TListItem; if Assigned(ColourTree.Selected.Data) then
Selected: Boolean); TColourPickerObject(ColourTree.Selected.Data).Free;
var i:=ColourTree.Selected.ImageIndex;
r,g,b:integer; ColourTree.Selected.ImageIndex:=0;
begin CHImages.Delete(i);
if not Assigned(Item) then
exit; ColourTree.Selected.Delete;
if not Item.Selected then end;
exit; end;
{ This only occurs when we have manually added an item with the Form Editor } procedure TColourHistoryForm.ColourTreeChange(Sender: TObject; Node: TTreeNode);
if not Assigned(Item.Data) then var
exit; r,g,b:integer;
begin
colour_conv.ColorToRGB(TColourPickerObject(Item.Data).Colour, r, g, b); if not Assigned(Node) then
exit;
{ Change Form Text / Values } if not Node.Selected then
ColourValue.Caption := IntToStr(TColourPickerObject(Item.Data).Colour); exit;
CoordValue.Caption := 'Coords: ' + IntToStr(TColourPickerObject(Item.Data).Pos.X) +
', ' + IntToStr(TColourPickerObject(Item.Data).Pos.Y); { This only occurs when we have manually added an item with the Form Editor }
SelectionName.Text := TColourPickerObject(Item.Data).Name; if not Assigned(Node.Data) then
exit;
CH_RGB_Label.Caption:=Format('RGB:%d,%d,%d', [r,g,b]);
colour_conv.ColorToRGB(TColourPickerObject(Node.Data).Colour, r, g, b);
{ Draw the Image }
ColourImage.Canvas.Brush.Color := TColourPickerObject(Item.Data).Colour; { Change Form Text / Values }
ColourImage.Canvas.Rectangle(0,0,ColourImage.Width, ColourImage.Height); ColourValue.Caption := IntToStr(TColourPickerObject(Node.Data).Colour);
CoordValue.Caption := 'Coords: ' + IntToStr(TColourPickerObject(Node.Data).Pos.X) +
if Self.Visible then ', ' + IntToStr(TColourPickerObject(Node.Data).Pos.Y);
begin SelectionName.Text := TColourPickerObject(Node.Data).Name;
try
SelectionName.SetFocus; CH_RGB_Label.Caption:=Format('RGB:%d,%d,%d', [r,g,b]);
finally
end; { Draw the Image }
end; ColourImage.Canvas.Brush.Color := TColourPickerObject(Node.Data).Colour;
end; ColourImage.Canvas.Rectangle(0,0,ColourImage.Width, ColourImage.Height);
procedure TColourHistoryForm.ColourListAdvancedCustomDrawSubItem( if Self.Visible then
Sender: TCustomListView; Item: TListItem; SubItem: Integer; begin
State: TCustomDrawState; Stage: TCustomDrawStage; var DefaultDraw: Boolean); try
begin SelectionName.SetFocus;
if SubItem = 0 then finally
ColourList.Canvas.Brush.Color := clWhite end;
else end;
ColourList.Canvas.Brush.Color := TColourPickerObject(Item.Data).Colour; end;
end;
procedure TColourHistoryForm.ChangeName(Sender: TObject);
procedure TColourHistoryForm.ChangeName(Sender: TObject); begin
begin if not Assigned(ColourTree.Selected) then
if not Assigned(ColourList.Selected) then begin
begin WriteLn('We double clicked but have nothing Selected?');
WriteLn('We double clicked but have nothing Selected?'); exit;
exit; end;
end; ColourTree.Selected.Text := SelectionName.Text;
ColourList.Selected.Caption := SelectionName.Text; TColourPickerObject(ColourTree.Selected.Data).Name := SelectionName.Text;
TColourPickerObject(ColourList.Selected.Data).Name := SelectionName.Text; end;
end;
constructor TColourHistoryForm.Create(TheOwner: TComponent);
constructor TColourHistoryForm.Create(TheOwner: TComponent); begin
begin inherited Create(TheOwner);
inherited Create(TheOwner);
PickNewColourButton.OnClick:= @Form1.ButtonPickClick;
Colour_Count := 0; end;
PickNewColourButton.OnClick:= @Form1.ButtonPickClick;
end; destructor TColourHistoryForm.Destroy;
begin
destructor TColourHistoryForm.Destroy; PickNewColourButton.OnClick := nil;
begin
PickNewColourButton.OnClick := nil; inherited Destroy;
Colour_Count := 0; end;
inherited Destroy; procedure TColourHistoryForm.OkButtonClick(Sender: TObject);
end; begin
Self.Close;
procedure TColourHistoryForm.FormCreate(Sender: TObject); end;
begin
ColourList.Column[0].Width:= 100; procedure TColourHistoryForm.SelectionNameKeyPress(Sender: TObject;
ColourList.Column[1].Width:= 500; var Key: char);
end; begin
if key = #13 then
procedure TColourHistoryForm.OkButtonClick(Sender: TObject); begin
begin key := #0;
Self.close; Self.close;
end; end;
end;
procedure TColourHistoryForm.SelectionNameKeyPress(Sender: TObject;
var Key: char); procedure TColourHistoryForm.SetCHShowMenu(Sender: TObject);
begin begin
if key = #13 then Form1.MenuItemColourHistory.Checked := True;
begin end;
key := #0;
Self.close; procedure TColourHistoryForm.UnSetCHShowMenu(Sender: TObject);
end; begin
end; Form1.MenuItemColourHistory.Checked := False;
end;
procedure TColourHistoryForm.SetCHShowMenu(Sender: TObject);
begin initialization
Form1.MenuItemColourHistory.Checked := True; {$I colourhistory.lrs}
end;
end.
procedure TColourHistoryForm.UnSetCHShowMenu(Sender: TObject);
begin
Form1.MenuItemColourHistory.Checked := False;
end;
initialization
{$I colourhistory.lrs}
end.

View File

@ -10,7 +10,7 @@
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="Mufasa Stand Alone"/> <Title Value="Mufasa Stand Alone"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="10"/> <ActiveEditorIndexAtStart Value="6"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <ProjectVersion Value=""/>
@ -167,8 +167,8 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="TestUnit"/> <UnitName Value="TestUnit"/>
<CursorPos X="1" Y="403"/> <CursorPos X="57" Y="15"/>
<TopLine Value="380"/> <TopLine Value="1"/>
<EditorIndex Value="5"/> <EditorIndex Value="5"/>
<UsageCount Value="202"/> <UsageCount Value="202"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -224,8 +224,8 @@
<Filename Value="../../Units/MMLCore/client.pas"/> <Filename Value="../../Units/MMLCore/client.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="Client"/> <UnitName Value="Client"/>
<CursorPos X="107" Y="49"/> <CursorPos X="45" Y="14"/>
<TopLine Value="34"/> <TopLine Value="1"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -278,7 +278,7 @@
<CursorPos X="23" Y="8"/> <CursorPos X="23" Y="8"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="18"/> <EditorIndex Value="18"/>
<UsageCount Value="69"/> <UsageCount Value="71"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit31> </Unit31>
<Unit32> <Unit32>
@ -292,8 +292,8 @@
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="finder"/> <UnitName Value="finder"/>
<CursorPos X="25" Y="820"/> <CursorPos X="58" Y="23"/>
<TopLine Value="807"/> <TopLine Value="1"/>
<EditorIndex Value="8"/> <EditorIndex Value="8"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -810,7 +810,7 @@
<CursorPos X="33" Y="34"/> <CursorPos X="33" Y="34"/>
<TopLine Value="30"/> <TopLine Value="30"/>
<EditorIndex Value="17"/> <EditorIndex Value="17"/>
<UsageCount Value="28"/> <UsageCount Value="30"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit107> </Unit107>
<Unit108> <Unit108>
@ -875,7 +875,7 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ocr"/> <UnitName Value="ocr"/>
<CursorPos X="105" Y="105"/> <CursorPos X="105" Y="105"/>
<TopLine Value="74"/> <TopLine Value="252"/>
<EditorIndex Value="9"/> <EditorIndex Value="9"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -1006,7 +1006,7 @@
<UnitName Value="web"/> <UnitName Value="web"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="185"/> <UsageCount Value="188"/>
</Unit136> </Unit136>
<Unit137> <Unit137>
<Filename Value="../../../lazarus/lcl/lazhelphtml.pas"/> <Filename Value="../../../lazarus/lcl/lazhelphtml.pas"/>
@ -1205,7 +1205,7 @@
<UnitName Value="framescript"/> <UnitName Value="framescript"/>
<CursorPos X="106" Y="190"/> <CursorPos X="106" Y="190"/>
<TopLine Value="180"/> <TopLine Value="180"/>
<UsageCount Value="178"/> <UsageCount Value="181"/>
</Unit161> </Unit161>
<Unit162> <Unit162>
<Filename Value="framesynedit.lrs"/> <Filename Value="framesynedit.lrs"/>
@ -1517,10 +1517,10 @@
<ComponentName Value="ColourHistoryForm"/> <ComponentName Value="ColourHistoryForm"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="colourhistory"/> <UnitName Value="colourhistory"/>
<CursorPos X="72" Y="21"/> <CursorPos X="73" Y="197"/>
<TopLine Value="13"/> <TopLine Value="176"/>
<EditorIndex Value="6"/> <EditorIndex Value="6"/>
<UsageCount Value="115"/> <UsageCount Value="118"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit208> </Unit208>
<Unit209> <Unit209>
@ -1771,7 +1771,7 @@
<UnitName Value="about"/> <UnitName Value="about"/>
<CursorPos X="44" Y="21"/> <CursorPos X="44" Y="21"/>
<TopLine Value="4"/> <TopLine Value="4"/>
<UsageCount Value="78"/> <UsageCount Value="81"/>
</Unit245> </Unit245>
<Unit246> <Unit246>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/file.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/file.inc"/>
@ -1785,7 +1785,7 @@
<UnitName Value="internets"/> <UnitName Value="internets"/>
<CursorPos X="87" Y="3"/> <CursorPos X="87" Y="3"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="72"/> <UsageCount Value="75"/>
</Unit247> </Unit247>
<Unit248> <Unit248>
<Filename Value="debugimageform.pas"/> <Filename Value="debugimageform.pas"/>
@ -1794,7 +1794,7 @@
<UnitName Value="debugimageform"/> <UnitName Value="debugimageform"/>
<CursorPos X="20" Y="1"/> <CursorPos X="20" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="59"/> <UsageCount Value="62"/>
</Unit248> </Unit248>
<Unit249> <Unit249>
<Filename Value="debugimage.pas"/> <Filename Value="debugimage.pas"/>
@ -1805,7 +1805,7 @@
<CursorPos X="87" Y="39"/> <CursorPos X="87" Y="39"/>
<TopLine Value="20"/> <TopLine Value="20"/>
<EditorIndex Value="7"/> <EditorIndex Value="7"/>
<UsageCount Value="58"/> <UsageCount Value="61"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit249> </Unit249>
<Unit250> <Unit250>
@ -1877,10 +1877,10 @@
<Unit260> <Unit260>
<Filename Value="../../Units/MMLCore/ocrutil.pas"/> <Filename Value="../../Units/MMLCore/ocrutil.pas"/>
<UnitName Value="ocrutil"/> <UnitName Value="ocrutil"/>
<CursorPos X="60" Y="594"/> <CursorPos X="66" Y="17"/>
<TopLine Value="573"/> <TopLine Value="13"/>
<EditorIndex Value="10"/> <EditorIndex Value="10"/>
<UsageCount Value="16"/> <UsageCount Value="18"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit260> </Unit260>
<Unit261> <Unit261>
@ -1909,130 +1909,130 @@
<CursorPos X="37" Y="3116"/> <CursorPos X="37" Y="3116"/>
<TopLine Value="3105"/> <TopLine Value="3105"/>
<EditorIndex Value="3"/> <EditorIndex Value="3"/>
<UsageCount Value="11"/> <UsageCount Value="13"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit264> </Unit264>
</Units> </Units>
<JumpHistory Count="30" HistoryIndex="29"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="99" Column="17" TopLine="90"/> <Caret Line="65" Column="33" TopLine="45"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="110" Column="9" TopLine="90"/> <Caret Line="27" Column="37" TopLine="1"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="97" Column="9" TopLine="91"/> <Caret Line="65" Column="33" TopLine="45"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="111" Column="24" TopLine="91"/> <Caret Line="66" Column="33" TopLine="45"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="130" Column="60" TopLine="103"/> <Caret Line="137" Column="47" TopLine="110"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="../../Units/MMLCore/ocrutil.pas"/>
<Caret Line="61" Column="23" TopLine="49"/>
</Position6>
<Position7>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="177" Column="3" TopLine="158"/>
</Position7>
<Position8>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="241" Column="38" TopLine="218"/>
</Position8>
<Position9>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="229" Column="60" TopLine="146"/>
</Position9>
<Position10>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="241" Column="41" TopLine="161"/>
</Position10>
<Position11>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="200" Column="34" TopLine="178"/>
</Position11>
<Position12>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="263" Column="49" TopLine="242"/>
</Position12>
<Position13>
<Filename Value="../../Units/MMLCore/ocrutil.pas"/>
<Caret Line="598" Column="1" TopLine="573"/>
</Position13>
<Position14>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="301" Column="126" TopLine="278"/>
</Position14>
<Position15>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="270" Column="56" TopLine="242"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="97" Column="22" TopLine="73"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="99" Column="30" TopLine="73"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="117" Column="31" TopLine="97"/>
</Position18>
<Position19>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="102" Column="104" TopLine="85"/>
</Position19>
<Position20>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="101" Column="40" TopLine="87"/>
</Position20>
<Position21>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="339" Column="73" TopLine="314"/>
</Position21>
<Position22>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="83" Column="20" TopLine="74"/>
</Position22>
<Position23>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="65" Column="33" TopLine="45"/>
</Position23>
<Position24>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="27" Column="37" TopLine="1"/>
</Position24>
<Position25>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="65" Column="33" TopLine="45"/>
</Position25>
<Position26>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="66" Column="33" TopLine="45"/>
</Position26>
<Position27>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="137" Column="47" TopLine="110"/>
</Position27>
<Position28>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="81" Column="71" TopLine="62"/> <Caret Line="81" Column="71" TopLine="62"/>
</Position28> </Position6>
<Position29> <Position7>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="65" Column="33" TopLine="41"/> <Caret Line="65" Column="33" TopLine="41"/>
</Position29> </Position7>
<Position30> <Position8>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="66" Column="33" TopLine="41"/> <Caret Line="66" Column="33" TopLine="41"/>
</Position8>
<Position9>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="101" Column="5" TopLine="97"/>
</Position9>
<Position10>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="30" Column="28" TopLine="25"/>
</Position10>
<Position11>
<Filename Value="testunit.pas"/>
<Caret Line="401" Column="43" TopLine="380"/>
</Position11>
<Position12>
<Filename Value="colourhistory.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position12>
<Position13>
<Filename Value="colourhistory.pas"/>
<Caret Line="106" Column="29" TopLine="73"/>
</Position13>
<Position14>
<Filename Value="colourhistory.pas"/>
<Caret Line="105" Column="5" TopLine="85"/>
</Position14>
<Position15>
<Filename Value="colourhistory.pas"/>
<Caret Line="117" Column="13" TopLine="93"/>
</Position15>
<Position16>
<Filename Value="colourhistory.pas"/>
<Caret Line="39" Column="66" TopLine="169"/>
</Position16>
<Position17>
<Filename Value="colourhistory.pas"/>
<Caret Line="170" Column="19" TopLine="149"/>
</Position17>
<Position18>
<Filename Value="colourhistory.pas"/>
<Caret Line="176" Column="33" TopLine="150"/>
</Position18>
<Position19>
<Filename Value="colourhistory.pas"/>
<Caret Line="175" Column="27" TopLine="155"/>
</Position19>
<Position20>
<Filename Value="colourhistory.pas"/>
<Caret Line="194" Column="1" TopLine="177"/>
</Position20>
<Position21>
<Filename Value="colourhistory.pas"/>
<Caret Line="120" Column="77" TopLine="100"/>
</Position21>
<Position22>
<Filename Value="colourhistory.pas"/>
<Caret Line="35" Column="29" TopLine="23"/>
</Position22>
<Position23>
<Filename Value="colourhistory.pas"/>
<Caret Line="192" Column="8" TopLine="152"/>
</Position23>
<Position24>
<Filename Value="colourhistory.pas"/>
<Caret Line="117" Column="3" TopLine="101"/>
</Position24>
<Position25>
<Filename Value="colourhistory.pas"/>
<Caret Line="35" Column="50" TopLine="27"/>
</Position25>
<Position26>
<Filename Value="colourhistory.pas"/>
<Caret Line="47" Column="36" TopLine="27"/>
</Position26>
<Position27>
<Filename Value="colourhistory.pas"/>
<Caret Line="26" Column="13" TopLine="12"/>
</Position27>
<Position28>
<Filename Value="colourhistory.pas"/>
<Caret Line="107" Column="19" TopLine="83"/>
</Position28>
<Position29>
<Filename Value="colourhistory.pas"/>
<Caret Line="46" Column="10" TopLine="13"/>
</Position29>
<Position30>
<Filename Value="colourhistory.pas"/>
<Caret Line="177" Column="1" TopLine="158"/>
</Position30> </Position30>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>

View File

@ -98,8 +98,8 @@ type
implementation implementation
uses uses
colour_conv,// For RGBToColor, etc.
Client, // For the Client Casts. Client, // For the Client Casts.
colour_conv, // For RGBToColor, etc.
math, //min/max math, //min/max
dtmutil dtmutil
; ;