>Progress Bar in your status bar


Dale Jessop from 3M recently needed to create a progress bar that is embedded at the bottom of his form next to a status bar (as shown in the image). He has kindly offered to share this technique with readers of my blog.
Basically you need two editline controls on the window (STB_STATUS and PRB_TEST). one which will be an MS progress bar and one which will be an MS status bar. The examples I have taken the MS controls from are Sprezzatura examples and they are taken from:
  • SEATTLE_2007_PRB_EX1
  • SEATTLE_2007_PRB_EX2
I have both of the controls on the window and both are turned into their MS equivalents on the CREATE event, after which I run the following code which embeds the progress bar within the status bar control.

Once the progress bar is embedded in the status bar you can use it the same as a normal status bar. I have also been able to mimic the behaviour of Internet Explorer by making the progress bar “appear, run and then disappear again”.

0001 *//////////////////////////////*
0002 hidePrb:
0003 *//////////////////////////////*
0004 call set_Property( @window : “.PRB_TEST”, “PARENT”, @window)
0005 call set_Property( @window : “.PRB_TEST”, “VISIBLE”, 0)
0006 return
0008 *//////////////////////////////*
0009 embedPrb:
0010 *//////////////////////////////*
0012 stbSize = get_Property( @window : “.STB_STATUS”, “SIZE” )
0013 prbSize = Get_Property( @window : “.PRB_TEST”, “SIZE” )
0015 * // Both sizes are relative to the parent form right now, so
0016 * // make the prbSize relative to the stbSize instead
0019 prbSize<1> = prbSize<1> stbSize<1>
0021 if (prbSize<1> < 0) then prbSize<1> = 0
0023 prbSize<2> = (prbSize<2> stbSize<2>)+2 ; * Adjusted so the
0024 * progress bar looks like it is ’embedded’ inside the
0025 * status bar
0026 prbSize<3> = 250 ; * Hard-coded the width of the control in
0027 * this instance
0028 prbSize<4> = (prbSize<4>)3 ; * Adjusted so the progress bar
0029 * looks like it is ’embedded’ inside the status bar
0031 call set_Property( @window : “.PRB_TEST”, “PARENT”, @window :
0032 “.STB_STATUS” )
0033 call set_Property( @window : “.PRB_TEST”, “SIZE”, prbSize )
0034 call set_Property( @window : “.PRB_TEST”, “VISIBLE”, 1 )
0036 return

8 thoughts on “>Progress Bar in your status bar

  1. >Get interested with this,Question…I just need to add editline control? What do I need to do in Create Event to turn the editline control to progress bar? How do I update the progress bar? Thanks first

  2. >Thank you for your comment. I will email you direct as I’m not a programmer and for this reason I am unable to comment much more than what is provided by Dale in the posting.I suspect that the code Dale provided is run on the Windows’ CREATE event, but I am only guessing. I would suggest initially looking at the following SENL from Sprezzatura (http://www.sprezzatura.com/senl/senl440307.pdf) as this has a article on the progress bar. I think that this along with the code from Dale should help you.

  3. >To do what Dale’s doing you’ll need a copy of the RDK referenced in the article above by Martyn. Just ask Martyn and he’ll mail it – it’s Sprezz freeware but should be used in conjunction with a reading of the article!

  4. >Sorry Barry – Your posting was not censored and I thought it would simply be removed as Carl sent the files without a notice such as that above – I’m learning fast ;)I will publish both posts shortly.

  5. >Grrrr – Can’t republish comments that have been declined using the moderator. Barry’s postings were:”Could I have the Sprez RDK code as well please.TIA””Ignore my request for code. Carl sent it to me.I had emailed sprez before I saw the note to get it from you.” Sorry for any confusion.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s