Jump to content


Photo

TNxProgressColumn usage


  • Please log in to reply
8 replies to this topic

#1 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 30 October 2010 - 12:09 AM

Hello Boki,

how is the correct usage of the TNxProgressColumn? Setting the Max property and then set e.g. AsInteger and the progress bar will adjust accordingly?

As far as I understand the Max property is per column and not per row, right? In my case, the Max value of the progress bar column depends on another column value which my differ per row.


Thanks,
Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 30 October 2010 - 01:18 AM

Hello Thomas,

Max property is used per Column. You need to set Max property and then (as you already know) AsInteger property of cell. Progress bar ratio will be calculated with Max property and progressbar will be drawn.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 30 October 2010 - 01:58 PM

Hi Boki,

thanks! I have to scale the assigned value myself then. That's fine.

Beside the progress bar, is it also possible to display a text inside the progress bar? For example, the progress bar is for displaying the number of fetched records of a database table and displaying the value would be nice.

Thanks!
Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 31 October 2010 - 01:06 AM

Hello Thomas,

Unfortunately you may show text beside bar only (ShowText property of Column). You may try to use custom drawing. Here is how to do this: http://dn.bergsoft.n...in-nextgrid.htm

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 IUnknown

IUnknown
  • Members
  • 13 posts
  • Gender:Male
  • Location:Niedersachsen, Deutschland
  • Interests:COM/Multithreading/API/eCommerce

Posted 21 April 2014 - 03:35 AM

In my case, the Max value of the progress bar column depends on another column value which m(a)y differ per row.

+1

Max property is used per Column...


This is very, very irrational and somewhat unexpected :unsure: Why all values in the row are supposed to be dynamic, but ProgressColumn stays static?
My NxProgressColumn(s)' values also differ row to row. I mean, I use grid control to monitor the performance of threads' execution. Each thread sits in a separate row and has its own bunch of work. The properties NxProgressColumn.Max are not necessarily equal per ProgressColumn. That said, one thread may have 1600 operations to process whilst another has only 500. In this case a shared Max setting would definitely lead to chaos.

Boki, is there any legitimate hack to correct this?

Thanks
Vsevolod
There are 10 types of people. Those who understand binary and those who don't.

#6 deonvn

deonvn

    Senior Member

  • Honorable Members
  • PipPip
  • 313 posts

Posted 21 April 2014 - 09:39 AM

@IUnknown

Set the Max property of the column to 100 (the default) then express the value of the progress cell in each row as a percentage of 100.

For example:

If the progress is 300 out of 800, set the cell value to Trunc((300 / 800) * 100)).
If the progress is 300 out of 1600, set the cell value to Trunc((300 / 1600) * 100)).
If the progress is 250 out of 500, set the cell value to Trunc((250 / 500) * 100)).

That way it doesn't matter what the "max" of any individual cell is, since the cell value is always expressed as a percentage of the max of the column.

#7 IUnknown

IUnknown
  • Members
  • 13 posts
  • Gender:Male
  • Location:Niedersachsen, Deutschland
  • Interests:COM/Multithreading/API/eCommerce

Posted 21 April 2014 - 11:57 AM

@deonvn

You've made my day.
Thank you.
There are 10 types of people. Those who understand binary and those who don't.

#8 IUnknown

IUnknown
  • Members
  • 13 posts
  • Gender:Male
  • Location:Niedersachsen, Deutschland
  • Interests:COM/Multithreading/API/eCommerce

Posted 23 April 2014 - 11:01 AM

Hi BergSoft Team,

I'd like to elaborate a bit more in TNxProgressColumn. Hence is the question:

I use doCustom to paint the progress bar. However when the process finishes I want the progress bar to stay on 100% but change the color of gauge to "inactive" (clGray). The user should be able to distinguish active (colored clGreen) and inactive (colored clGray) processes.

I examined the properties of NxProgressColumn control but it seems that whatever I change there will apply globally.
Does it worth to reference the particular NxProgressColumn via
(Grid.Cell[col, row].ObjectReference as TNxProgressColumn)
or are there any other techniques?

Thanks
Vsevolod
There are 10 types of people. Those who understand binary and those who don't.

#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 25 April 2014 - 04:17 AM

Hello Sir,

Custom drawing is mean that you will need to do drawing completely by yourself.

But, I have think last days about new event for column - OnPreparePaint . In this event you will be able to set properties for single cell only (you will also need to set them back for another cell). Maybe this will solve problem?
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users