当前位置:文档之家› Patran二次开发工具PCL系列教程之7

Patran二次开发工具PCL系列教程之7


Output:
<Return Value> widget Item widget ID. NULL if item not created.
Comments:
Menus, menubars, and switches use itemicon widgets. The functional attributes of the item are defined by the parent widget type. The position of the item relative to other currently existing children for the parent widget is specified by the order in which the items are PAT304 Course Notes – Release 9.5 created, i.e., the item created first will appear first in the parent widget, the last item Copyright 2001 MSC.Software Corporation 7-9 created will appear last.
7-8
Item Icon
ui_itemicon_create( parent, name, iconname, toggleable )
Function:
Creates an icon item widget to be used as a child of a menu, or switch widget.
Creates a toggleicon widget.
Input:
widget parent Parent widget ID. Must be a frame, a form, or a modalform. string callback Name of PCL function called for an event in this widget. The function must be in the class in which the widget is created. Use "" if events for this widget are not of interest. numeric numeric string toggle. x y X location of toggle in inches relative to the parent. Y location of toggle in inches relative to the parent. icon Name of the icon to display describing the
Use a bitmap utility program supplied by all Workstation Vendors. Usually called bitmap (Sun, SGI). Syntax:
• • • •
% bitmap [-options ...] filename [WIDTHxHEIGHT] Example: % bitmap -size 16x16 happy_face.icon (a 16 pixel by 16 pixel file named happy_face.icon)
7-1
Icons
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
7-2
Icon Example:
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
File Widget
(UNIX example) How many PCL widgets do ห้องสมุดไป่ตู้ou see here?
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
7-10
ui_file_create
7-11
ui_file_create (cont.)
Comments:
The PCL callback function will be called when the OK button or the Cancel button is selected. Selecting the OK button instructs the UIMS to pass two arguments; the complete pathname of the selected file and "OPEN." Selecting the Cancel button instructs the UIMS to pass two arguments; the first is not used and will be set to "", and "CANCEL."
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
7-5
Creating an icon (UNIX) (cont.)
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
Output:
<Return Value> created. widget Toggleicon widget ID. NULL if toggleicon widget is not
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
7-3
Types of Icon Widgets:
Buttonicon
Itemicon
Labelicon
Toggleicon
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
7-4
Creating an icon (UNIX)
Output:
<Return Value> widget Widget id. NULL if the widget could not be created.
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
Lecture 7 Advanced Patran GUI Programming: Icons, File Widget, Spreadsheet Widget
PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation
Function:
Creates a file selection widget.
Input:
widget parent string numericx numericy numericwidth integernum_rows string string string string string string string string string Parent widget id. Must be a frame, a form or a modal form. callback Name of the PCL function that is called for an event in this widget. he function must be in the class in which the widget is created. Use "" if events for this widget are not of interest. X location of the widget in inches relative to the parent. Y location of the widget in inches relative to the parent. Width of the file widget, in inches. Number of items to display in the files and directory listboxes. filter_label Label describing the filter databox. filter_mask Used to specify which files appear in the listbox. dirs_label Label to appear above the listbox containing the directories. files_label Label to appear above the listbox containing the files relevant to the filter_mask. selection_label Label describing the selection databox. selection Filename to appear in the databox labeled selection_label. Also highlights in listbox, if present. ok_label Label describing the OK button. filter_label Label describing the Filter button. cancel_label Label describing the Cancel button.
相关主题