I am still a confused, however, about how the Eq2UIElement hierarchy works vis a vis the ui xml file structure. Looking at the Drums version of eq2ui_jounals_quest.xml...
It's legitimately confusing. Some of the UI structures are only divined via black magic and chicken entrails on a good day. (And UI modding experience, and lots of trial and error) It's been a long time since I trudged through that, so this post may or may not make any sense...
EQ2UIPage[Journals,JournalsQuest].Child[button,TabPages.Collection.CollectionTemplate.AddButton]
seems to correctly retrieve the add button (the Label member returns "Add" as expected), but the LeftClick method does nothing.
I think you've got your hands on the invisible Template used for each collection displayed in the Composite panel. Its add button in the template isn't wired to anything.
I have no idea what the difference is between these two approaches. Even more confusing is the fact I cannot "map" the widget hierarchy provided by uiyice to the structure defined by the xml file - based on the information in this file, it looks to me like the statement should be:
...
EQ2UIPage[Journals,JournalsQuest].Child[Page,TabPages].Child[Page,2].Child[Page,3].Child[Button,3]
vs
EQ2UIPage[Journals,JournalsQuest].Child[Page,TabPages].Child[Page,2].Child[Page,6].Child[Composite,2].Child[Page,1].Child[Button,3]
Your element #3 is the invisible CollectionTemplate
On the same page, Elemet #6 is the main Frame, that contains a Composite (Collection of pages, one for each collection), Page 1 of which is the first element (which is of type CollectionTemplate), where you find Button #3.
And I fully admit that I don't remember what the hell binds the Composite named CollectionComposite within the CollectionFrame, to the page named CollectionTemplate.
Also, when two collections match a filter (such as an Enchanted Gnoll Bone), I don't think I ever managed to get my hands on the second Add button.
1) There is more hierarchy in uiyice's statement than appears in the xml file - how was that additional hierarchy derived?
Composites and Templates (and chicken entrails). Also, don't overlook the NumChildren and ChildType elements of any page. They can be used to crudely 'browse' a page, figure out how many children it has, what type they are, and how they might line up with the XML file. Once you know a page has 3 children, Text/Composite/Scrollbar - it's easy to skim the UI file to figure out what you might have stumbled upon. (And if you touch a page the wrong way, you'll crash the client. It'll happen, you'll get used to it.)
2) Why does retrieving the button the way I did and the way uiyice did cause the LeftClick method to operate differently?
You found the CollectionTemplate. You need where it's embedded into a Composite.
3) It appears that the mouse cursor must be over the Eq2UIPage in order for any of this to work - is this correct? If so, is there some way to retrieve the screen coordinates/dimensions of a Eq2UIPage so the mouse can be automatically moved over it?
Hmm... I can't reproduce this. May futz later. How do you bring up the quest journal in the first place? (I use Item:Examine, and have Open on Loot checked).
4) I notice in the Amadeus's script, the appropriate mouse coordinates are manually determined by having the user place the mouse cursor over the "Add" button to record the position. Subsequently, the Lavishscript Mouse object is used to move the cursor to the recorded position and perform the click. Is there some reason the EQ2UIPage/EQ2UIElement objects were not used instead?
Possibly just different folks attacking problems different ways. Personally, I really hate to resort to coordinate based mouse clicking, but I've got a few scripts where I just couldn't figure out any other reliable way to get a job done... Amadeus might personally hate the EQ2Page hierarchy.
