Page 1 of 1

HMG4 statusbar icon item disappear

Posted: Sat Feb 19, 2011 8:04 pm
by l3whmg
Hi guys,
I have found a problem with STATUSITEM icon. With HMG4 we can add an image with this instruction:

Code: Select all

STATUSITEM "SomeTextHere" WIDTH nwidth ICON IconFile
and this work fine, but sometime we can modify "SomeTextHere" with this instruction:

Code: Select all

FormName:StatusBar:Item(nIndex) := "AnotherText"
This also works well, but not too much. In fact, the image is lost after this assignment. Enclosed you will find the solution that I propose.

Changes to make (source "statusbar.prg"), you will find marked with "L3W". The code, that I have written, is not very clean, but I preferred to preserve the existing structure to better highlight my intervention.

I have also added the third parameter to "Item method", but I do'nt know if it's a good idea. Now, it could be used in this way:

Code: Select all

METHOD Item( nIndex, cItemCaption, cIconName )
and for this reason you can add or remove the image.

Best regards

Re: HMG4 statusbar icon item disappear

Posted: Sat Feb 19, 2011 9:05 pm
by Rathinagiri
Thanks a lot Luigi. I will see to the code and implement the same. :)