Simba Code:
program new;
Const
FONTS = 7;
var
DsgnForm:TForm;
TLabel0,TLabel1,TLabel2,TLabel5,TLabel9,TLabel10,TLabel11,TLabel12,TLabel13,TLabel14,TLabel15,TLabel16,TLabel25,TLabel26,TLabel28,TLabel30: TLabel;
username,password,Color,Hue,Sat,Tol,Uptext_1,Uptext_2,Uptext_3,Food_col,fooduptext: TEdit;
TImage17: TImage;
TListBox6,TListBox7: TListBox;
Button: TButton;
TComboBox8,Food: TComboBox;
bmps0: TMufasaBitmap;
bmp0: TBitmap;
const
default = 'Comic Sans MS';
procedure YourClickProcedure(Sender: TObject);
begin
ShowMessage('click');
end;
var
FormFood, FormUser, FormHue: string;
// username,password,Color,Hue,Sat,Tol,Uptext_1,Uptext_2,Uptext_3,Food_col,fooduptext: TEdit;
procedure SaveFormInfo(Sender: TObject);
begin
FormUser := username.TEXT
FormHue := Hue.TEXT;
FormFood := Food.TEXT; // Saving the text, before we close the form
DsgnForm.CLOSE;
end;
procedure InitForm;
begin
//DsgnForm\\
DsgnForm:=TForm.Create(nil);
with DsgnForm do
begin
Caption:='DsgnForm';
Position := poMainFormCenter;
Left:=664;
Top:=440;
Width:=400;
Height:=300;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel0\\
TLabel0:=TLabel.Create(DsgnForm);
with TLabel0 do
begin
Parent:=DsgnForm;
Caption:='Login settings';
Left:=43;
Top:=13;
Width:=67;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel1\\
TLabel1:=TLabel.Create(DsgnForm);
with TLabel1 do
begin
Parent:=DsgnForm;
Caption:='Username';
Left:=14;
Top:=40;
Width:=49;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel2\\
TLabel2:=TLabel.Create(DsgnForm);
with TLabel2 do
begin
Parent:=DsgnForm;
Caption:='Password';
Left:=14;
Top:=71;
Width:=47;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel5\\
TLabel5:=TLabel.Create(DsgnForm);
with TLabel5 do
begin
Parent:=DsgnForm;
Caption:='Monster settings';
Left:=133;
Top:=120;
Width:=81;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel9\\
TLabel9:=TLabel.Create(DsgnForm);
with TLabel9 do
begin
Parent:=DsgnForm;
Caption:='Monster';
Left:=19;
Top:=140;
Width:=40;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel10\\
TLabel10:=TLabel.Create(DsgnForm);
with TLabel10 do
begin
Parent:=DsgnForm;
Caption:='Custom Color';
Left:=18;
Top:=174;
Width:=65;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel11\\
TLabel11:=TLabel.Create(DsgnForm);
with TLabel11 do
begin
Parent:=DsgnForm;
Caption:='Custom Hue';
Left:=19;
Top:=202;
Width:=59;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel12\\
TLabel12:=TLabel.Create(DsgnForm);
with TLabel12 do
begin
Parent:=DsgnForm;
Caption:='Custom Sat';
Left:=19;
Top:=229;
Width:=56;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel13\\
TLabel13:=TLabel.Create(DsgnForm);
with TLabel13 do
begin
Parent:=DsgnForm;
Caption:='Custom Tolerance';
Left:=20;
Top:=253;
Width:=87;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel14\\
TLabel14:=TLabel.Create(DsgnForm);
with TLabel14 do
begin
Parent:=DsgnForm;
Caption:='Uptext_1';
Left:=181;
Top:=175;
Width:=46;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel15\\
TLabel15:=TLabel.Create(DsgnForm);
with TLabel15 do
begin
Parent:=DsgnForm;
Caption:='Uptext_2';
Left:=182;
Top:=202;
Width:=46;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel16\\
TLabel16:=TLabel.Create(DsgnForm);
with TLabel16 do
begin
Parent:=DsgnForm;
Caption:='Uptext_3';
Left:=183;
Top:=232;
Width:=46;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel25\\
TLabel25:=TLabel.Create(DsgnForm);
with TLabel25 do
begin
Parent:=DsgnForm;
Caption:='Food Settings';
Left:=241;
Top:=14;
Width:=67;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel26\\
TLabel26:=TLabel.Create(DsgnForm);
with TLabel26 do
begin
Parent:=DsgnForm;
Caption:='Food';
Left:=159;
Top:=42;
Width:=25;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel28\\
TLabel28:=TLabel.Create(DsgnForm);
with TLabel28 do
begin
Parent:=DsgnForm;
Caption:='Custom Color';
Left:=153;
Top:=75;
Width:=65;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TLabel30\\
TLabel30:=TLabel.Create(DsgnForm);
with TLabel30 do
begin
Parent:=DsgnForm;
Caption:='Food Uptext';
Left:=154;
Top:=101;
Width:=61;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//username\\
username:=TEdit.Create(DsgnForm);
with username do
begin
Parent:=DsgnForm;
Text:='';
Left:=69;
Top:=38;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//username.MaxLength:=x;
//username.PasswordChar:=*;
end;
//password\\
password:=TEdit.Create(DsgnForm);
with password do
begin
Parent:=DsgnForm;
Text:='';
Left:=69;
Top:=69;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//password.MaxLength:=x;
//password.PasswordChar:=*;
end;
//Color\\
Color:=TEdit.Create(DsgnForm);
with Color do
begin
Parent:=DsgnForm;
Text:='';
Left:=86;
Top:=171;
Width:=91;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//Color.MaxLength:=x;
//Color.PasswordChar:=*;
end;
//Hue\\
Hue:=TEdit.Create(DsgnForm);
with Hue do
begin
Parent:=DsgnForm;
Text:='';
Left:=85;
Top:=200;
Width:=45;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//Hue.MaxLength:=x;
//Hue.PasswordChar:=*;
end;
//Sat\\
Sat:=TEdit.Create(DsgnForm);
with Sat do
begin
Parent:=DsgnForm;
Text:='';
Left:=86;
Top:=228;
Width:=46;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//Sat.MaxLength:=x;
//Sat.PasswordChar:=*;
end;
//Tol\\
Tol:=TEdit.Create(DsgnForm);
with Tol do
begin
Parent:=DsgnForm;
Text:='';
Left:=111;
Top:=251;
Width:=43;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//Tol.MaxLength:=x;
//Tol.PasswordChar:=*;
end;
//Uptext_1\\
Uptext_1:=TEdit.Create(DsgnForm);
with Uptext_1 do
begin
Parent:=DsgnForm;
Text:='';
Left:=232;
Top:=175;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//Uptext_1.MaxLength:=x;
//Uptext_1.PasswordChar:=*;
end;
//Uptext_2\\
Uptext_2:=TEdit.Create(DsgnForm);
with Uptext_2 do
begin
Parent:=DsgnForm;
Text:='';
Left:=233;
Top:=202;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//Uptext_2.MaxLength:=x;
//Uptext_2.PasswordChar:=*;
end;
//Uptext_3\\
Uptext_3:=TEdit.Create(DsgnForm);
with Uptext_3 do
begin
Parent:=DsgnForm;
Text:='';
Left:=233;
Top:=231;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//Uptext_3.MaxLength:=x;
//Uptext_3.PasswordChar:=*;
end;
//Food_col\\
Food_col:=TEdit.Create(DsgnForm);
with Food_col do
begin
Parent:=DsgnForm;
Text:='';
Left:=218;
Top:=71;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//Food_col.MaxLength:=x;
//Food_col.PasswordChar:=*;
end;
//fooduptext\\
fooduptext:=TEdit.Create(DsgnForm);
with fooduptext do
begin
Parent:=DsgnForm;
Text:='';
Left:=220;
Top:=99;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
//fooduptext.MaxLength:=x;
//fooduptext.PasswordChar:=*;
end;
//TListBox6\\
TListBox6:=TListBox.Create(DsgnForm);
with TListBox6 do
begin
Parent:=DsgnForm;
Left:=508;
Top:=201;
Width:=0;
Height:=10;
//add your items here
Items.Add('YourItem');
//End items
OnClick:=@YourClickProcedure;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TListBox7\\
TListBox7:=TListBox.Create(DsgnForm);
with TListBox7 do
begin
Parent:=DsgnForm;
Left:=329;
Top:=429;
Width:=100;
Height:=80;
//add your items here
Items.Add('YourItem');
//End items
OnClick:=@YourClickProcedure;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//TComboBox8\\
TComboBox8:=TComboBox.Create(DsgnForm);
with TComboBox8 do
begin
Parent:=DsgnForm;
Left:=72;
Top:=136;
Width:=100;
Height:=21;
//add your items here
Items.Add('YourItem');
//End items
OnClick:=@YourClickProcedure;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
//Food\\
Food:=TComboBox.Create(DsgnForm);
with Food do
begin
Parent:=DsgnForm;
Left:=187;
Top:=39;
Width:=100;
Height:=21;
//add your items here
Items.Add('YourItem');
Items.Add('Another item'); // This is how you add items to the combobox ;)
//End items
Text := Items[0]; // Set the start value to the first string in Items
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=FONTS;
end;
Button := TButton.Create(DsgnForm); // A button to click when the user is finished
with Button do // with filling in the form
begin
Left := 180;
Top := 260;
Width := 120;
Height := 30;
CAPTION := 'Save';
ONCLICK := @SaveFormInfo;
Parent := DsgnForm;
end;
DsgnForm.SHOWMODAL;
DsgnForm.Free; // Free the form, should always be used
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure TryStuff;
begin
SafeInitForm;
writeln('Saved username: ' + FormUser);
writeln('Saved Hue: ' + FormHue);
writeln('Saved food: ' + FormFood);
end;
begin
TryStuff;
end.