Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a menu display various data entries without using UI STYLER?

Status
Not open for further replies.

lugan2

Mechanical
Apr 10, 2013
42
0
0
GB
Hello all

I am aware that the normal way of creating a customized menu in UG is through UI Styler. That is:
1)define the frame and data entry items in the UI styler interface;
2)creating dlg/dlx file as the result;
3)modify the .men file to call the menu at startup stage; and,
4)define the callback functions associated to the created menu.

However, if one wants to do it more pragmatically, namely:
1) define a framework as a data container to hold all the data entries using UI styler;
2) save the result dlg/dlx file;
3) write nxopen-c++/nxopen-c code to add data entries(such as data property entry or toggle button) onto the data container, pragmatically. How would one do that?

I tried to find if there is a member function under (NXOpen::BlockStyler::Group)theDialog->TopBlock() like "addmenu" or "addtogglebutton", something like that to create a new data entry in real-programming-time, but there is no such functions.

Could anyone suggest what should I do please, if there any function in UF or NXOpen can achieve that? I think there must be some underline coding behind all these manual dialog and menu-item creating operations, right?
Many thanks!
Gan
 
Replies continue below

Recommended for you

I understand you can build dynamic BlockDialogs with SNAP, but I've never used SNAP.
As for C/C++/C#/VB/Java I think you're out of luck. Instead you have to create your own custom dialog from scratch. Depending on the language this might be WinForms or something else.
We mainly develop in Java and when building a dialog at runtime was necessary we've done a couple of projects like this using SWT, Swing or JavaFX.

Graham Inchley, Systems Developer, Sandvik Coromant. HP EliteBook 8760w, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP4 64bit
Testing: NX9.0.2.5
 
Hi grinch,
Thanks for the reply.

So I guess the answer is NO then? I was hoping that UG Open must have developed some APIs to interface with these menu-display widgets.
I will wait a bit longer to see if anyone else can offer some suggestion. Otherwise, I have to find the alternatives.

Thank you!
 
Using UISTyler or BlockStyler the best I've come up with is to design the dialog with the maximum number of instances of whatever controls you might want to add (eg Double input box) and simply hide some or all of them. Then when you want to add a new Double input, unhide one of the hidden ones.
I know this is really crappy and relies on having prior knowledge of what might be required in the future, but thats how it is.
Like you I would REALLY like it if we could dynamically add controls to a BlockDialog, it would save a ton of work writing a whole custom dialog, but right now its not possible.

Graham Inchley, Systems Developer, Sandvik Coromant. HP EliteBook 8760w, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP4 64bit
Testing: NX9.0.2.5
 
Ok Grahm, thanks for the reply, very clear now. So would still hope that in the feature UG may provide more API functions to interface with the dialog and other widgets.

Many thanks!
Gan
 
Status
Not open for further replies.
Back
Top