Making Forms

Discussion in 'Scar/Simba Help' started by pker overkil, Jun 21, 2007.

Making Forms
  1. Unread #1 - Jun 21, 2007 at 6:06 PM
  2. pker overkil
    Joined:
    Feb 11, 2007
    Posts:
    387
    Referrals:
    0
    Sythe Gold:
    0

    pker overkil Forum Addict

    Making Forms

    Ive tried to learn how to make forms and ive probably posted this 20 times but can someone tell me a detailed tutorial that covers how to make forms and use them in your script?
     
  3. Unread #2 - Jun 21, 2007 at 6:38 PM
  4. LaBo
    Joined:
    Feb 27, 2006
    Posts:
    172
    Referrals:
    0
    Sythe Gold:
    0

    LaBo Active Member
    Banned

    Making Forms

  5. Unread #3 - Jun 21, 2007 at 7:07 PM
  6. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Making Forms

    Yeah, there are some great tutorials as far as forms go. If you have any specific questions I'd be glad to help out. You can either use the Form Editer (Open Scar ---> Tools) or just write in the code yourself. Looking at other scripts will probably help you the most, besides guides.
     
  7. Unread #4 - Jun 22, 2007 at 7:29 AM
  8. pker overkil
    Joined:
    Feb 11, 2007
    Posts:
    387
    Referrals:
    0
    Sythe Gold:
    0

    pker overkil Forum Addict

    Making Forms

    thanks guys! oh and Town i voted for u =)
     
  9. Unread #5 - Jun 22, 2007 at 9:03 AM
  10. pker overkil
    Joined:
    Feb 11, 2007
    Posts:
    387
    Referrals:
    0
    Sythe Gold:
    0

    pker overkil Forum Addict

    Making Forms

    Nevermind fixed =)
     
  11. Unread #6 - Jun 22, 2007 at 10:56 AM
  12. LaBo
    Joined:
    Feb 27, 2006
    Posts:
    172
    Referrals:
    0
    Sythe Gold:
    0

    LaBo Active Member
    Banned

    Making Forms

    You could do something like this:

    Code:
    var
      frmDesign: TForm;
      Label1: TLabel;
      WebsiteURL: TEdit;
      Button1: TButton;
      CheckBox1, CheckBox2: TCheckBox;
    
    procedure TypeURL(Sender: TObject);
    begin
      OpenWebPage('http://' + WebsiteURL.text);
    end;
    
    procedure ClearURLBox(Sender: TObject);
    begin
      if(WebsiteURL.text = 'WebsiteURL <example: www.google.com> (do not include "http://" part)')then
        WebsiteURL.text:= '';
    end;
    
    procedure InitForm;
    begin
      frmDesign := CreateForm;
      frmDesign.Left := 268;
      frmDesign.Top := 114;
      frmDesign.Width := 386;
      frmDesign.Height := 190;
      frmDesign.Caption := 'Websiter 3000';
      frmDesign.Color := clBtnFace;
      frmDesign.Font.Color := clWindowText;
      frmDesign.Font.Height := -11;
      frmDesign.Font.Name := 'MS Sans Serif';
      frmDesign.Font.Style := [];
      frmDesign.Visible := False;
      frmDesign.Windowstate := wsMinimized
      frmDesign.PixelsPerInch := 96;
      Label1 := TLabel.Create(frmDesign);
      Label1.Parent := frmDesign;
      Label1.Left := 51;
      Label1.Top := 36;
      Label1.Width := 147;
      Label1.Height := 13;
      Label1.Caption := 'What Website you want to visit';
      WebsiteURL := TEdit.Create(frmDesign);
      WebsiteURL.Parent := frmDesign;
      WebsiteURL.Left := 209;
      WebsiteURL.Top := 32;
      WebsiteURL.Width := 152;
      WebsiteURL.Height := 21;
      WebsiteURL.TabOrder := 8;
      WebsiteURL.Text:= 'WebsiteURL <example: www.google.com> (do not include "http://" part)';
      WebsiteURL.OnClick:= @ClearURLBox;
      Button1 := TButton.Create(frmDesign);
      Button1.Parent := frmDesign;
      Button1.Left := 187;
      Button1.Top := 91;
      Button1.Width := 75;
      Button1.Height := 25;
      Button1.Caption := 'Go!';
      Button1.TabOrder := 9;
      Button1.Onclick := @TypeUrl;
      CheckBox1 := TCheckBox.Create(frmDesign);
      CheckBox1.Parent := frmDesign;
      CheckBox1.Left := 52;
      CheckBox1.Top := 104;
      CheckBox1.Width := 97;
      CheckBox1.Height := 17;
      CheckBox1.Caption := 'Internet Explorer';
      CheckBox1.TabOrder := 10;
      CheckBox2 := TCheckBox.Create(frmDesign);
      CheckBox2.Parent := frmDesign;
      CheckBox2.Left := 52;
      CheckBox2.Top := 76;
      CheckBox2.Width := 97;
      CheckBox2.Height := 17;
      CheckBox2.Caption := 'Mozilla Firefox';
      CheckBox2.TabOrder := 11;
    end;
    
    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      SetArrayLength(v, 0);
      ThreadSafeCall('InitForm', v);
    end;
    
    Procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;
    
    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      SetArrayLength(v, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;
    
    begin
      SafeInitForm;
      SafeShowFormModal;
      FreeForm(frmDesign);
    end.
    But that will open the website to your default web browser only.
     
  13. Unread #7 - Jun 22, 2007 at 11:08 AM
  14. pker overkil
    Joined:
    Feb 11, 2007
    Posts:
    387
    Referrals:
    0
    Sythe Gold:
    0

    pker overkil Forum Addict

    Making Forms

    im actually making something that literally clicks on the browser then types in the URL but i fixed it so i dont need your help =)
     
  15. Unread #8 - Jun 22, 2007 at 11:12 AM
  16. LaBo
    Joined:
    Feb 27, 2006
    Posts:
    172
    Referrals:
    0
    Sythe Gold:
    0

    LaBo Active Member
    Banned

    Making Forms

    Hmmm, ok... :D

    Well, anyways, I still recommend you check out the SCAR Help File, as I am sure it would help you more than a lot. ;)
     
  17. Unread #9 - Jun 22, 2007 at 11:50 AM
  18. pker overkil
    Joined:
    Feb 11, 2007
    Posts:
    387
    Referrals:
    0
    Sythe Gold:
    0

    pker overkil Forum Addict

    Making Forms

    i did check out help file. it helped lots =).
     
  19. Unread #10 - Jun 22, 2007 at 5:10 PM
  20. LaBo
    Joined:
    Feb 27, 2006
    Posts:
    172
    Referrals:
    0
    Sythe Gold:
    0

    LaBo Active Member
    Banned

    Making Forms

    That's good to hear :D
     
< Help with this please | Verifying/Approving scripts >

Users viewing this thread
1 guest


 
 
Adblock breaks this site