MylesMadness
2010-06-25 20:34:32
Scar:
Simba:

Same exact code
Simba:
Same exact code
2010-06-25 20:34:32
Simba:
2010-06-25 20:43:50
2010-06-25 20:49:38
program New;
{.include srl/srl.scar}
var
EndInitForm : Boolean;
Form1 : TForm;
Label1 : TLabel;
Edit1, Edit2, Edit3, Edit4 : TEdit;
ComboBox1, ComboBox2 : TComboBox;
Button1, Button2, Button3, Button4 : TButton;
Memo1 : TMemo;
PageControl : TPageControl;
TabPages : array [0..1] of TTabSheet;
I:Integer;
Names:TStringArray;
procedure InitFormOnClose(Sender : TObject; var Action : TCloseAction);
begin
if (not(Form1.ModalResult = 1)) then
EndInitForm := True;
end;
{Edit1.text:='Username';
Edit2.text:='Password';
Edit3.text:='Nick';
Edit4.text:='Pin';
cbActive.Text}
Procedure Click(Sender : TObject);
var
Tmp, I:integer;
begin
Tmp:=StrToInt(Label1.Caption);
Case Sender of
Button1, Button2:
begin
If (Sender = Button1) and (Tmp = 0) then
exit;
If (Sender = Button2) and (GetArrayLength(Players) = TMP) then
Exit;
Players[Tmp].Name := Edit1.text;
Players[Tmp].Pass := Edit2.text;
Players[Tmp].Nick := Edit3.text;
Players[Tmp].Pin := Edit4.text;
Players[Tmp].Strings[0] := ComboBox1.text;
Players[Tmp].Strings[1] := ComboBox2.text;
Players[Tmp].Active := True;
If Sender = Button1 then
I:=Tmp-1
else
I:=Tmp+1;
Edit1.text:=Players[I].Name;
Edit2.text:=Players[I].Pass;
Edit3.text:=Players[I].Nick;
Edit4.text:=Players[I].Pin;
ComboBox1.text := Players[Tmp].Strings[0];
ComboBox2.text := Players[Tmp].Strings[1];
end;
Button3, Button4:
begin
If (Sender = Button4) and (GetArrayLength(Players) = 0) then
exit;
If Sender = Button3 then
begin
SetArrayLength(Players, GetArrayLength(Players) + 1);
Players[High(Players)].Name := 'Username';
Players[High(Players)].Pass := 'Password';
Players[High(Players)].Nick := 'Nick';
Players[High(Players)].Strings[0] := '';
Players[High(Players)].Strings[1] := '';
Players[High(Players)].Active := True;
end else
SetArrayLength(Players, GetArrayLength(Players) - 1);
I:=High(Players);
Edit1.text:=Players[I].Name;
Edit2.text:=Players[I].Pass;
Edit3.text:=Players[I].Nick;
Edit4.text:=Players[I].Pin;
ComboBox1.text := Players[Tmp].Strings[0];
ComboBox2.text := Players[Tmp].Strings[1];
end;
end;
end;
procedure InitForm;
begin
Form1 := CreateForm;
with Form1 do
begin
OnClose := @InitFormOnClose;
Width := 280;
Height := 310;
Caption := 'TBN';
end;
PageControl := TPageControl.Create(Form1);
With PageControl do
begin
Parent := Form1;
Align := alClient;
end;
SetArrayLength(Names, 2);
Names:=['Players', 'News'];
for i := 0 to 1 do
begin
TabPages[i] := TTabSheet.Create(Form1);
TabPages[i].Caption := Names[I];
TabPages[i].PageControl := PageControl;
end;
Label1 := TLabel.Create(Form1);
with Label1 do
begin
Parent := TabPages[0];
Left := 130;
Top := 208;
Width := 15;
Height := 13;
Alignment := taCenter;
Caption := '0';
end;
Edit1 := TEdit.Create(Form1);
with Edit1 do
begin
Parent := TabPages[0];
Left := 8;
Top := 8;
Width := 241;
Height := 21;
TabOrder := 0;
Text := 'Username';
end;
Edit2 := TEdit.Create(Form1);
with Edit2 do
begin
Parent := TabPages[0];
Left := 8;
Top := 40;
Width := 241;
Height := 21;
TabOrder := 1;
Text := 'Password';
end;
Edit3 := TEdit.Create(Form1);
with Edit3 do
begin
Parent := TabPages[0];
Left := 8;
Top := 72;
Width := 241;
Height := 21;
TabOrder := 2;
Text := 'Nickname';
end;
Edit4 := TEdit.Create(Form1);
with Edit4 do
begin
Parent := TabPages[0];
Left := 8;
Top := 104;
Width := 241;
Height := 21;
TabOrder := 3;
Text := 'Pin';
end;
ComboBox1 := TComboBox.Create(Form1);
with ComboBox1 do
begin
Parent := TabPages[0];
Left := 8;
Top := 136;
Width := 241;
Height := 21;
ItemHeight := 13;
TabOrder := 4;
Text := 'Location';
with Items do
begin
Add('Varock');
Add('Edgeville');
end;
end;
ComboBox2 := TComboBox.Create(Form1);
with ComboBox2 do
begin
Parent := TabPages[0];
Left := 8;
Top := 168;
Width := 241;
Height := 21;
ItemHeight := 13;
TabOrder := 5;
Text := 'Pick a location first!';
end;
Button1 := TButton.Create(Form1);
with Button1 do
begin
Parent := TabPages[0];
Left := 8;
Top := 192;
Width := 35;
Height := 49;
Caption := '<--';
TabOrder := 6;
Onclick := @Click;
end;
Button2 := TButton.Create(Form1);
with Button2 do
begin
Parent := TabPages[0];
Left := 215;
Top := 192;
Width := 35;
Height := 49;
Caption := '-->';
TabOrder := 7;
Onclick := @Click;
end;
Button3 := TButton.Create(Form1);
with Button3 do
begin
Parent := TabPages[0];
Left := 178;
Top := 192;
Width := 35;
Height := 49;
Caption := 'Add';
TabOrder := 6;
Onclick := @Click;
end;
Button4 := TButton.Create(Form1);
with Button4 do
begin
Parent := TabPages[0];
Left := 49;
Top := 192;
Width := 35;
Height := 49;
Caption := 'Del';
TabOrder := 7;
Onclick := @Click;
end;
Memo1 := TMemo.Create(Form1);
with Memo1 do
begin
Parent := TabPages[1];
Left := 0;
Top := 0;
Width := 280;
Height := 240;
end;
end;
procedure SafeInitForm;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowInitFormModal;
begin
Form1.ShowModal;
end;
procedure SafeShowInitFormModal;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowInitFormModal', v);
end;
procedure MainInitForm;
begin
try
SafeInitForm;
SafeShowInitFormModal;
finally
FreeForm(Form1);
except
WriteLn('An error seems to have occurred in: InitForm');
end;
end;
begin
ClearDebug;
MainInitForm;
if (EndInitForm) then
TerminateScript;
end.
2010-06-26 14:29:29
2010-06-26 14:40:01
2010-06-26 15:06:57
2010-06-26 15:06:58
2010-06-26 15:10:07
2010-06-26 15:14:02
2010-06-26 15:20:55
From: Wizzup?Hmm.. I forgot not all browsers show image sizes…
Zyt3x, I don't see how that proves anything. Most likely both handle forms a different way. It may look ``off'' with Simba, but different assumptions may have to be made when making the form.
Scar ^[INDENT][INDENT][INDENT][INDENT][INDENT]Simba ^[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT]Form1 := CreateForm;
with Form1 do
begin
OnClose := @InitFormOnClose;
Width := 280;
Height := 310;
Caption := 'TBN';
end;
2010-06-26 15:24:57
2010-06-26 15:42:43
2010-06-26 15:45:55
2010-06-26 21:07:53
2010-06-26 21:09:48
2010-06-26 21:18:23
2010-06-26 21:22:17
2010-06-26 21:31:03
2010-06-26 21:41:30
2010-06-26 21:42:03
2010-06-26 22:01:13
2010-06-26 22:04:13
2010-06-26 22:19:53
2010-06-26 22:26:36
2010-06-28 06:39:49
From: Dan Cardin
:O well i have problems then, but i still think that's the problem and think its a problem on Simba's part. clientWidth and clientHeight should be the ones that exclude the border else they'll have two things that do the same thing. In which case, if you want them to look the same, use client______.
2010-06-28 10:52:07
2010-06-29 02:41:35
From: Dan Cardin
nah, i was already updated; it was a problem on my own part, but even so, are you dev types considering fixing width and height?
2010-06-29 09:23:00
2010-06-29 12:22:45
From: Dan Cardin
Having two redundant attributes is a feature.
2010-06-29 12:26:23
2010-06-29 12:30:27
From: MylesMadness
So scar just never really did it right?
From: IceFire908
Different people think differently, it may seem off when working with photoshop and having specific dimensions that are different when porting to your form because you haven't compensated for the border widths (unless you use borderstyle := none)
It's a question of which one is proper in the real world, and I'm having trouble finding documentation of which one is considered 'proper' (including the borders in the width/height or not)
2010-06-29 13:09:30