ComboBox : Compute the items list on selection

dessibull

23-07-2010 09:40:31

hi

I have got a list of comboxBox with variable list of item. I would like to compute the particular items list of a comboBox when its button is pressed . But I haven't found the event generated by the dropdown of the comboBox. I went with this solution :


currentComboBox->addWidgetEventHandler(QuickGUI::WIDGET_EVENT_MOUSE_CLICK,&OgreStatePreMetaphorAction::ComputeComboBoxItems,this);


but it is not working and finally got this one :

currentComboBox->addWidgetEventHandler(QuickGUI::WIDGET_EVENT_MOUSE_BUTTON_DOWN,&OgreStatePreMetaphorAction::ComputeComboBoxItems,this);

but not very satisfying

Does a method exist to track down each event generated by a specific widget?

thanks for your answers

kungfoomasta

23-07-2010 18:58:38

I'm not sure what you mean. You can add handlers for MOUSE_BUTTON_DOWN for each item in your combobox.

The problem with MOUSE_BUTTON_DOWN vs MOUSE_CLICK is that the mouse button must go down and then back up before a click is registered. When you mouse button down over the combobox list items, the drop down list disappears, so the mouse button up will never occur over the items, and likewise a click event will never occur.

A possible alternative would be to have all drop down lists and menus disappear on mouse button up event, instead of down, and then you could get click events fired. But it means users will have to mouse button up over menu items and drop down list items in order to select them. Not sure what is expected/norm behavior in this case.

dessibull

23-08-2010 09:47:08

Sorry for this long interruption but I was in vacation and didn't see your answer ...

I might be not enough clear about my problem and I want to apology for the misunderstanding.....

In fact, I have got a page with long list of label (showing an interaction of my game like" go up") and a corresponding comboBox (listing all events of a specific peripheral like the keys for a keyboard). But when I switch to an other peripheral, I have to re compute the item list of all my comboBox (to show Mouse interraction for example) which takes a certain among of time.

My current solution is to have all my comboBox empty on the loading of the page and fill the item list when the user want the dropdown of the list.

With the solution above the fill off the list is only done when I click on the text of the comboBox and not when I click on its button. It is why I am trying to track the click of the comboBox button

kungfoomasta

23-08-2010 19:49:56

Ah, I think I understand what you're saying. You're trying to differentiate pressing the Drop Down Button vs pressing the ComboBox area around the button.

Looking at the code base, there doesn't seem to be a way to get access to the Button widget that is a part of the ComboBox. I will try to address this in the next release of QuickGUI. (Post 10.8 release)

dessibull

24-08-2010 07:22:13

that is exactly what I wanted .... I'll try another solution to resolve my problem.

thanks for your time