METER ON A WBROWSE LISTBOX

Post Reply
User avatar
E. Bartzokas
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

METER ON A WBROWSE LISTBOX

Post by E. Bartzokas »

Hi all,

Can someone please drop some light, as of how I could do this:
(put a meter with colored percentage as a column of a WBROWSE listbox)

Since I cannot upload an image, due to my slow internet speed,
I'd like to show you what I have in mind to do...
(X's represent progress, underscores represent blank, just like in
a meter), and hope that you understand...

Thanks to all concerned...

Code: Select all

CAR NO.     PROGRESS
---------------------------
ZMP1980      XXXXX___
YNI4652      XXX_____
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello Bartzokas,

how many steps do you need (1-10?).
You could upload pictures and then show a different picture to a progress step. Regards,
Otto
User avatar
E. Bartzokas
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Post by E. Bartzokas »

Otto wrote:Hello Bartzokas,

how many steps do you need (1-10?).
You could upload pictures and then show a different picture to a progress step. Regards,
Otto
Otto, hi,
Thanks for the above information; very useful indeed, however, in my
situation I would like to avoid typical colored bitmaps (in the form of a
Meter) and use a really painted meter instead.
Here's what I need to do...
Suppose we have a work project, which lasts from 1/Jan to 31/Mar.
On the 1st of March, we are about 66% of the duration time.
This is one meter I need.

At the same time, the above project has been estimated to cost,
let's say, 30000 euros. We can calculate the cost for these 60 days
(1/1 - 1/3) and have a result of, let's say again, 20000 euros.
If our expenses during this time are, e.g. 22000 euros, then we
are ahead of the estimated cost, e.g. at 72% of the total amount.
On the other hand, our expenses might be at 18500 euros, in which
case our percentage of expenses vs. estimated cost is less, e.g. 59.5%

Hard to do it with bitmaps, due to the complexity, and also, if you
consider that in cases where the expenses are less than estimated
cost, we must have green color, and at the opposite, we must use
red colors, etc.

I hope I gave you a picture...

To give you a better understanding... I'm sure you've seen Windows
Media Player and the progress bar it displays, when it copies tracks
from an audio CD to the disk... I need something like this, but in
a TWBROWSE browser...

Any suggestion will be welcome!

Thanks again for your interest (and of course, to any one's interest
in this problem)

Kind regards
Evans
ps. Congratulations for your hotel management program!
I really love the reservation part...
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello Bartzokas,

I think if you use xBrowser you could easyly do this.
I once tried a solution with a special font.
I hardcode this task. Maybe you could send a block, too?

It was something like this:

In the
METHOD PaintData

if !Empty( cData )

where the data is printed I made a
if elseif.

I send for example @59,5
If the data start with @ I switched to my own printing.
(if left(cdata,1)="@" ...

There you could change for example the color and the width.

DrawTextEx( hDC, cData,;
{nRow, nCol, nRow + nHeight, Min( nCol + nWidth, ::oBrw:BrwWidth() - 5 ) },;
::nDataStyle )

Thank you for your kind words about my WINHOTEL.
Regards,
Otto
User avatar
Patrick Mast
Posts: 244
Joined: Sat Mar 03, 2007 8:42 pm

Post by Patrick Mast »

Maybe Antonio can enhance xBrowse that it can put a METER object in a cell? That would be ausome, no? :lol:

Antonio?

Patrick
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Re: METER ON A WBROWSE LISTBOX

Post by Detlef Hoefner »

E. Bartzokas wrote:Hi all,

Can someone please drop some light, as of how I could do this:
(put a meter with colored percentage as a column of a WBROWSE listbox)

Since I cannot upload an image, due to my slow internet speed,
I'd like to show you what I have in mind to do...
(X's represent progress, underscores represent blank, just like in
a meter), and hope that you understand...

Thanks to all concerned...

Code: Select all

CAR NO.     PROGRESS
---------------------------
ZMP1980      XXXXX___
YNI4652      XXX_____
Bartzokas,

you could try the following:
# you build a normal xBrowse
# define a column where your meter should appear.
This column has i.e. a width of 20 characters ( #define MATCH_100 20 )which represents the maximum of 100 percent.
# set the font of this column to a monospace font like 'Terminal'.
So you can simulate the filled meter part with block character chr( 219 ) and the empty part with blanks.
# now you can compute the column data as replicate( chr( 219 ), int( ( MATCH_100 /100 ) * your value ) )

Maybe that could help you.

Regards,
Detlef
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello Bartzokas,

Have you tried the suggestion I made.
I did some more tests and I think this could work.


Regards,
Otto
Image
User avatar
E. Bartzokas
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Post by E. Bartzokas »

Hello All!
Thank You All for your help.
I went with the FILLRECT() after all, thus I modified
TWBROWSE.PRG slightly to make it work.
Not much coding, just a few lines.
I can provide a sample and the modified part, if someone would like
to use it. I even modified the class REPORT, to do the same.

Here's an image sample...
Thanks again to all concerned.
Evans

[img][img]http://img411.imageshack.us/img411/4811/projectmanagementzf7.th.jpg[/img][/img]
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

XBrowse 8.06 provides the facility you are looking for,

Please see example XBProgB.Prg in the samples folder. Here is the screen shot:
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply