Question A Syntax For, Progressbar? Or Loadingbar?

RealHeavyDude

Well-Known Member
The ABL itself does not contain such a particular widget. You could use the slider widget to some extent, but, personally IMHO it looks ugly. You can either use a 3rd part control ( depneding on the Progress/OpenEdge version ) you are able to use an OCX or even a .NET control. Nevertheless you can also roll your own - I did that.

I am not allowed to post any code here. But, the basic idea is to have two rectangles, the underlying which is the width of the widget and an overlaying one with a different fill color that gets resized whenever the progress bar needs to be updated. Works without a fuzz and is pure ABL - no dependency to any 3rd party piece of software.

Heavy Regards, RealHeavydude.
 

Stefan

Well-Known Member
With Progress Developer Studio you can whip up a progress bar in seconds (all generated comments removed for compactness):

Code:
USING Progress.Lang.*.
USING Progress.Windows.Form.

CLASS progressbar INHERITS Form: 
   
    DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO.
   DEFINE PRIVATE VARIABLE progressBar1 AS System.Windows.Forms.ProgressBar NO-UNDO.
       
    CONSTRUCTOR PUBLIC progressbar (  ):       
       
      SUPER().
      InitializeComponent().
      THIS-OBJECT:ComponentsCollection:ADD(THIS-OBJECT:components).
      CATCH e AS Progress.Lang.Error:
         UNDO, THROW e.
      END CATCH.

    END CONSTRUCTOR.

    METHOD PRIVATE VOID InitializeComponent(  ):       

      THIS-OBJECT:progressBar1 = NEW System.Windows.Forms.ProgressBar().
      THIS-OBJECT:SuspendLayout().

      THIS-OBJECT:progressBar1:Location = NEW System.Drawing.Point(13, 13).
      THIS-OBJECT:progressBar1:Name = "progressBar1".
      THIS-OBJECT:progressBar1:Size = NEW System.Drawing.Size(267, 22).
      THIS-OBJECT:progressBar1:TabIndex = 0.
      THIS-OBJECT:progressBar1:Value = 33. /* <--- this indicates % */

      THIS-OBJECT:ClientSize = NEW System.Drawing.Size(292, 266).
      THIS-OBJECT:Controls:Add(THIS-OBJECT:progressBar1).
      THIS-OBJECT:Name = "progressbar".
      THIS-OBJECT:Text = "progressbar".
      THIS-OBJECT:ResumeLayout(FALSE).
      CATCH e AS Progress.Lang.Error:
         UNDO, THROW e.
      END CATCH.
    END METHOD.

    DESTRUCTOR PUBLIC progressbar ( ):

    END DESTRUCTOR.

END CLASS.

And otherwise a much simpler native version is a string of capital I's (or your other favorite character).
 
I am not allowed to post any code here. But, the basic idea is to have two rectangles, the underlying which is the width of the widget and an overlaying one with a different fill color that gets resized whenever the progress bar needs to be updated. Works without a fuzz and is pure ABL - no dependency to any 3rd party piece of software.

Heavy Regards, RealHeavydude.


Thanks sir,

Do I need to use timer?...PSTimer?
 
With Progress Developer Studio you can whip up a progress bar in seconds (all generated comments removed for compactness):

Code:
USING Progress.Lang.*.
USING Progress.Windows.Form.

CLASS progressbar INHERITS Form:
  
    DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO.
   DEFINE PRIVATE VARIABLE progressBar1 AS System.Windows.Forms.ProgressBar NO-UNDO.
      
    CONSTRUCTOR PUBLIC progressbar (  ):      
      
      SUPER().
      InitializeComponent().
      THIS-OBJECT:ComponentsCollection:ADD(THIS-OBJECT:components).
      CATCH e AS Progress.Lang.Error:
         UNDO, THROW e.
      END CATCH.

    END CONSTRUCTOR.

    METHOD PRIVATE VOID InitializeComponent(  ):      

      THIS-OBJECT:progressBar1 = NEW System.Windows.Forms.ProgressBar().
      THIS-OBJECT:SuspendLayout().

      THIS-OBJECT:progressBar1:Location = NEW System.Drawing.Point(13, 13).
      THIS-OBJECT:progressBar1:Name = "progressBar1".
      THIS-OBJECT:progressBar1:Size = NEW System.Drawing.Size(267, 22).
      THIS-OBJECT:progressBar1:TabIndex = 0.
      THIS-OBJECT:progressBar1:Value = 33. /* <--- this indicates % */

      THIS-OBJECT:ClientSize = NEW System.Drawing.Size(292, 266).
      THIS-OBJECT:Controls:Add(THIS-OBJECT:progressBar1).
      THIS-OBJECT:Name = "progressbar".
      THIS-OBJECT:Text = "progressbar".
      THIS-OBJECT:ResumeLayout(FALSE).
      CATCH e AS Progress.Lang.Error:
         UNDO, THROW e.
      END CATCH.
    END METHOD.

    DESTRUCTOR PUBLIC progressbar ( ):

    END DESTRUCTOR.

END CLASS.

And otherwise a much simpler native version is a string of capital I's (or your other favorite character).


Sir Stefan,

I am not using class and I don't know how to use it :(
 

RealHeavyDude

Well-Known Member
Stefan's example is based on the .NET progress bar. The integration to .NET is based on OOABL ( object oriented extensions to the ABL ). There is no need to use OOABL for any .NET object that you can think of that you want to use - although it is strongly recommended. But there are many for which OOABL is required. OOABL was introduced, I think, beginning with OE10.1A. The .NET integration was introduced with OE10.2A. The most recent version of the product is OE11.5.

Heavy Regards, RealHeavyDude.
 
Top