Pages: 1
Print
Author Topic: Dynamic UI  (Read 4294 times)
sapraaman
Member

Posts: 17


« on: June 16, 2010, 10:24:58 PM »

Hi,

Since it is not possible to show "Attribute Inspector" as a modal dialog, we are implementing a custom xft form. I have few questions.

1. I want to create UI controls on the fly (during launch of xft form) and add it to the dialog.
2. I want to be able to add event handlers to those controls.

Is it possible in XMetal developer 5.5? Basically, we are trying to build a general purpose modal dialog.

Thanks,
Aman
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: June 17, 2010, 03:15:29 AM »

No, this is not possible as far as I know. The best you can do is to place more controls on your form than you will ever need and then either hide / show them, or move them off screen / on screen by altering the value of the left property.

The alternative would be to create an ActiveX control with GUI (using VB or similar), distribute that as a DLL, OCX, or EXE, and launch it from script.
« Last Edit: June 17, 2010, 11:54:26 AM by Derek Read » Logged
fjeneau9
Member

Posts: 14


« Reply #2 on: July 29, 2010, 10:23:12 AM »

Is it possible to create an XFT form object in code (no external XFT file) via XMetaLs' API's?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: July 29, 2010, 01:52:14 PM »

Do you mean programmatically generate the XFT file and then have XMetaL load it?

XFT is a binary file format so generating it correctly via script would be very difficult and the file format is undocumented so you would need to reverse engineer an existing form to figure out how to generate one. I don't think it is worth trying.

Can you let me know why you feel the need to do this? ie: What problem will this solve for you?
Logged
fjeneau9
Member

Posts: 14


« Reply #4 on: July 29, 2010, 11:28:31 PM »

Hi Derek,

We wanted to create a form (modal dialog box) which generated checkboxes and resized based on how many elements were returned via Application.ActiveDocument.getElementsByTagName("<element name>");

In the end, I went with your first suggestion to create extra hidden controls and set the code to unhide them when appropriate.  All is well with that, so thanks!

Now my only issue is how to pass the value returned from the On_Click event of a button into a variable resting within the macro that opened the form.  The value is an array containing the indices of the selected items.  Perhaps I should just check Dlg.DoModal() == 1 and check the values of each checkbox within the macro code?
« Last Edit: July 30, 2010, 08:29:23 AM by fjeneau9 » Logged
Pages: 1
Print
Jump to:  

email us