Results 1 to 4 of 4

Thread: TStatusBar

  1. #1
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default TStatusBar

    Ok, im not very good with forms, but i want to have a status bar on my form, at the bottom, just saying things, like " checking version.." or something like that. I know that you use TStatusBar, but thats all i know.. Sorry, for nooby form question..

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Code:
    program new;
    
    var
      frmDesign : TForm;
      StatusBar1: TStatusBar;
    
    procedure InitForm;
    begin
      frmDesign := CreateForm;
      frmDesign.Left := 275;
      frmDesign.Top := 122;
      frmDesign.Width := 350;
      frmDesign.Height := 243;
      frmDesign.Caption := 'Username and Password';
      frmDesign.Color := clBtnFace;
      frmDesign.Font.Color := clWindowText;
      frmDesign.Font.Height := -11;
      frmDesign.Font.Name := 'MS Sans Serif';
      frmDesign.Font.Style := [];
      frmDesign.Visible := False;
      frmDesign.PixelsPerInch := 96;
      StatusBar1 := TStatusBar.Create(frmDesign);
      StatusBar1.Parent := frmDesign;
    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;
    end.
    (main form from tim46' tutorial, deleted unnecessary things and added TStatusBar)

    Learn from that

    I never made one too so dont ask me any follow up questions
    Administrator's Warning:


  3. #3
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    PHP Code:
    program StatusBarTest;
    var
      
    frmDesignTForm;
      
    Button1TButton;
      
    StatusBarTStatusBar;
      
    sPanel1sPanel2TStatusPanel;
      
    iInteger;

    procedure buttonclick(senderTObject);
    begin
      i 
    := 1;
      
    sPanel2.Text := IntToStr(i);
    end;

    procedure InitForm;
    begin
      frmDesign 
    := CreateForm;
      
    frmDesign.Left := 259;
      
    frmDesign.Top := 132;
      
    frmDesign.Width := 354;
      
    frmDesign.Height := 254;
      
    frmDesign.Caption := 'StatusBar Test';
      
    frmDesign.Color := clBtnFace;
      
    frmDesign.Font.Color := clWindowText;
      
    frmDesign.Font.Height := -11;
      
    frmDesign.Font.Name := 'MS Sans Serif';
      
    frmDesign.Font.Style := [];
      
    frmDesign.Visible := False;
      
    frmDesign.PixelsPerInch := 96;
      
    frmDesign.Position := poScreenCenter;

      
    Button1 := TButton.Create(frmDesign);
      
    Button1.OnClick:= @buttonclick;
      
    Button1.Parent := frmDesign;
      
    Button1.Left := 69;
      
    Button1.Top := 61;
      
    Button1.Width := 75;
      
    Button1.Height := 25;
      
    Button1.Caption := 'Increment...';
      
    Button1.TabOrder := 8;

      
    StatusBar := TStatusBar.Create(frmDesign);
      
    StatusBar.Parent := frmDesign;

      
    sPanel1 := StatusBar.Panels.Add;
      
    sPanel1.Width := 100;
      
    sPanel1.Text := 'Testing StatusBar';

      
    sPanel2 := StatusBar.Panels.Add;
      
    sPanel2.Width := 50;
    end;

    procedure SafeInitForm;
    var
      
    vTVariantArray;
    begin
      setarraylength
    (V0);
      
    ThreadSafeCall('InitForm'v);
    end;

    function 
    ShowFormModalBoolean;
    begin
      Result
    := False;
      if(
    frmDesign.ShowModal mrOk)then Result:= True;
    end;

    procedure SafeShowFormModal;
    var
      
    vTVariantArray;
    begin
      setarraylength
    (V0);
      
    ThreadSafeCall('ShowFormModal'v);
    end;

    begin
      SafeInitForm
    ;
      
    SafeShowFormModal;
      
    FreeForm(frmDesign);
    end
    A tiny search will get you a long way

    Made by Freddy, all credits to him
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  4. #4
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I did search. I searched the whole srl-forums. i searched "StatusBar", and "TStatusBar".. Anyway, thanks for the help guys.

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
  •