Initial commit of code.

Code from March 3rd and 4th of 2005.
This commit is contained in:
James Skemp 2013-03-03 10:17:19 -06:00
parent 9ade1605cc
commit f022991134
8 changed files with 620 additions and 0 deletions

35
Project1.cfg Normal file
View File

@ -0,0 +1,35 @@
-$A8
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-LE"c:\program files\borland\delphi6\Projects\Bpl"
-LN"c:\program files\borland\delphi6\Projects\Bpl"

87
Project1.dof Normal file
View File

@ -0,0 +1,87 @@
[FileVersion]
Version=6.0
[Compiler]
A=8
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=
[Version Info]
IncludeVerInfo=1
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=StrivingLife.net
FileDescription=Colours4Web - Delphi 6 version
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=Colours4Web
ProductVersion=1.0.0.0
Comments=

14
Project1.dpr Normal file
View File

@ -0,0 +1,14 @@
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {FormMain};
{$R *.res}
begin
Application.Initialize;
Application.Title := 'Colours4Web';
Application.CreateForm(TFormMain, FormMain);
Application.Run;
end.

BIN
Project1.res Normal file

Binary file not shown.

BIN
Unit1.dcu Normal file

Binary file not shown.

BIN
Unit1.ddp Normal file

Binary file not shown.

252
Unit1.dfm Normal file
View File

@ -0,0 +1,252 @@
object FormMain: TFormMain
Left = 650
Top = 147
Width = 345
Height = 343
HorzScrollBar.Visible = False
VertScrollBar.Visible = False
BorderIcons = [biSystemMenu]
Caption = 'Colours4Web'
Color = clMenu
Constraints.MaxHeight = 500
Constraints.MaxWidth = 345
Constraints.MinHeight = 167
Constraints.MinWidth = 345
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
KeyPreview = True
OldCreateOrder = False
Position = poDefault
OnCreate = FormCreate
OnKeyPress = FormKeyPress
PixelsPerInch = 96
TextHeight = 13
object LabelRed: TLabel
Left = 8
Top = 14
Width = 73
Height = 13
Alignment = taCenter
AutoSize = False
Caption = 'Red'
end
object LabelGreen: TLabel
Left = 88
Top = 14
Width = 73
Height = 13
Alignment = taCenter
AutoSize = False
Caption = 'Green'
end
object LabelBlue: TLabel
Left = 168
Top = 14
Width = 73
Height = 13
Alignment = taCenter
AutoSize = False
Caption = 'Blue'
end
object ScrollBarRed: TScrollBar
Left = 8
Top = 32
Width = 73
Height = 13
Max = 5
PageSize = 0
TabOrder = 0
OnChange = ScrollBarRedChange
end
object EditRed: TEdit
Left = 8
Top = 112
Width = 73
Height = 21
TabStop = False
MaxLength = 3
ReadOnly = True
TabOrder = 1
Text = '00'
end
object ScrollBarGreen: TScrollBar
Left = 88
Top = 32
Width = 73
Height = 13
Max = 5
PageSize = 0
TabOrder = 2
OnChange = ScrollBarGreenChange
end
object EditGreen: TEdit
Left = 88
Top = 112
Width = 73
Height = 21
TabStop = False
ReadOnly = True
TabOrder = 3
Text = '00'
end
object ScrollBarBlue: TScrollBar
Left = 168
Top = 32
Width = 73
Height = 13
Max = 5
PageSize = 0
TabOrder = 4
OnChange = ScrollBarBlueChange
end
object EditBlue: TEdit
Left = 168
Top = 112
Width = 73
Height = 21
TabStop = False
ReadOnly = True
TabOrder = 5
Text = '00'
end
object EditRGB: TEdit
Left = 256
Top = 112
Width = 73
Height = 21
TabStop = False
ReadOnly = True
TabOrder = 6
Text = '#000000'
end
object PanelRed: TPanel
Left = 8
Top = 48
Width = 73
Height = 57
BevelOuter = bvLowered
Color = clBlack
TabOrder = 7
end
object PanelGreen: TPanel
Left = 88
Top = 48
Width = 73
Height = 57
BevelOuter = bvLowered
Color = clBlack
TabOrder = 8
end
object PanelBlue: TPanel
Left = 168
Top = 48
Width = 73
Height = 57
BevelOuter = bvLowered
Color = clBlack
TabOrder = 9
end
object PanelRGB: TPanel
Left = 256
Top = 48
Width = 73
Height = 57
BevelOuter = bvLowered
Color = clBlack
TabOrder = 10
end
object ButtonRandomize: TButton
Left = 256
Top = 136
Width = 75
Height = 20
Caption = 'Randomize'
TabOrder = 11
OnClick = ButtonRandomizeClick
end
object GroupBoxAbout: TGroupBox
Left = 2
Top = 216
Width = 334
Height = 97
Caption = 'About'
TabOrder = 12
object ButtonSite: TButton
Left = 7
Top = 69
Width = 147
Height = 20
Caption = 'Visit StrivingLife.net'
TabOrder = 0
OnClick = ButtonSiteClick
end
object ButtonEmail: TButton
Left = 176
Top = 69
Width = 151
Height = 20
Caption = 'Email the creator'
TabOrder = 1
OnClick = ButtonSiteClick
end
object MemoAbout: TMemo
Left = 8
Top = 16
Width = 321
Height = 49
Enabled = False
Lines.Strings = (
'Memo1')
TabOrder = 2
end
end
object ButtonRandomColour: TButton
Left = 280
Top = 24
Width = 25
Height = 17
Caption = 'ButtonRandomColour'
TabOrder = 13
TabStop = False
Visible = False
OnClick = ButtonRandomColourClick
end
object GroupBoxSaved: TGroupBox
Left = 2
Top = 160
Width = 333
Height = 57
Caption = 'Saved'
TabOrder = 14
object MemoSaved: TMemo
Left = 8
Top = 16
Width = 321
Height = 33
Lines.Strings = (
'MemoSaved')
TabOrder = 0
end
end
object ButtonRestart: TButton
Left = 168
Top = 136
Width = 75
Height = 20
Caption = 'Restart/Clear'
TabOrder = 15
OnClick = ButtonRestartClick
end
object ButtonSave: TButton
Left = 8
Top = 136
Width = 75
Height = 20
Caption = 'Save'
TabOrder = 16
OnClick = ButtonSaveClick
end
end

232
Unit1.pas Normal file
View File

@ -0,0 +1,232 @@
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ShellAPI;
type
TFormMain = class(TForm)
ScrollBarRed: TScrollBar;
EditRed: TEdit;
ScrollBarGreen: TScrollBar;
EditGreen: TEdit;
ScrollBarBlue: TScrollBar;
EditBlue: TEdit;
LabelRed: TLabel;
LabelGreen: TLabel;
LabelBlue: TLabel;
EditRGB: TEdit;
PanelRed: TPanel;
PanelGreen: TPanel;
PanelBlue: TPanel;
PanelRGB: TPanel;
ButtonRandomize: TButton;
GroupBoxAbout: TGroupBox;
ButtonSite: TButton;
ButtonEmail: TButton;
MemoAbout: TMemo;
ButtonRandomColour: TButton;
GroupBoxSaved: TGroupBox;
MemoSaved: TMemo;
ButtonRestart: TButton;
ButtonSave: TButton;
procedure ScrollBarRedChange(Sender: TObject);
procedure ScrollBarGreenChange(Sender: TObject);
procedure ScrollBarBlueChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ButtonRandomizeClick(Sender: TObject);
procedure ButtonSiteClick(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure ButtonRandomColourClick(Sender: TObject);
procedure ButtonRestartClick(Sender: TObject);
procedure ButtonSaveClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormMain: TFormMain;
s : string;
t : string;
i : integer;
j : integer;
r : integer;
implementation
{$R *.dfm}
procedure Dec2Hex(s: string);
begin
t := '';
if s = '0' then t := '00';
if s = '51' then t := '33';
if s = '102' then t := '66';
if s = '153' then t := '99';
if s = '204' then t := 'CC';
if s = '255' then t := 'FF';
end;
procedure TFormMain.ScrollBarRedChange(Sender: TObject);
begin
s := '';
i := ScrollBarRed.Position * 51;
Str(i,s);
Dec2Hex(s);
EditRed.Text := t;
EditRGB.Text := '#' + EditRed.Text + EditGreen.Text + EditBlue.Text;
PanelRed.Color := StringToColor('$000000' + EditRed.Text);
PanelRGB.Color := StringToColor('$00' + EditBlue.Text + EditGreen.Text + EditRed.Text);
end;
procedure TFormMain.ScrollBarGreenChange(Sender: TObject);
begin
s := '';
i := ScrollBarGreen.Position * 51;
Str(i,s);
Dec2Hex(s);
EditGreen.Text := t;
EditRGB.Text := '#' + EditRed.Text + EditGreen.Text + EditBlue.Text;
PanelGreen.Color := StringToColor('$0000' + EditGreen.Text + '00');
PanelRGB.Color := StringToColor('$00' + EditBlue.Text + EditGreen.Text + EditRed.Text);
end;
procedure TFormMain.ScrollBarBlueChange(Sender: TObject);
begin
s := '';
i := ScrollBarBlue.Position * 51;
Str(i,s);
Dec2Hex(s);
EditBlue.Text := t;
EditRGB.Text := '#' + EditRed.Text + EditGreen.Text + EditBlue.Text;
PanelBlue.Color := StringToColor('$00' + EditBlue.Text + '0000');
PanelRGB.Color := StringToColor('$00' + EditBlue.Text + EditGreen.Text + EditRed.Text);
end;
procedure TFormMain.FormCreate(Sender: TObject);
begin
FormMain.ClientHeight := 316;
FormMain.ClientWidth := 337;
MemoSaved.Text := '';
MemoAbout.Text := 'Colours4Web - James Skemp' + #13#10 + 'a - Random Red | s - Random Green | d - Random Blue' + #13#10 + 'f - Random all | r - Restart/Clear | e - Save';
end;
procedure TFormMain.ButtonRandomizeClick(Sender: TObject);
begin
Randomize;
j := (Random(6));
ScrollBarRed.Position := j;
i := (j * 51);
Str(i,s);
Dec2Hex(s);
EditRed.Text := t;
j := (Random(6));
ScrollBarGreen.Position := j;
i := (j * 51);
Str(i,s);
Dec2Hex(s);
EditGreen.Text := t;
j := (Random(6));
ScrollBarBlue.Position := j;
i := (j * 51);
Str(i,s);
Dec2Hex(s);
EditBlue.Text := t;
EditRGB.Text := '#' + EditRed.Text + EditGreen.Text + EditBlue.Text;
PanelRed.Color := StringToColor('$000000' + EditRed.Text);
PanelGreen.Color := StringToColor('$0000' + EditGreen.Text + '00');
PanelBlue.Color := StringToColor('$00' + EditBlue.Text + '0000');
PanelRGB.Color := StringToColor('$00' + EditBlue.Text + EditGreen.Text + EditRed.Text);
end;
procedure TFormMain.ButtonSiteClick(Sender: TObject);
begin
ShellExecute(0,'open','mailto:homeofjrs@eml.cc','','',SW_SHOWNORMAL);
end;
procedure TFormMain.FormKeyPress(Sender: TObject; var Key: Char);
begin
If key = 'a' Then
begin
r := 1;
ButtonRandomColourClick(FormMain);
end;
If key = 's' Then
begin
r := 2;
ButtonRandomColourClick(FormMain);
end;
If key = 'd' Then
begin
r := 3;
ButtonRandomColourClick(FormMain);
end;
If Key = 'f' Then ButtonRandomizeClick(FormMain);
If Key = 'r' Then ButtonRestartClick(FormMain);
If Key = 'e' Then ButtonSaveClick(FormMain);
end;
procedure TFormMain.ButtonRandomColourClick(Sender: TObject);
begin
Randomize;
If r = 1 then
begin
j := (Random(6));
ScrollBarRed.Position := j;
i := (j * 51);
Str(i,s);
Dec2Hex(s);
EditRed.Text := t;
PanelRed.Color := StringToColor('$000000' + EditRed.Text);
PanelRGB.Color := StringToColor('$00' + EditBlue.Text + EditGreen.Text + EditRed.Text);
end;
If r = 2 then
begin
j := (Random(6));
ScrollBarGreen.Position := j;
i := (j * 51);
Str(i,s);
Dec2Hex(s);
EditGreen.Text := t;
PanelGreen.Color := StringToColor('$0000' + EditGreen.Text + '00');
PanelRGB.Color := StringToColor('$00' + EditBlue.Text + EditGreen.Text + EditRed.Text);
end;
If r = 3 then
begin
j := (Random(6));
ScrollBarBlue.Position := j;
i := (j * 51);
Str(i,s);
Dec2Hex(s);
EditBlue.Text := t;
PanelBlue.Color := StringToColor('$00' + EditBlue.Text + '0000');
PanelRGB.Color := StringToColor('$00' + EditBlue.Text + EditGreen.Text + EditRed.Text);
end;
end;
procedure TFormMain.ButtonRestartClick(Sender: TObject);
begin
ScrollBarRed.Position := 0;
EditRed.Text := '00';
ScrollBarGreen.Position := 0;
EditGreen.Text := '00';
ScrollBarBlue.Position := 0;
EditBlue.Text := '00';
EditRGB.Text := '#' + EditRed.Text + EditGreen.Text + EditBlue.Text;
PanelRed.Color := StringToColor('$000000' + EditRed.Text);
PanelGreen.Color := StringToColor('$0000' + EditGreen.Text + '00');
PanelBlue.Color := StringToColor('$00' + EditBlue.Text + '0000');
PanelRGB.Color := StringToColor('$00' + EditBlue.Text + EditGreen.Text + EditRed.Text);
end;
procedure TFormMain.ButtonSaveClick(Sender: TObject);
begin
MemoSaved.Text := MemoSaved.Text + EditRGB.Text + ', '
end;
end.