Results 1 to 9 of 9

Thread: ProgressBar1 : TProgressBar;

  1. #1
    Join Date
    Apr 2007
    Posts
    186
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default ProgressBar1 : TProgressBar;

    Ok, how i can get this running ? The progress bar by pressing the button ? heres my code :

    SCAR Code:
    program New;

    var
      frmDesign : TForm;
      Label1 : TLabel;
      ProgressBar1 : TProgressBar;
      Button1 : TButton;

    procedure LoadForm;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 356;
    frmDesign.Top := 170;
    frmDesign.Width := 268;
    frmDesign.Height := 134;
    frmDesign.Caption := 'Progress Bar Testing';
    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;
    Label1 := TLabel.Create(frmDesign);
    Label1.Parent := frmDesign;
    Label1.Left := 55;
    Label1.Top := 26;
    Label1.Width := 98;
    Label1.Height := 13;
    Label1.Caption := 'Progress Bar Testing';
    ProgressBar1 := TProgressBar.Create(frmDesign);
    ProgressBar1.Parent := frmDesign;
    ProgressBar1.Left := 55;
    ProgressBar1.Top := 40;
    ProgressBar1.Width := 150;
    ProgressBar1.Height := 17;
    ProgressBar1.Smooth := True;
    ProgressBar1.Step := 5;
    ProgressBar1.TabOrder := 8;
    ProgressBar1.TabStop := False;
    Button1 := TButton.Create(frmDesign);
    Button1.Parent := frmDesign;
    Button1.Left := 90;
    Button1.Top := 65;
    Button1.Width := 75;
    Button1.Height := 25;
    Button1.Caption := 'Start The Bar';
    Button1.TabOrder := 9;
    end;

    procedure TheForm;
    var
      v: TVariantArray;
    begin
      SetArrayLength(V, 0);
      ThreadSafeCall('LoadForm', v);
    end;

    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

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

    begin
    TheForm;
    TehForm;
    FreeForm(frmDesign);
    end.

  2. #2
    Join Date
    Apr 2007
    Posts
    186
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    *bumb* pls some one

  3. #3
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I dunno what you mean by a progress bar, or what you want it to do, but here is how to make something happen when you press a button.

    SCAR Code:
    procedure StartProgressBar(sender: TObject);
    begin
      //code you want to happen here.
    end;

    And make sure you include this in your init form
    SCAR Code:
    Button1.onclick := @StartProgressBar;

  4. #4
    Join Date
    Apr 2007
    Posts
    186
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by omgh4x0rz View Post
    I dunno what you mean by a progress bar, or what you want it to do, but here is how to make something happen when you press a button.

    SCAR Code:
    procedure StartProgressBar(sender: TObject);
    begin
      //code you want to happen here.
    end;

    And make sure you include this in your init form
    SCAR Code:
    Button1.onclick := @StartProgressBar;
    yeah i know, but how to make the progress bar running ? this feature is only available in Divi I think freddy would know this

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

    Default

    Code:
    program ProgressBarExample;
    var
      frmDesign : TForm;
      ProgressBar1 : TProgressBar;
      Tmr1: TTimer;
    
    procedure Timer1(sender: TObject);
    begin
      ProgressBar1.StepIt;
    end;
    
    procedure InitForm;
    begin
      frmDesign := CreateForm;
      frmDesign.Left := 250;
      frmDesign.Top := 114;
      frmDesign.Width := 354;
      frmDesign.Height := 254;
      frmDesign.Caption := 'ProgressBar 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;
    
      ProgressBar1 := TProgressBar.Create(frmDesign);
      ProgressBar1.Parent := frmDesign;
      ProgressBar1.Left := 69;
      ProgressBar1.Top := 61;
      ProgressBar1.Width := 200;
      ProgressBar1.Height := 20;
      ProgressBar1.Visible := True;
      ProgressBar1.Step := 1;
      ProgressBar1.Smooth := True;
    
      tmr1 := TTimer.Create(frmDesign);
      tmr1.Interval := 100;
      tmr1.OnTimer := @Timer1;
    end;
    
    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;
    
    function ShowFormModal: Boolean;
    begin
      Result:= False;
      if(frmDesign.ShowModal = mrOk)then Result:= True;
    end;
    
    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;
    
    begin
      SafeInitForm;
      SafeShowFormModal;
      FreeForm(frmDesign);
    end.
    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!


  6. #6
    Join Date
    Apr 2007
    Posts
    186
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Starblaster100 View Post
    Code:
    program ProgressBarExample;
    var
      frmDesign : TForm;
      ProgressBar1 : TProgressBar;
      Tmr1: TTimer;
    
    procedure Timer1(sender: TObject);
    begin
      ProgressBar1.StepIt;
    end;
    
    procedure InitForm;
    begin
      frmDesign := CreateForm;
      frmDesign.Left := 250;
      frmDesign.Top := 114;
      frmDesign.Width := 354;
      frmDesign.Height := 254;
      frmDesign.Caption := 'ProgressBar 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;
    
      ProgressBar1 := TProgressBar.Create(frmDesign);
      ProgressBar1.Parent := frmDesign;
      ProgressBar1.Left := 69;
      ProgressBar1.Top := 61;
      ProgressBar1.Width := 200;
      ProgressBar1.Height := 20;
      ProgressBar1.Visible := True;
      ProgressBar1.Step := 1;
      ProgressBar1.Smooth := True;
    
      tmr1 := TTimer.Create(frmDesign);
      tmr1.Interval := 100;
      tmr1.OnTimer := @Timer1;
    end;
    
    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;
    
    function ShowFormModal: Boolean;
    begin
      Result:= False;
      if(frmDesign.ShowModal = mrOk)then Result:= True;
    end;
    
    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;
    
    begin
      SafeInitForm;
      SafeShowFormModal;
      FreeForm(frmDesign);
    end.
    Thank you starblaster

  7. #7
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Thank you soo much startblaster this solved it.

  8. #8
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Thank you soo much startblaster this solved it.
    Dont be gravedigger Nauman

  9. #9
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Ahh sorry. It wasn't on purpose i just searched it up and i found it. so i posted a comment.


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
  •