Showing results for 
Search instead for 
Do you mean 
Reply

Close BlockStyler Dialog using code

[ Edited ]

I'm starting work on a large project that will use a BlockStyler dialog to allow users to select one of a number of different, but very similar functions.

Not sure how they will select these different functions yet, but for simplicity just imagine a series of Action Buttons, one for each function. When the user clicks an Action Button a new secondary BlockStyler dialog will open and allow data input, object selection etc.

Once the users clicks OK on this secondary dialog it will close and the code will drop back into the update callback of the main dialog and continue execution.

However, rather than continuing, I would like the main dialog to close at this point. Is it possible to close a BlockStyler dialog by calling a method on it?

 

I did investigate an alternate approach where the functions were selected using check boxes or radio buttons on the main dialog, then letting the user click OK. But it is not possible to open the secondary dialog from the OK calback.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5
17 REPLIES

Re: Close BlockStyler Dialog using code

 

Graham,

 

Good morning.  We don't have a way to let you shut down the dialog via code.  Keep in mind that if you had access to something like a "perform_cancel" method, then if you did cancel the first dialog, the expected behavior would be that all of the actions taken while the second dialog was visible would be undone.

 

However, you could design the first dialog to have only a "Close" button, rather than OK, Apply and Cancel.  That way although the user would have to press the button, NX would not try to undo whatever you did in the second dialog.  For an interactive example of this, see the Layer Settings dialog.  Close acts like OK, in that your actions while the dialog was up are retained.

 

Regards,

 

Steve

 

Re: Close BlockStyler Dialog using code

OK, thanks Steve.
At least I won't waste any more time investigating..
Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Close BlockStyler Dialog using code

...although a perform_ok() would have been nice Smiley Frustrated

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Close BlockStyler Dialog using code

I don't see the need for the first dialog in the first place. If all it will contain is a series of buttons, how is that functionally different from a new ribbon tab containing the same series of buttons?

 

In general, Block Styler support of nested dialogs is almost non-existent because that style of GUI design is highly discouraged. Block Styler provides layout options such as Tabs, Explorer and Wizard that can be used in lieu of nested dialogs.

Re: Close BlockStyler Dialog using code

Well I can't have a new ribbon being as we're on NX8.5.

As for Tabs, TreeList and Wizard I wanted to avoid the complexity of having to handle the callbacks for all of the blocks in one source. Having separate dialogs means I can have the secondary dialogs almost as separate applications, just launched froma single point of contact.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Close BlockStyler Dialog using code


Inch wrote:

Well I can't have a new ribbon being as we're on NX8.5.


What does speak against a separate tool bar?

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Close BlockStyler Dialog using code

As I said at the start I'm at the beginning phase of this project and exploring ideas. So I'm not discounting the idea of completely separate projects for each function and having an individual toolbar for these.

But there is the potential for some common functionality between the functions that would be better handled within a single project rather than having a library project used by all.

Now I know that closing the dialog using code is impossible, I can continue the planning, which might or might not end up with separate projects.

Anyway, thanks for your views.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Close BlockStyler Dialog using code

A DLL run from a tool bar button or menu bar item gets the UID (name) of the menu item supplied as the argument, so you can build one DLL performing multiple tasks.

 

I would consolidate the dialogs with similar items to reduce the number of projects.

 

For shared code, you could use similar things like a C header file in other languages, like libraries in .NET

 

There is nothing engraved in stone, the limit is your imagination Smiley Wink

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Close BlockStyler Dialog using code

 

"...the limit is your imagination"

 

Unless you find yourself imagining a function to close a Styler dialog...

 

8-)