srod, I will try your method even though it looks so brutal. FYI: I may be wrong but I thought there would be individual events for "scroll" and "changed". In this specific case I either manually/programatically change the trkbar position and want to capture a "changed" event which is then used to update a text control with the trkbars value. Once done I don't/won't need to consider the text control again, just the trkbar, from where ever I decide to update it from.
Yes I could splatter code around to achieve this or even wrap the SetGadgetState() in a SetTrackBar() proc but in more general cases this becomes messy I suspect it's not needed. Any win gui gods want to comment?
Trackbar and SetGadgetState
It was some kind of changed event that I was looking for. In a way, I wouldn't be surprised if this does not exist in this case, because of, well because of the comments we've all made here.
Certainly the windows message with code 312 seems to fire specifically for the trackbar (in this case) and fires at the desired time. Indeed it seems to fire whenever the control requires some kind of updating; painting etc.
Maybe someone can shed some info on this message.
Certainly the windows message with code 312 seems to fire specifically for the trackbar (in this case) and fires at the desired time. Indeed it seems to fire whenever the control requires some kind of updating; painting etc.
Maybe someone can shed some info on this message.
I may look like a mule, but I'm not a complete ass.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
-
- User
- Posts: 82
- Joined: Tue May 03, 2005 2:51 am
- Location: Wheeling, Illinois, USA
- Contact:
Re: Trackbar and SetGadgetState
dmoc wrote:I have a trackbar that is used as an indicator, ie, changed using SetGadgetState(). What EventType/#WM_???? tells me it has changed? I want to update a text control when the bars value changes, possibly from several places so I want to capture an event.
That all seems so complicated to me. If you are using SetGadgetState() why not also use SetGadgetText() next?
You should probably create two trackbars (at the same location) and just Hidegadget() the one you are not using.dmoc wrote:Another situation is where a trackbar is used for both input and output (at different times).
All IMHO
Rand
We now return to our regularly scheduled programming...