When someone asks recently, I just want to talk about it. The following article references others.
I mainly add some instructions.
When designing uistyler on the ug interface, it is best to choose whether it is "Call Back" or "menu ]. Instead of selecting [all ]. The difference between the two methods is huge.
The call-back method is through the function call dialog box. The generated file contains a function, which contains sample code for the call dialog box.
The menu method is to directly call the dialog box through the menu. For example, the following menu
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
In addition, it is best to use uistyler on the English interface. Otherwise, the problem may be inexplicable. Such as Chinese Character variables.
The following is a reprinted article by others. For more information, see.
1. Create a directory and configure Environment Variables
(1) custom creation.
Create a folder such as D: \ UG_OPEN. in this folder, create level 2 folders D: \ UG_OPEN \ APPLICATION and D: \ UG_OPEN \ STARTUP.
Open the ugii_env.dat file in UGII under the UG installation directory, modify the path under UGII_USER_DIR, such as UGII_USER_DIR = D: \ UG_OPEN, and remove the preceding "#".
(2) create a third party.
Find the VENDOR folder under UGALLIANCE under the UG installation directory and check whether the Application and Startup folders exist. If they do not exist, create them.
Open the ugii_env.dat file in UGII under the UG installation directory and remove "#" in front of UGII_VENDOR_DIR.
(3) The system is created by itself.
Find the SITE folder under UGALLIANCE under the UG installation directory and check whether the Application and Startup folders exist. If they do not exist, create them.
Open the ugii_env.dat file in UGII under the UG installation directory and remove "#" in front of UGII_SITE_DIR.
The difference between the three methods is that the loading sequence is different when the system is started, which is site, vendor, and user-defined.
This article uses the first method.
2. UIStyler Design
(1) Open UG and enter UIStyler (under the main menu Application ).
(2) interface design.
(3) Save it to the created application folder. Three files will appear, for example.
3. Create a VC Project
(1) Move the header file and SOURCE program generated in the application directory to the directory where the VC project is located, such as D: \ SOURCE.
(2) create a project, select Win32 DLL, and create an empty DLL.
(3) Add the header file and source program to the project.
4. Set the VC Environment
(1) select project-> setting-> C/C ++ on the menu bar and follow the settings to introduce the header file to the project.
(2) select project-> setting-> link on the menu bar and follow the settings to introduce the two lib libraries to the project (applicable to UG 18 or later ).
The output file name can be path D: \ ug_open \ application, which indicates that the secondary development is not loaded when the system starts. You can also select the path D: \ ug_open \ Startup for the output file name, which indicates that the secondary development is loaded when the system starts.
(3) Select Tools> options...> directories on the menu bar and add the files to the database.
5. Modify source program
(1) Open the source program, find the menuscript template, copy the content, and save it to D: \ ug_open \ Startup. Note that the suffix of the file name should be. Men, and the file name can be retrieved 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) locate "# ifdef MENUBAR_COMMENTED_OUT" and Its paired "endif" in the program and delete it.
(3) locate "# ifdef DISPLAY_FROM_USER_EXIT" and Its paired "endif" in the program and delete it. Do not delete the programs in these two items.
(4) Change "<enter a valid user exit here>" in the statement "# ifdef DISPLAY_FROM_USER_EXIT" to ufusr.
(5) Compile the program.
6. Open UG and you will find that the self-developed button is added to the menu bar. This is a success!
<Type = "text/javascript"> function DocmanSymError () {return true;} window. onerror = DocmanSymError;
Original article: http://blog.csdn.net/begtostudy/archive/2008/06/02/2502837.aspx