Ok, so today I decided to l2m4k3f0rmz.
Got this far, and can't figure out why it won't work...
SCAR Code:
Program newbhackform;
var
NewbHack : TForm;
MyLabel : Array[1..4] of TLabel;
MyCBox : Array[1..6] of TComboBox;
Close : TButton;
i : Integer;
//thanks widget
procedure DragForm(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var sx,sy,tx,ty:integer;
begin
getmousepos(tx,ty);
repeat
getmousepos(sx,sy);
NewbHack.Top := NewbHack.Top - (ty-sy);
NewbHack.Left := NewbHack.Left - (tx-sx);
sleep(1);
tx := sx;
ty := sy;
until (not IsMouseButtonDown(True));
end;
procedure InitForm;
begin
NewbHack := CreateForm;
with NewbHack do
begin
Left := 0;
Top := 0;
Width := 500;
Height := 400;
Caption := 'Newb Hacker';
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
Visible := False;
PixelsPerInch := 96;
BorderStyle := bsNone;
OnMouseDown := @DragForm;
end;
for i := 1 to 3 do
begin
MyLabel[i] := TLabel.Create(NewbHack);
with MyLabel[i] do
begin
Parent := NewbHack;
Left := 32;
Top := 40 + (65 * (i - 1));
Width := 41;
Height := 13;
Alignment := taCenter;
end;
MyCBox[i] := TComboBox.Create(NewbHack);
with MyCBox[i] do
begin
Parent := NewbHack;
Left := 32;
Top := 64 + (65 * (i - 1));
Width := 150;
Height := 21;
ItemHeight := 13;
TabOrder := 8;
end;
end;
for i := 4 to 6 do
begin
MyCBox[i] := TComboBox.Create(NewbHack);
with MyCBox[i] do
begin
Parent := NewbHack;
Left := 32 + ((i - 1) * 50);
Top := MyLabel[3].Top + 65;
Width := 50;
Height := 21;
ItemHeight := 13;
TabOrder := 8;
end;
end;
MyLabel[1].Caption := 'Location';
MyLabel[2].Caption := 'Tree To Start';
MyLabel[3].Caption := 'Goal Level';
with MyLabel[4] do
begin
Parent := NewbHack;
Left := 32;
Top := 40 + (65 * 3);
Width := 41;
Height := 13;
Alignment := taCenter;
Caption := 'Levels To Switch';
end;
MyCBox[1].Text := 'Please Choose a Location';
MyCBox[2].Text := 'Please Choose a Tree';
MyCBox[3].Text := 'Please Choose a Level';
for i := 2 to 99 do
begin
MyCBox[3].Items.Add(IntToStr(i));
MyCBox[4].Items.Add(IntToStr(i));
MyCBox[5].Items.Add(IntToStr(i));
MyCBox[6].Items.Add(IntToStr(i));
end;
Close := TButton.Create(NewbHack);
with Close do
begin
Parent := NewbHack;
Left := 64;
Top := 340;
Width := 81;
Height := 25;
Caption := 'Close';
TabOrder := 16;
ModalResult := mrOk;
end;
end;
procedure SafeShow;
var
tva: TVariantArray;
begin
setarraylength(tva, 0);
ThreadSafeCall('InitForm', tva);
end;
procedure ShowFormModal;
begin
NewbHack.ShowModal;
end;
procedure SafeShowFormModal;
var
tva: TVariantArray;
begin
setarraylength(tva, 0);
ThreadSafeCall('ShowFormModal', tva);
end;
procedure doForm;
begin
SafeShow;
SafeShowFormModal;
end;
begin
GetSelf.Visible := False;
doForm;
GetSelf.Visible := True;
end.
Help is appreciated!