injectMouseMove()

Jekteir

29-01-2009 23:39:11

Heya, I'm working off 9.01 right now and it looks like GUIManager::injectMouseMove() is protected. I would like to inject relative co-ordinates -- is there a reason why this is not available?

Good to be back, btw... Just reinvigorating my project with the latest round of code now. QuickGUI sounds good (haven't seen it yet, as I have to strip out/convert the reams of code that no longer work with it, and set up new systems).

Jek

Jekteir

30-01-2009 00:08:11

Incidentally, is there anything that will allow me to duplicate this functionality in the current version of QuickGUI?

std::vector<QuickGUI::Widget*> *childWidgets = widgetPointer->getChildWidgetList();
I want to iterate through a widget's children so that I can perform commands on them.

Jek

kungfoomasta

30-01-2009 00:25:43

Welcome back!

I forgot the reason why I made it protected. Is this a really big inconvenience, or could you make a function that converts relative values into global coords? I will look into it and see why I made that decision.

Regarding the request for access to children, I'll add that in.

Hope you like the new version. Make sure to read the wiki articles, there are only 2 or 3 of them, and they're really short, but show sample usage.

Jekteir

30-01-2009 00:36:15

Yeah, thanks for the wiki stuff, I've been using it to good effect (well, good enough to let me compile anyway ; ).

I can use absolute co-ords (I am now) but I had been using a system that modifies the amount moved according to a mouse sensitivity setting, so it was useful to get the relative co-ordinates, modify them and pass them on rather than dealing with the absolute ones. I may be changing this anyway, as I'm starting to wonder if that would be likely to create a disjunction between where OIS thinks the mouse is and where QuickGUI thinks it is (although that might not matter in the long run anyway).

Cheers for the iteration thing -- I'll be needing that.

One thing I'm wondering about from the point of view of (in future) reading sheets from file and using them: will there be a way to store in the sheets references to callback functions? I'm using one sheet per application area (e.g. one sheet for world editor, one sheet for main menu) and will need difference sheets to use different callbacks. Obviously it would be great if there were some way of storing that information, rather than setting it programmatically myself for each function/GUI widget when loading the sheet...

Jek

kungfoomasta

30-01-2009 18:21:54

Unfortunately I don't know of any way to store callbacks, they are essentially function pointers, which I may not be the same every time. I don't think I can get around the work flow of loading a sheet via file, then grabbing widgets and adding event handlers.

Jekteir

30-01-2009 18:25:00

Heya, please see the new thread

viewtopic.php?f=13&t=9144

as I have a suggestion for a method for this!

Jek

kungfoomasta

31-01-2009 09:42:05

Incidentally, is there anything that will allow me to duplicate this functionality in the current version of QuickGUI?

std::vector<QuickGUI::Widget*> *childWidgets = widgetPointer->getChildWidgetList();
I want to iterate through a widget's children so that I can perform commands on them.

Jek


There already exists this function:


/**
* Returns a list of all child widgets.
*/
std::vector<Widget*> getChildren();


Only widgets that derive from ContainerWidget will have this function. Common examples: Sheet/Window/Panel

Jekteir

31-01-2009 12:49:51

The reason I need this is to be able to disable all the widgets on a sheet except for the ones within a particular window. If I start at the sheet, will I be able to recurse down and disable all other widgets using this function?

What I'm doing is recreating the greyed-out effect you get when a popup box comes up that you have to deal with before you can use any part of an application. Do you know of a way to do this successfully in QuickGUI? My original method worked fine with the previous version.

Jek

##edit -- above i said 'recurse', by which I meant that I wrote my own recursive function which used your iterator. I'm not asking for a recursive QuickGUI function, just the iterator functionality that was there before that allowed you to get at all widgets within the gui.###

kungfoomasta

31-01-2009 20:06:57

When a widget is disabled, it can no longer be detected by the mouse cursor. If there are child widgets, they will not be detected either.

As for the greyed-out effect, I think I will update the Panel/Window/Sheet skin so that a texture can be drawn over its area, after components and children have been drawn.

Have you tried the ModalWindow? It's specifically designed to receive all input, so you cannot do anything else until the ModalWindow becomes invisible (dismissed or destroyed).

Jekteir

31-01-2009 21:35:41

No, I didn't know about the modal window. I'll try that out.

Cheers,

Jek