UI Open API UISTYLER Development
1. Create a directory and configure environment variables
(1) Custom creation. Create a folder such as d: / ug_open, create a secondary folder D: / UG_Open / Application and D: / UG_Open / Startup under this folder.
Open the UGII_Env.dat file in the UG installation directory, modify the path under ugii_user_dir, such as ugii_user_dir = d: / ug_open, and remove the front "#".
(2) The third party is created. Find the Vendor folder under Ugalliance under the UG installation directory to see if there is an Application and Startup folders, and if you don't exist, you are created.
Open the UGII_Env.dat file in the UG installation directory, remove "#" in front of UGII_vendor_dir.
(3) The system is created himself. Find the Site folder under Ugalliance under the UG installation directory to see if there is an Application and Startup folders, if you don't exist, create them.
Open the UGII_Env.dat file in the UG installation directory, remove "#" in front of UGII_site_dir.
The difference between the three methods is that the order of the load is different when the system is started, and it is defined by Site, Vendor, and the user itself.
This paper uses the first method.
2. UISTYLER design (1) Open the UG and enter UISTYLER (under the main menu Application).
(2) Interface design. (3) Save it under the Application folder just established, three files appear, as shown below.
3. Establish VC project
(1) The header file and source program that have just been generated in the Application directory are moved to the directory where the VC project is located, such as d: / source.
(2) Creating a new project, selecting Win32 DLL, selecting an empty DLL.
(3) Add the header file and source program to the project.
4. Set up VC environments
(1) Select Project-> setting-> C / C on the menu bar, and set the settings as shown below, mainly test the introduction of the project.
(2) Select Project-> setting-> link on the menu bar, set the two LIB libraries into the project (UG 18 is applied).
The file name of the output can select the path D: / UG_Open / Application, which indicates that the system does not load this secondary development. The file name selection path D: / ug_open / startup can also be output, which indicates that this secondary development is loaded when the system starts.
(3) Select Tools-> Options ...-> Directories on the menu bar, and join the library file as follows.
5. Modify the source program
(1) Open the source program, find the Menuscript template, copy this content, and save it to D: / ug_open / startup. Note that the file name should be .men, file name can be taken at will.
Version 120
Edit ug_gateway_main_menubar
BEFORE UG_HELP CASCADE_BUTTON UISTYLER_DLG_CASCADE_BTN LABEL Dialog Launcher END_OF_BEFORE MENU UISTYLER_DLG_CASCADE_BTN BUTTON MY_BTN LABEL Display my dialog ACTIONS my.dlg END_OF_MENU (2) find the program in "#ifdef MENUBAR_COMMENTED_OUT" and its paired "endif" and deleted.
(3) Locate "#ifdef display_from_user_exit" and its paired "endif" and delete it. Be careful not to delete the programs in these two items.
(4) Change the "
(5) Compiler.
6. Open the UG, you can find more buttons on the menu bar, and you have made it!