Results 1 to 14 of 14

Thread: Form tutorial?

  1. #1
    Join Date
    Jul 2013
    Location
    An horse
    Posts
    300
    Mentioned
    9 Post(s)
    Quoted
    120 Post(s)

    Default Form tutorial?

    Can anyone point me to an updated form tutorial? I just want to get a general understanding of them and the ability to make a basic one for a script I am working on. I tried compiling an example from this tutorial but I got this:

    Code:
    Exception in Script: Unknown declaration "Caption" at line 23, column 7
    Obviously the way they are made has changed somehow. I even tried the generated code from the form designer and that didn't work.
    Currently lurking while messing around with dll injection. Will continue contributing after I finish my quest.

  2. #2
    Join Date
    Jan 2012
    Posts
    550
    Mentioned
    2 Post(s)
    Quoted
    177 Post(s)

  3. #3
    Join Date
    Jan 2012
    Location
    Netherlands
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    No it does not.

    Foundry means a 'GUI' form, not a player Form.
    Looking for the solution as wel.

    ThreadSafeCall is also not being recognised.

    Totally Broken?

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Sorry I can't give you much but here is a basic form for lape:

    Simba Code:
    var
      mainForm: TForm;

    procedure startform; native;
    begin
      mainForm.init(nil);
      with mainForm do
      begin
        setWidth(546);
        setHeight(200);
        setCaption('Hello World');
        setPosition(poScreenCenter);
      end;
      mainForm.showModal();
      mainForm.free();
    end;

    begin
       sync(startform);
    end.

    It's best to follow https://github.com/SRL/SRL-6/blob/ma...ayerform.simba as to how all the form stuff is added

  5. #5
    Join Date
    Jan 2012
    Location
    Netherlands
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Sorry I can't give you much but here is a basic form for lape:

    Simba Code:
    var
      mainForm: TForm;

    procedure startform; native;
    begin
      mainForm.init(nil);
      with mainForm do
      begin
        setWidth(546);
        setHeight(200);
        setCaption('Hello World');
        setPosition(poScreenCenter);
      end;
      mainForm.showModal();
      mainForm.free();
    end;

    begin
       sync(startform);
    end.

    It's best to follow https://github.com/SRL/SRL-6/blob/ma...ayerform.simba as to how all the form stuff is added
    Thanks for the info, going to take a look right away!

    Was looking at the DTM editor.sex and thats written in Pascall.

    edit:
    The CTR + Spacebar Shows little when comparing to the previous simba.
    That always showed what was possible at that line.
    really handy in the 'do begin', it would show how to set Caption, Height, etc....

    Code:
      with DsgnForm do
        begin
          Caption:='DsgnForm';
          Left:=174;
          Top:=302;
          Width:=320;
          Height:=240;
          Font.Name:=default;
          Font.Color:=clDefault;
          Font.Size:=0;
      end;

  6. #6
    Join Date
    Jul 2013
    Location
    An horse
    Posts
    300
    Mentioned
    9 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Sorry I can't give you much but here is a basic form for lape:

    Simba Code:
    var
      mainForm: TForm;

    procedure startform; native;
    begin
      mainForm.init(nil);
      with mainForm do
      begin
        setWidth(546);
        setHeight(200);
        setCaption('Hello World');
        setPosition(poScreenCenter);
      end;
      mainForm.showModal();
      mainForm.free();
    end;

    begin
       sync(startform);
    end.

    It's best to follow https://github.com/SRL/SRL-6/blob/ma...ayerform.simba as to how all the form stuff is added
    Yeah, this is what I was looking for. I'm looking into it now, thanks!

    EDIT: What exactly does setOnClick for the TButtons? I put a procedure in there just like the SRL player form has it but it doesn't call it when I click.

    Simba Code:
    program face;
    var
      mainForm: TForm;
      memo: TMemo;
      cool: TEdit;
      coolbutton: TButton;

    procedure applystuff(sender: TObject); native;
    begin
      writeLn('got here...');
      writeLn(cool.getText());
    end;

    procedure startform; native;
    begin
      mainForm.init(nil);
      with mainForm do
      begin
        setWidth(400);
        setHeight(600);
        setCaption('Hello World');
        setPosition(poScreenCenter);
      end;
      memo.init(mainForm);
      with memo do
      begin
        setParent(mainForm);
        setLeft(mainform.getLeft() + 9);
        setTop(100);
        setWidth(mainForm.getWidth() - 18);
        setHeight(100);
        setScrollBars(ssAutoBoth);
      end;
      cool.init(mainform);
      with cool do
      begin
        setParent(mainform);
        setLeft(10);
        setTop(10);
        setHeight(20);
        setWidth(mainForm.getWidth() - 18);
      end;
      coolbutton.init(mainForm);
      with coolbutton do
      begin
        setParent(mainForm);
        setLeft(cool.getLeft() + 10);
        setTop(cool.getTop() + 27);
        setHeight(cool.getHeight());
        setWidth(45);
        setCaption('no');
        setOnClick(applystuff);
      end;
      mainForm.showModal();
      mainForm.free();
    end;

    begin
       sync(startform);
    end.
    Last edited by Foundry; 01-20-2014 at 06:02 PM.
    Currently lurking while messing around with dll injection. Will continue contributing after I finish my quest.

  7. #7
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Writeln() doesn't write to the Simba debug box when a form is open (that's why the SRL Player form has a debug box at the bottom). If you open the Simba console you'll see it written there.

  8. #8
    Join Date
    Jul 2013
    Location
    An horse
    Posts
    300
    Mentioned
    9 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Writeln() doesn't write to the Simba debug box when a form is open (that's why the SRL Player form has a debug box at the bottom). If you open the Simba console you'll see it written there.
    Thanks, I was wondering why it had its own debug box.
    Currently lurking while messing around with dll injection. Will continue contributing after I finish my quest.

  9. #9
    Join Date
    Jan 2012
    Location
    Netherlands
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Writeln() doesn't write to the Simba debug box when a form is open (that's why the SRL Player form has a debug box at the bottom). If you open the Simba console you'll see it written there.
    Is there some help for this?
    I would like to know all the functions of the variabels ( The prev. simba supported this )
    as you can see at the following picture: Function_List.jpg
    I entered the Variable then a '.' and it magically pops up.

  10. #10
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by kazhual View Post
    Is there some help for this?
    I would like to know all the functions of the variabels ( The prev. simba supported this )
    as you can see at the following picture: Function_List.jpg
    I entered the Variable then a '.' and it magically pops up.
    Codehints aren't supported in Lape, but you can view the source files here. If you find the right parts of the files, they list different form component methods.

  11. #11
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Yea Lape forms are pretty basic, You also can't use any MML stuff which is a pain.

  12. #12
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    I don't blame him for not wanting to update to SRL-6. It is just about impossible with the lack of auto complete and absolutely zero documentation.

    The lack of auto complete is the biggest issue. You don't really need much documentation if you have auto complete.
    Last edited by Bixby Sayz; 01-22-2014 at 05:46 AM.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

  13. #13
    Join Date
    Jan 2012
    Location
    Netherlands
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Codehints aren't supported in Lape, but you can view the source files here. If you find the right parts of the files, they list different form component methods.
    Thanks for showing the source file, i've already found that one but still missing parts in that file.
    Not all Eventlisteners are defined, 'Onclick'
    Some are listed but cant find them in simba : 'BorderStyle'


    Is there a Source of the Tform Class ?

  14. #14
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Bixby Sayz View Post
    I don't blame him for not wanting to update to SRL-6. It is just about impossible with the lack of auto complete and absolutely zero documentation.

    The lack of auto complete is the biggest issue. You don't really need much documentation if you have auto complete.
    SRL-6 has its own doc @ http://docs.villavu.com/srl-6/

    Code hints are purely based of lape (at-least what i've been told), the decision to switch (for srl-6) to lape was a couple years ago and this is when lape was being dev'd pretty much every week. But now lape hasn't been touched in like a year because @nielsie95 doesn't have the time / I dont think deving a interpreter is remotely close to fun.

    Quote Originally Posted by kazhual View Post
    Thanks for showing the source file, i've already found that one but still missing parts in that file.
    Not all Eventlisteners are defined, 'Onclick'
    Some are listed but cant find them in simba : 'BorderStyle'


    Is there a Source of the Tform Class ?
    I recently did a commit to Simba one of them things being adding BorderStyle, that is why you you can see it in the source, but it isn't actually in the public Simba version.
    Last edited by Olly; 01-23-2014 at 08:25 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •