TrackBar::onValueChanged no trigger?

interfoz

16-08-2007 05:08:18

tb = mSheet->CreateTrackBar(vector4(.......));
tb->SetNumregions(100);
tb->addOnValueChangeEventHandler( &classA::vc, this );

but not trigger to my function

why?

ver 0.9.5

kungfoomasta

16-08-2007 05:20:40

I think v0.9.5 was when I first created the TrackBar widget. (Or was it v0.9.4?) Anyhow, I forgot to fire the event, so the event handlers are never called. This was fixed.. I forgot what version has the fix. Either way, you should update to v0.9.6 Beta, there are a lot of changes between versions, and v0.9.6 will be a pretty important change.

Sorry I couldn't be more helpful. If the problem still exists with the latest release I will hunt down the problem and fix it. :)

interfoz

16-08-2007 09:00:44

bingo

thanks!

ps:

i would like add value identified by custom to event handler function to manage control array


for example
for(int i=0;i<9;i++){
Button.AddEventHandler(EVENT_MOUSE_BUTTON_UP, &ClassA::fun,this, i);
}

bool class::fun(EventArgs& args, long ci)
{
switch(ci)
{
case 0;
Button[0]........

kungfoomasta

16-08-2007 18:46:44

If you know that this event handler always occurs when a mouse button goes up over a widget, you can cast the EventArgs to MouseEventArgs:

const QuickGUI::MouseEventArgs* mea = static_cast<const QuickGUI::MouseEventArgs*>(&args);

MouseEventArgs derives from WidgetEventArgs, so you can obtain the actual widget that was clicked:

mea->widget

In v0.9.6, EventArgs also have a type, if you want to do a safety check to see if you can safely cast the EventArgs to its correct type.

interfoz

17-08-2007 04:23:59

i see,thanks