The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Xfunction access in C

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tinkusch Posted - 07/07/2021 : 1:26:39 PM
Origin Pro 2018G (64 bit)SR1
Operating System: Win10

I created an example xfunction with a GUI (gui_controls) from the examples in the manual. The GUI pops up and works fine with Labtalk but cannot be brought to display via an Origin C call.

I tried the below C-function with the result, that the output tree was just printed to the script window without opening the GUI.
Would be nice to get a hint.
Best,
Stefan

bool call_XF()
{
XFBase xf("gui_controls");
if (!xf)
return false;

Tree tr;
TreeNode trGetN;
xf.GetGUI(tr, trGetN);
xf.Run(AU_AUTO, trGetN);
return true;

}
6   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 07/13/2021 : 8:04:26 PM
XF.run was introduced primarily to support recalculate, so if calling Run with AU_NONE, then it is essentially the same as Evaluate, but if AU_AUTO, it does not actually evaluate the XF but just construct the recalculation framework and let the recalculate to run the XF.

CP

tinkusch Posted - 07/13/2021 : 04:44:53 AM
quote:
Originally posted by cpyang

If you just need quick dialog, then just use GetNBox from OC, much simpler, and faster since XF has its overhead.

Most Apps from us are using HTML dialog from OC with some javascript.

You can also make an XF for your app and just launch the XF from the launch script.

If you need to get into GetNBox event handler, use the Ex3 on this page for the most comprehensive support

https://www.originlab.com/doc/OriginC/ref/GetNBox#Examples

CP




Thanks CP, I'll work with GetNBox.
But just for my understanding. Could you please describe the difference between XF.run and XF.evaluate?
Thanks
Stefan

cpyang Posted - 07/09/2021 : 4:59:22 PM
If you just need quick dialog, then just use GetNBox from OC, much simpler, and faster since XF has its overhead.

Most Apps from us are using HTML dialog from OC with some javascript.

You can also make an XF for your app and just launch the XF from the launch script.

If you need to get into GetNBox event handler, use the Ex3 on this page for the most comprehensive support

https://www.originlab.com/doc/OriginC/ref/GetNBox#Examples

CP
Castiel Posted - 07/09/2021 : 10:58:10 AM
quote:
Originally posted by tinkusch

Origin Pro 2018G (64 bit)SR1
Operating System: Win10

I created an example xfunction with a GUI (gui_controls) from the examples in the manual. The GUI pops up and works fine with Labtalk but cannot be brought to display via an Origin C call.

I tried the below C-function with the result, that the output tree was just printed to the script window without opening the GUI.
Would be nice to get a hint.
Best,
Stefan

bool call_XF()
{
XFBase xf("gui_controls");
if (!xf)
return false;

Tree tr;
TreeNode trGetN;
xf.GetGUI(tr, trGetN);
xf.Run(AU_AUTO, trGetN);
return true;

}




xf.OpenGetNDialog() or something like that


------------------------------------------
       Be The Change
             You Want To See
                   In The World
------------------------------------------
tinkusch Posted - 07/09/2021 : 05:23:58 AM
quote:
Originally posted by cpyang

XF was implemented for using from LT, so can you show some code to show why you need to use it this way from OC?

CP




Hi,
my aim is to create a dialog for an ORIGIN-App. OC-code provides better speed of the intended lengthy calculations with large matrices. I have seen other apps working also with dialogs, but as the code is not available it is however not clear to me how the dialog was created and handled. I thought an XF GUI would be an easy way for this.

Anyway, meanwhile I have found the OC GetN dialog option for creating dialogs, that will definitely do...
I have for what reason ever completely overlooked this up to now .

But just for clarity: is there a way to call an XF with a dialog from OC or do I have to use LT? OC help could probably describe the options in more details. For the XF.evaluate command dialog output is explicitly excluded, but one may learn this only from the comments in the code of the "Example with Controlling X-Function Settings Tree" in OC Help. However, there is also an example for running XF functions via the XF.run command. What is the difference between these two options?


Stefan
cpyang Posted - 07/08/2021 : 8:24:28 PM
XF was implemented for using from LT, so can you show some code to show why you need to use it this way from OC?

CP

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000