cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

XUI Images

berard
1-Newbie

XUI Images

Wondering if anyone has worked with images in XUI.

Specifically, I have a listbox with a list of image titles, and when
clicked, I want them to show below in a little preview window.

The problem I'm having is that my XUI is setup so that all of my toolsets
are contained within a <box>. Looking at the API, it seems that
<imagegroup> needs to be a child of <window>, which seems odd.

I also see <picturebox> that can take a ref, but I'm not sure if that
somehow means I need to create the <imagegroup><image> on the main window
(evidently hidden?), then reference it from the picturebox?

I'm able to do this pretty easily within the editor window by modifying my
dcf as follows:
<graphic element="vectorimage" entity="entityref" filename="fileref"/">

Then in the XML, I can insert a tag such as:
<vectorimage db_id="1" fileref="&lt;br"/>

The main kicker is that the image is dynamically created by a service,
based upon a passed-in ID. This works fine in the editor window, but
seems strange I can't simply put an image somewhere in my XUI dynamically
like this.

Any thoughts/help appreciated.
- keith
5 REPLIES 5

Hi Keith--

Yes, that's right. You define the images (and point them to graphic files) in the <imagegroup> at the top of the window, then use them by including a reference at the right spot. To see how this works, look at $ARBORTEXT/lib/dialogs/editwindow.xml, and see how they use images for toolbar buttons there.

(Note: toolbar buttons are a little weird, in that they tend to use one long graphic that defines all the button images smashed together, and the imagegroup specs tell them how to partition them out again. But you can also do it with one graphic file per image definition, which I suspect is more what you have in mind.)

I also have a vague memory of images that are switched dynamically not refreshing the way you might want. So you might have to do something awkward like hide and redisplay the graphic container after modifying the graphic reference. Sorry, it's been long enough now that I don't remember all the details.

Hopefully that will get you over the hump.

--Clay
berard
1-Newbie
(To:berard)

OK, I'll give that a shot.

Yeah, I mean, for my needs, I'm just going to get reference to the
imagegroup, remove all children each time, add the image, then set the ref
in the picturebox.

Now to brush up on my api's to get access to the window element... (my
code is also around 8yrs old, so it's a refresher for me as well).

Thanks Clay,
keith


ebenton
1-Newbie
(To:berard)

I am not a XUI expert, nor do I play one on TV, nor did I stay at a Holiday Inn Express last night.

We have a Toolbar (toolbar.xml) that uses images (icons) for the buttons.
We have the <imagegroup> child of <window> with <image> children for the <imagegroup>.
Each <image> has an id attribute which contains a name for the graphic and path attribute which contains the actual filename of the graphic.
We have a <toolbargroup> with a <toolbar> child which contains multiple <button> children.
Each <button> has an image attribute that contains the value of the id attribute from the appropriate <imagegroup>/<image> element.
The graphic files are located in the same directory with the toolbar.xml file.
This setup works perfectly for us.

I don't know how closely this matches what you are trying to do, but it might be a clue.

I've done this in the past by embedding an Editor ActiveX control on the XUI dialog, and using it to render a document of my doctype containing an empty graphic element, and updating that graphic reference's href and scaling attributes (so it fit in the window, and by calling a jscript function due to ACL's lack of floating-point support) as necessary. It wasn't fun, nor easy, nor altogether pretty (the Editor ActiveX control has a thick beveled border you can't remove), but that's the only way I could figure out to do it. In my case, I had to support any graphic format the Editor supported; if you've got a set format, and an ActiveX-capable viewer, that might be a more natural fit.

You can get a sense for how to work with embedded Editor ActiveX controls from $aptpath\packages\main\_entitiesdlg.acl and the related XUI at lib\dialogs\fileent.xml (which contains some embedded jscript code that exposes the various ACL Ids for the embedded window and document to the ACL code).

Chris
Chris Nitchie
(734) 330-2978
chris.nitchie@oberontech.com<">mailto:chris.nitchie@oberontech.com>
www.oberontech.com

[cid:image001.jpg@01CE6901.A84DFC50]

[cid:image005.png@01CE6903.8131DC70]<">https://twitter.com/oberontech>

[cid:image006.png@01CE6903.8131DC70]<">http://www.linkedin.com/company/oberon-technologies>






berard
1-Newbie
(To:berard)

Thanks for all the suggestions. I'm avoiding ActiveX for various reasons,
but even using the base tags, I think I've hit a wall.

Seems that while I can use a URL as the image path, there are a few things
I've noticed:

1) the <imagegroup> must come directly under the <window> tag, not just
appended somewhere as a child (minor, non-issue, but worth noting).
2) I can load and swap images, as long as the <image> is defined during my
initial XUI load.
3) I can't seem to load an image if I add the <image> after the fact, or if
I change the @path of the <image> after the fact.

Oh well, back to the drawing board.

- keith


On Thu, Oct 31, 2013 at 11:00 AM, Chris Nitchie <
chris.nitchie@oberontech.com> wrote:

> I've done this in the past by embedding an Editor ActiveX control on
> the XUI dialog, and using it to render a document of my doctype containing
> an empty graphic element, and updating that graphic reference's href and
> scaling attributes (so it fit in the window, and by calling a jscript
> function due to ACL's lack of floating-point support) as necessary. It
> wasn't fun, nor easy, nor altogether pretty (the Editor ActiveX control has
> a thick beveled border you can't remove), but that's the only way I could
> figure out to do it. In my case, I had to support any graphic format the
> Editor supported; if you've got a set format, and an ActiveX-capable
> viewer, that might be a more natural fit.
>
> You can get a sense for how to work with embedded Editor ActiveX
> controls from $aptpath\packages\main\_entitiesdlg.acl and the related XUI
> at lib\dialogs\fileent.xml (which contains some embedded jscript code that
> exposes the various ACL Ids for the embedded window and document to the ACL
> code).
>
> Chris
>
> *Chris Nitchie*
>
> (734) 330-2978****
>
> chris.nitchie@oberontech.com
>
> www.oberontech.com****
>
> [image: cid:image001.jpg@01CE6901.A84DFC50]
> ****
>
> [image: cid:image005.png@01CE6903.8131DC70]<">https://twitter.com/oberontech>
> ****
>
> [image: cid:image006.png@01CE6903.8131DC70]<">http://www.linkedin.com/company/oberon-technologies>
> ****
>
>
>
>
>
>
Top Tags