HMG4 statusbar icon item disappear

Moderator: Rathinagiri

Post Reply
User avatar
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Been thanked: 1 time

HMG4 statusbar icon item disappear

Post 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
(3.1 KiB) Downloaded 222 times
Luigi from Italy

User avatar
Posts: 5411
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 252 times
Been thanked: 305 times

Post by Rathinagiri »

Thanks a lot Luigi. I will see to the code and implement the same. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Post Reply