//------------------------------- DIALOG LAUNCHING --------------------------------- // // Before invoking this application one needs to open any part/empty part in NX // because of the behavior of the blocks. // // Make sure the dlx file is in one of the following locations: // 1.) From where NX session is launched // 2.) $UGII_USER_DIR/application // 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly // recommended. This variable is set to a full directory path to a file // containing a list of root directories for all custom applications. // e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_BASE_DIR\ugii\menus\custom_dirs.dat // // You can create the dialog using one of the following way: // // 1. Journal Replay // // 1) Replay this file through Tool->Journal->Play Menu. // // 2. USER EXIT // // 1) Remove the following conditional definitions: // a) #if USER_EXIT_OR_MENU // #endif//USER_EXIT_OR_MENU // // b) #if USER_EXIT // #endif//USER_EXIT // 2) Create the Shared Library -- Refer "Block UI Styler programmer's guide" // 3) Invoke the Shared Library through File->Execute->NX Open menu. // // 3. THROUGH CALLBACK OF ANOTHER DIALOG // // 1) Remove the following conditional definition: // #if CALLBACK // #endif//CALLBACK // 2) Call the following line of code from where ever you want to lauch this dialog. // ToolHolderDialog.Show_secondDialog(); // 3) Integrate this file with your main application file. // // 4. MENU BAR // // 1) Remove the following conditional definition: // a) #if USER_EXIT_OR_MENU // #endif//USER_EXIT_OR_MENU // 2) Add the following lines to your MenuScript file in order to // associate a menu bar button with your dialog. In this // example, a cascade menu will be created and will be // located just before the Help button on the main menubar. // The button, SAMPLEVB_BTN is set up to launch your dialog and // will be positioned as the first button on your pulldown menu. // If you wish to add the button to an existing cascade, simply // add the 3 lines between MENU LAUNCH_CASCADE and END_OF_MENU // to your menuscript file. // The MenuScript file requires an extension of ".men". // Move the contents between the dashed lines to your Menuscript file. // // !----------------------------------------------------------------------------- // VERSION 120 // // EDIT UG_GATEWAY_MAIN_MENUBAR // // BEFORE UG_HELP // CASCADE_BUTTON BLOCKSTYLER_DLX_CASCADE_BTN // LABEL Dialog Launcher // END_OF_BEFORE // // MENU BLOCKSTYLER_DLX_CASCADE_BTN // BUTTON SAMPLEVB_BTN // LABEL Display SampleVB dialog // ACTIONS <path of Shared library> !For example: D:\temp\SampleVB.dll // END_OF_MENU // !----------------------------------------------------------------------------- // // 3) Make sure the .men file is in one of the following locations: // // - $UGII_USER_DIR/startup // - For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly // recommended. This variable is set to a full directory path to a file // containing a list of root directories for all custom applications. // e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_BASE_DIR\ugii\menus\custom_dirs.dat // //------------------------------------------------------------------------------ //#if USER_EXIT_OR_MENU public static void Main() { ToolHolderDialog toolHolderDialog = null; try { toolHolderDialog = new ToolHolderDialog(); toolHolderDialog._dataService = new DataService(toolHolderDialog); // The following method shows the dialog immediately toolHolderDialog.Show(); } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } finally { if (toolHolderDialog != null) { toolHolderDialog.Dispose(); } toolHolderDialog = null; } }
//------------------------------------------------------------------------------ //Method name: Show_secondDialog //------------------------------------------------------------------------------ public static void Show_secondDialog() { ToolHolderDialog thesecondDialog = null; try { thesecondDialog = new ToolHolderDialog(); // The following method shows the dialog immediately thesecondDialog.Show(); } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } finally { thesecondDialog.Dispose(); thesecondDialog = null; } }