DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

It's possible to access dialog objects from a child dialog?

Thing is that in DIAdem I have a main SUD dialog, from this I open another dialog, from which I would like to read some object properties from the main dialog…

 

Is that possible? If yes, how can I do it?

 

Thanks in advance,

Marc.

0 Kudos
Message 1 of 9
(4,383 Views)
Hello Marc,

I am afraid this is not supported. You cannot reference one dialog from the other. If you try referencing objects of another dialog in the way dlgname.objname.propery you get an error message.

regards
Ingo
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
Message 2 of 9
(4,373 Views)

Thanks for the information and one more question:

 

It's possible to hide the main dialog or to move it to another screen position when the child dialog is open?

 

Best regards,

Marc.

0 Kudos
Message 3 of 9
(4,360 Views)
Hi Marc
 
you can use the methode hide and show to hide and show the dialog. But you have no chance to set the show command from the subdialog.
You can use the methode move to move the dialog but you can not change it from the sub dialog, too.
 
Sub Button1_EventClick
  Call Dialog.Hide()
  Call Pause(5)
  Call Dialog.Show()
  Call Dialog.Move(10, 20)
End Sub
 
Hope this helps
Winfried
 
0 Kudos
Message 4 of 9
(4,355 Views)

Hello Marc,

each SUD-Dialog has its own script-engine. So you can only access variables or objects when running its Dialog (its script engine). Changing data between dialogs (also changing data between DIAdem and dialogs) is only possible by using DIAdem-Variables (pre-defined like L1, user-defined in a vas-file or dynamic DIAdem variables). You know it for sure.

There are ten DIAdem variables named o1 .. o10 with the type 'variant'. You can store script objects in this variables. Using this DIAdem variables you can change objects between several script engines: DIAdem to dialog or what you want: dialog to dialog.

Example:

Bevor you start the second Dialog:

set o1 = editBox1

sudDlgShow ...

In the second Dialog you can access the editBox from the first dialog:

msgbox o1.text


Andreas Weiland
Projektingenieur
measX GmbH & Co. KG
, www.measX.com
Message 5 of 9
(4,343 Views)

Hi,

 

Sorry but this doesn't work, we are talking about DIAdem and a SUD dialogs...

 

I found how to move the dialog, using the Left and Top properties and also with these properties you can move the dialog out of the screen that is almost the same than to hide it… there is any other way to hide the dialog?

 

The properties Left and Top are available on DIAdem 9.1 but not on DIAdem 8.1 dialogs, does any one know how to move or to hide a dialog with that version?

 

Thanks,

Marc.

0 Kudos
Message 6 of 9
(4,338 Views)

Andreas,

That works, you are a genius...

Sorry to continue bugging you, but I have more questions. As you said it’s necessary a DIAdem-Variable, then my question is:

 

It’s possible to create a variant DIAdem variable in a VAS file? There is any other way?

 

In DIAdem 9.1 we can use o1...o10  variables, but how I can do that in DIAdem 8.1?

 

I know it’s a crap but my code has to work with booth versions…  :((

 

Best regards,

Marc.

0 Kudos
Message 7 of 9
(4,331 Views)

Hello Marc

Update! Sorry, but it dont work. You can not store dialog-controls into the o1 variable. It words only once. The second time, i store a control in this variable an error occured. I must restart DIAdem bevor i can use the variable o1 again. Dont know the reason.

You can not create a variant-variable in a VAS-file. In DIAdem 9 you can create a DIAdem-variant-variable using the command "globalDim".

The o-variables and the command "globalDim" are features in version 9 of DIAdem. It will not work with DD8.

I see no simple way to solve your problem (working with DIAdem 8 and 9). You must sore each data in its own variable or use a self-defined object structure to do this.

sorry, hope it helps


Andreas Weiland
Projektingenieur
measX GmbH & Co. KG
, www.measX.com
Message 8 of 9
(4,309 Views)

Hi Andreas,

 

I see the problem, any way thanks for your interest. Finally I will store all needed information fom the dialogs into my own DIAdem variables. That will be also very useful for me because I have to close the dialog and to open it again with the previous information in order to activate the interaction mode, that is not possible while the dialog is active.

 

Best regards,

Marc.

0 Kudos
Message 9 of 9
(4,300 Views)