METER ON A WBROWSE LISTBOX

METER ON A WBROWSE LISTBOX

Postby E. Bartzokas » Tue Jun 03, 2008 8:45 am

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  Expand view  RUN
CAR NO.     PROGRESS
---------------------------
ZMP1980      XXXXX___
YNI4652      XXX_____
User avatar
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Postby Otto » Tue Jun 03, 2008 9:11 am

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
Otto
 
Posts: 6345
Joined: Fri Oct 07, 2005 7:07 pm

Postby E. Bartzokas » Tue Jun 03, 2008 6:18 pm

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
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Postby Otto » Tue Jun 03, 2008 6:45 pm

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
Otto
 
Posts: 6345
Joined: Fri Oct 07, 2005 7:07 pm

Postby Patrick Mast » Thu Jun 05, 2008 2:32 pm

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
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Re: METER ON A WBROWSE LISTBOX

Postby Detlef Hoefner » Fri Jun 06, 2008 10:24 am

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  Expand view  RUN
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
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby Otto » Sat Jun 07, 2008 7:31 am

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
Otto
 
Posts: 6345
Joined: Fri Oct 07, 2005 7:07 pm

Postby E. Bartzokas » Wed Jun 25, 2008 6:11 am

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
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Postby Antonio Linares » Fri Jun 27, 2008 4:19 pm

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests