PDA

View Full Version : Question relating to widgets.



drahkar
December 31st, 2010, 13:45
Is it possible to setup widgets so that you can type a character in it and have that character be usable?

For example. If I make a widget on a core stat, and wanted to manually type a modifier number into it, can we do that? Or does it have to be marked in the process of generating the widget?

Thanks for the help in advance!

Bidmaron
December 31st, 2010, 17:04
That could be done by overloading the intrinsic widget onClick at the very least. By looking at the code others have done to support 'zooming' a control to adjust its numeric value, you should be able to get a basic idea of how to go about it. I would be surprised if someone hasn't already written code to do exactly what you are proposing....

drahkar
January 1st, 2011, 09:55
There weren't very many posts detailing the use of Widgets which is, of course, why I was asking in the first place. I was hoping someone would have quick answer that prevent me from having to spend a lot of time researching and testing.

As to what I've found, unfortunately widgets are not like windowclasses. They don't have onClick functions and the like. They have a very limited scope of functionality and do not inherit any of the windowclass context because they are a widgetcontainer functions, not a windowinstance context.

Bidmaron
January 1st, 2011, 14:51
Sorry to have misled you. I think the only option is to handle the interface in the parent control. The d20_jpg character sheet makes extensive use of widgets (and I assume 4e, but I don't use that), so you might check there to see how Moon_wiz handled his interactions.

drahkar
January 1st, 2011, 14:53
I know on the systems in the past they involved a lot of dragging of numbers to the score to create the widget. I was just hoping to avoid that. What i might do is create some dialog code that I can use to create a entry field of some sort. I'll have to play with it and find out what it will accept.