PDA

View Full Version : Accessing a control from a suboordinate list entry



AmadanNaBriona
May 16th, 2020, 01:51
My ct_entry window has a button control called npcoption and a windowlist control ct_weaponcombat. ct_weaponcombat has windowlist entries of class ct_weapon.

ct_weapon has another button control called adjdx.

Basically, I want a function in adjdx to set the value for npcoption. I have not been able to figure out how a control in a windowlist that is part of another window can "reach" a control in the windowlist's "grandparent."

AmadanNaBriona
May 16th, 2020, 03:02
Further investigation: I am able to access the databaseNode bound to the aforementioned ct_entry window, but its children do not include npcoption, so apparently that control has not been bound to a databasenode itself?

Moon Wizard
May 18th, 2020, 09:15
Button controls are not data-bound, whereas button fields are data-bound.

Regards,
JPG

AmadanNaBriona
May 18th, 2020, 14:45
buttonfield vs. buttoncontrol!!!!! Aaaargh, so simple! And so missing from the documentation.

Thank you - that little change worked after I spent literally hours trying to climb up and down the database tree, create event handlers, and various other hacks, when I could have just looked at some examples of buttonfields. But in my defense, this page (https://www.fantasygrounds.com/refdoc/buttonfield.xcp) is not even indexed in the main refdoc - in fact, I can't find a single reference to it anywhere in the API (which, btw, has no search function?) I found it by manually typing the word "buttonfield" in place of buttoncontrol, on a guess.

I know I'm a noob at developing FG rulesets, but there are a lot of things the reference docs could do to make it easier to find stuff. For example, each control lists what it inherits from, but does not list things that inherit from it (i.e. its own "subclasses") which would have been really useful in several other instances.

Moon Wizard
May 18th, 2020, 23:32
Interesting enough; the very short description page was built for old wiki API reference but didn't get added to side menu. I've added to the old wiki reference for now.

I've asked Doug to add to the new wiki reference too.

Thanks,
JPG

Moon Wizard
May 18th, 2020, 23:39
And Doug even improved the layout of the wiki reference page for us while he's working on it.
https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4096257/Developer+Guide+-+Ruleset+API+Reference

JPG