Skip to main content
1-Visitor
Dec 26, 2019 12:57 PM UTC
Question

creo ui creation

Hi,

can any one tell me if creo parametric toolkit and creo object toolkit are different ? I am not able to load the .res file using ProUiDialogcreate function. 

 

Can uifcCreateDialog() function be used along with creo parametric toolkit application ?

or any other libraries to be added ?

 

Thanks

6 replies

17-Peridot
Dec 26, 2019 1:03 PM UTC

Hello!
I did not try with Creo Toolkit, but with OTK Java did.
Here is a snippet of my code:

public class Dialog extends DefaultUICommandActionListener
{	
 public static String OTK_SERVER_DIALOG = "TrainingUI";
 public static String OTK_CLOSE_BUTTON = "CommitCancel";
 public static String OTK_OK_BUTTON = "CommitOK";
 
 @Override
	public void OnCommand() throws jxthrowable
 {
	showDialog();
 }
 
 public void showDialog()
 {
	try
	 {
		/*
		 * Create a dialog from resource file and fill deatils of the Server , Workspaces and Cache			 
		 */			
		uifcComponent.CreateDialog(OTK_SERVER_DIALOG,OTK_SERVER_DIALOG);			
					
		uifcPushButton.PushButtonFind(OTK_SERVER_DIALOG, OTK_CLOSE_BUTTON).AddActionListener(new Close_listener());		
		uifcPushButton.PushButtonFind(OTK_SERVER_DIALOG, OTK_OK_BUTTON).AddActionListener(new OK_listener());
		/*
		 * Display and Activate Dialog.
		 * Please note that ActivateDialog() is a BLOCKING call here.
		 * uifcCoponent.ExitDialog() will unblock this
		 */
		uifcComponent.ActivateDialog(OTK_SERVER_DIALOG);	
		uifcComponent.DestroyDialog(OTK_SERVER_DIALOG);
	 } 
	catch (jxthrowable e)
	 {
		e.printStackTrace();
	 }
	
 }
 
}
Translate
Sekar11-VisitorAuthor
1-Visitor
Dec 27, 2019 6:06 AM UTC

hi,

thank you so much. did you refere 'otk_java' file in otk folder for reference ?

Translate
17-Peridot
Dec 27, 2019 9:37 AM UTC

Yes, I watched that example.
Also read this manual for Creo UI.

Best Regards!

Translate
15-Moonstone
Dec 28, 2019 4:52 PM UTC

Hi

 

Also in Creo TK it's possible to mix TK and OTK functions. We often use the TK functions to create a dialog, activate it and destroy it. We use the OTK functions for all connections and callbacks (be aware that not all destructors get called). So it's a matter of what you want to do.

 

Br,

Eike

Translate
Sekar11-VisitorAuthor
1-Visitor
Dec 30, 2019 6:06 AM UTC

Hi,

 

Is it like we need to use OTK functions for call back or can we use toolkit functions ?

 

Thanks 

Translate
15-Moonstone
Dec 30, 2019 4:05 PM UTC

You can use also ProToolkit call back functions for PushButtons e.g.. But remember, if you want to programm structured code the callback adress need to be in global space and not inside your instance. From the callback function you can then go back inside your instance by a pointer that is transfered over ProAppData.

 

e.g.

 

void callback {char * dialog, char * command, ProAppData data) {
 meow * cp = (meow *)data;
 cp->buttonCallback();
}

class meow {
public:
 meow () {
 //create Dialog
 // connect everything
 ProUIPushButtonActivateActionSet(dialogname, buttonname, callback, &this);
 ProDialogActivate(...);
 }
 void buttonCallback() {
 }
}

 

I haven't tested these ... just as an idea.

 

Br,

Eike

Translate