×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

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

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. www.sandvik.com
HP EliteBook 8760w, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP4 64bit
Testing: NX9.0.2.5

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

(OP)
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!

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

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. www.sandvik.com
HP EliteBook 8760w, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP4 64bit
Testing: NX9.0.2.5

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

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources