ownerdraw rangemarkers
Posted: 07 Oct 2009, 17:18
Hi. Thanks for the free controls. They're great.
I'm trying to implement a trackbar with range selection and owner drawing. I've managed to do everything I absolutely need but had to jump through a few hoops to do it. I thought I'd post my wishlist so you know what is missing or is unnecessarily difficult in the current version.
1. There doesn't seem to be a way to owner draw the rangestart/end markers. Can this be added? Or is there a way? - The default markers are just too small
2. Can we have functions to calculate the x/y coordinate from a logical value and vice versa. For example, I'm ownerdrawing and need to draw the rangeselection - i can't see a built-in way to get the start and end x pixel coordinates (for a horizontal trackbar) for the rangeselectionstart and rangeselectionend values.
3. Here's a few of things I just had to implement myself by subclassing. These are probably outside the scope of your project but you may be interested in implementing them:
a) LMousedown behaviour on track. I needed to have value set to mouse x position, i.e. no large-scrolling - just immediate value set to nearest value for mouse position.
b) Repeated clicking LMouse button at the same position toggles value between nearest logical values above and below. I needed to stop that behaviour and just have value set to nearest logical value for mouse position.
c) If Shift key held down then LeftMousedown sets RangeSelectionStart value, RightMouseDown sets RangeSelectionEnd value. Same for mousemove (if shift+lbuttondown or shift+rbuttondown).
4. I can't find a way to lose the focus rectangle from the entire control. This looks like a MS thing but thought it worth mentioning.
Anyway, I worked around all of this apart from 1. and 4. which are minor things. This was after trying many other components and finding them all lacking in some showstopping way.
I'm trying to implement a trackbar with range selection and owner drawing. I've managed to do everything I absolutely need but had to jump through a few hoops to do it. I thought I'd post my wishlist so you know what is missing or is unnecessarily difficult in the current version.
1. There doesn't seem to be a way to owner draw the rangestart/end markers. Can this be added? Or is there a way? - The default markers are just too small
2. Can we have functions to calculate the x/y coordinate from a logical value and vice versa. For example, I'm ownerdrawing and need to draw the rangeselection - i can't see a built-in way to get the start and end x pixel coordinates (for a horizontal trackbar) for the rangeselectionstart and rangeselectionend values.
3. Here's a few of things I just had to implement myself by subclassing. These are probably outside the scope of your project but you may be interested in implementing them:
a) LMousedown behaviour on track. I needed to have value set to mouse x position, i.e. no large-scrolling - just immediate value set to nearest value for mouse position.
b) Repeated clicking LMouse button at the same position toggles value between nearest logical values above and below. I needed to stop that behaviour and just have value set to nearest logical value for mouse position.
c) If Shift key held down then LeftMousedown sets RangeSelectionStart value, RightMouseDown sets RangeSelectionEnd value. Same for mousemove (if shift+lbuttondown or shift+rbuttondown).
4. I can't find a way to lose the focus rectangle from the entire control. This looks like a MS thing but thought it worth mentioning.
Anyway, I worked around all of this apart from 1. and 4. which are minor things. This was after trying many other components and finding them all lacking in some showstopping way.