How to get reference to selected display object?If I use the selection tool to manually select a display object in a report or journal window, how do I get a reference to that selected item?
What I would really like to do is to have an add-in that copies the selected item as an image and puts that image into a journal.
Re: How to get reference to selected display object?It doesn't look like there is a way to directly ask a displaybox if the selection attribute set. Which is odd, because you can set it and clear it. @XanGregg @audrey_shull
It does look like XPATH can tell, at least sometimes. This is my first venture into XPATH, so I'm probably missing something obvious. Run lines two and three after selecting aaa or bbb with the selection tool.
x=newwindow("x",hb=hlistbox(textbox("aaa"),textbox("bbb")));
show(hb<<GETXML></GETXML>if I select just aaa, or just bbb, it reports the correct box. If I select both, I get nothing. Maybe an XPATH expert can point the way. @davidbarbour
hb << getxml = "
aaa
selected=\!"true\!">bbb
";Re: How to get reference to selected display object?Found it. Move up higher in the display box tree, probably to the root. For example
((hb<<PARENT></PARENT>
Apparently the individually selected items propagate up to the containing node.
(hb << parent) << getxml = "selected=\!"true\!">
aaa
bbb
";Since A and B were selected, which are all the children of the hlistbox, It became selected, but it is also all of the children of another listbox, which became selected. Probably need to try a few more examples to be sure.