Results 1 to 4 of 4

Thread: Simba Form Help

  1. #1
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default Simba Form Help

    EDIT3: New problem:

    Can't get a TPopupMenu to work at all... is there some difference in the coding between scar and simba?

    Simba Code:
    program new;
    {$i SRL/SRL.simba}
    var
      Form1_1: TForm;
      SessionTagPopup: TPopUpMenu;
      ExerciseTags: array of TMenuItem;
      SampleTags: TStringArray;
      MenuButton: TButton;

    Procedure MenuPopup(Sender: TObject);
    var
      x,y: Integer;
    begin
      GetMousePos(x,y);
      SessionTagPopup.POPUP(x,y);
    end;
    Procedure InitForm;
    var
      i: Integer;
    begin
      SampleTags := ['Upper','Lower','Biceps','Triceps','Quads'];
      with Form1_1 do
      begin
        Form1_1 := CreateForm;
        Left := 325;
          Top := 187;
          Caption := 'Form1';
          ClientHeight := 700;
          ClientWidth := 700;
          Color := clBtnFace;
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Tahoma';
          Font.Style := [];
          PixelsPerInch := 96;
          Position := poScreenCenter;
      end;

        SetLength(ExerciseTags,Length(SampleTags));
        SessionTagPopup := TPopupMenu.CREATE(Form1_1);
        for i := 0 to High(SampleTags) do
        begin
          ExerciseTags[i] := TMenuItem.CREATE(Form1_1);
          ExerciseTags[i].Caption := SampleTags[i];
          SessionTagPopup.ITEMS.ADD(ExerciseTags[i]);
        end;

        MenuButton := TButton.Create(Form1_1);
        with MenuButton do
        begin
          Parent := Form1_1;
          Left := 220;
          Top := 460;
          Width := 90;
          Height := 50;
          Caption := 'MenuButton!';
          OnClick := @MenuPopup;
        end;



    end;
    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      Form1_1.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    Procedure ShowPlayerForm;
    begin
      SafeInitForm;
      SafeShowFormModal;
    end;

    Begin
      ShowPlayerForm;
    End.
    METAL HEAD FOR LIFE!!!

  2. #2
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Yeah, from testing just then, it appears that destroying a tab sheet does not yet work with the in-built method You could however achieve the same result by doing the following:
    Simba Code:
    procedure ExitSession(Sender: TObject);  
    begin
      PageControl1.ActiveTab.Parent := nil;
      PageControl1.ActiveTab := nil;
      PageControl1.SelectNextPage(False, True);
    end;

    Hope I helped,
    Daniel.
    Last edited by Daniel; 07-06-2012 at 01:55 PM.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  3. #3
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    Thanks daniel, got it all fixed up

    Unfortunately, the TPopupMenu is not working for me now... any thoughts?
    METAL HEAD FOR LIFE!!!

  4. #4
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by gerauchert View Post
    Thanks daniel, got it all fixed up

    Unfortunately, the TPopupMenu is not working for me now... any thoughts?
    Define not working? Did you assign it to anything (i.e. Form.PopupMenu := x; )?
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

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
  •