Board index » delphi » Display Different Tick Types On A TTrackBar Component?

Display Different Tick Types On A TTrackBar Component?

Hi,

I was thinking to use TTrackBar to show the status of some measurements. The
TTrackBar will show some of the control level of the measurements, such as
upper control limit (UCL), lower control limit (LCL), upper limit (UL),
lower limit (LL), etc.

The TTrackBar will depends on what limit, and show different types of tick
on the bar and label with some description such as UCL, LCL, UL, LL etc.

For the white color bar, which the slider moves along, is it possible to
draw a color bar (something looks like Progress Bar) between the UCL and LCL

Example of the UCL, LCL, UL and LL values:

UL: 12.3
UCL: 12.1
LCL: 11.8
LL: 11.6

Do I need to create a descendant TTrackBar component to do these?

Thanks in advance.

Regards,
Singchee

 

Re:Display Different Tick Types On A TTrackBar Component?


Quote
In article <8f32cv$j...@bornews.borland.com>, Singchee wrote:
> I was thinking to use TTrackBar to show the status of some measurements. The
> TTrackBar will show some of the control level of the measurements, such as
> upper control limit (UCL), lower control limit (LCL), upper limit (UL),
> lower limit (LL), etc.
> The TTrackBar will depends on what limit, and show different types of tick
> on the bar and label with some description such as UCL, LCL, UL, LL etc.

> Do I need to create a descendant TTrackBar component to do these?

Yes, and it would be a bit of work. The Trackbar common control does support
custom drawing since version 4.70 of the common controls library but the
Delphi TTrackbar class does not surface this capability. So you would have to
derive a new control class from it and add a handler for the CN_NOTIFY
message, which is an "echo" of the WM_NOTIFY message the trackbar sends to its
parent. There you would have to process the NM_CUSTOMDRAW notification.
This can get a bit convoluted and you need to refer to the MSDN docs for
details, since the win32.hlp that comes with D5 is not up-to-date in this
area. I think it would pay to first search the usual Delphi sites, perhaps
somebody has already done the work for you.

Delphi Super Page       http://sunsite.icm.edu.pl/delphi/
  US mirror site:       http://www.cdrom.com/pub/delphi_www/
  German mirror :        
http://ftp.uni-erlangen.de/pub/source/MIRRORS/sunsite.icm.edu.pl/pub/...
  Other mirrors :       http://ftp.sunet.se/delphi/
Torry's Delphi Pages    http://www.torry.ru/  
the Delphi Box          http://Inner-Smile.com .
                        http://www.delphisource.com/
The DELPHI Deli         http://www.delphix.com/
The Delphi EXchange     http://www.delphiexchange.com/

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads