Skip to main content
1-Visitor
December 26, 2019
Question

creo ui creation

  • December 26, 2019
  • 2 replies
  • 2849 views

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

2 replies

17-Peridot
December 26, 2019

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();
	 }
	
 }
 
}
Sekar11-VisitorAuthor
1-Visitor
December 27, 2019

hi,

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

17-Peridot
December 27, 2019

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

Best Regards!

15-Moonstone
December 28, 2019

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

Sekar11-VisitorAuthor
1-Visitor
December 30, 2019

Hi,

 

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

 

Thanks 

15-Moonstone
December 30, 2019

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