next up previous contents index
Next: Mouse Input Up: Main Functions 2 Previous: System Command Interface   Contents   Index

Menu Buttons

(int) SetButtonStatus(menu, button, set)
This command sets the state of the specified button in the given menu or button array, which must be a toggle button. The button will be ``pressed'' if necessary to match the given state.

The first argument is a string giving the internal name of a menu. If the given name is null, empty, or ``main'', all of the menus in the main window will be searched. The internal menu names are as follows:

main Main window menus
side Side Menu buttons
top Top Menu buttons
sub1 Wiewport 1 menus
sub2 Wiewport 2 menus
sub3 Wiewport 3 menus
sub4 Wiewport 4 menus
   
file File Menu
cell Cell Menu
edit Edit Menu
mod Modify Menu
view View Menu
attr Attributes Menu
conv Convert Menu
drc DRC Menu
ext Extract Menu
user User Menu
help Help Menu

The second argument is the button name, which is the code name given in the tooltip window which pops up when the mouse pointer rests over the button. In the case of User Menu command buttons, the name is the text which appears on the button. Only buttons and menus visible in the current mode (electrical or physical) can be accessed.

It should be stressed that the string arguments refer to internal names, and not (in general) the label printed on the button. For a button, this is the five character or fewer name that is shown in the tooltip that pops up when the pointer is over the button. The same applies to the menu argument, however these names are not available from running Xic. The internal menu names are provided in the table above.

The identification of the menu is case insensitive. In the lower group of entries, only the first one or two characters have to match. Thus ``Convert'', ``c'', and ``crazy'' would all select the Convert menu, for example. One character is sufficient, except for `e' (Extract and Edit). So, the menu argument can be the menu label, or the internal name, or some simplification at the user's discretion. For the upper group, the entire menu name must be given.

If the third argument is nonzero, the button will be pressed if it is not already engaged. If the third argument is zero, the button will be depressed if it is not already disengaged. The return value is 1 if the button state changed, 0 if the button state did not change, or -1 if the button was not found.

(int) GetButtonStatus(menu, button)
This command returns the status of the indicated menu button, which should be a toggle button. The two arguments are as described for SetButtonStatus. The return value is 1 if the button is engaged, 0 if the button is not engaged, or -1 if the button is not found.

(int) PressButton(menu, button)
This command ``presses'' the indicated button. This works with all buttons, toggle or otherwise, and is equivalent to clicking on the button with the mouse. The two arguments, which identify the menu and button, are described under SetButtonStatus. The return value is 1 if the button was pressed, 0 if the button was not found.

The following four functions send raw events to the window system. They are used primarily for the run time logging in the xic_run.log file. The run log consists entirely of executable statements, thus command scripts can be created by simply performing operations in Xic, and editing the xic_run.log file. Otherwise, these functions are not likely to be of much use to most Xic users.

BtnDown(num, state, x, y, widget)
This function generates a button press event dispatched to the widget specified by the last argument. The num is the button number: 1 for left, 2 for middle, 3 for right. The state is the ``modifier'' key state at the time of the event, and is the OR of 1 if Shift pressed, 4 if Control pressed, 8 if Alt pressed, as in X windows. Other flags may be given as per that spec, but are not used by Xic. The coordinates are relative to the window of the target, in pixels. The widget argument is a string containing a resource specifier for the widget relative to the application, the syntax of which is dependent upon the specific user interface. A call to BtnDown should be followed by a call to BtnUp on the same widget. There is no return value.

BtnUp(num, state, x, y, widget)
This function generates a button release event dispatched to the widget specified by the last argument. The num is the button number: 1 for left, 2 for middle, 3 for right. The state is the ``modifier'' key state at the time of the event, and is the OR of 1 if Shift pressed, 4 if Control pressed, 8 if Alt pressed, as in X windows. Other flags may be given as per that spec, but are not used by Xic. The coordinates are relative to the window of the target. The widget argument is a string containing a resource path for the widget relative to the application, the syntax of which is dependent upon the specific user interface. A call to BtnUp should only follow a call to BtnDown on the same widget. There is no return value.

KeyDown(keysym, state, widget)
This function generates a key press event dispatched to the widget specified in the last argument. The keysym is a code representing the key te send. The state and widget arguments are as described for BtnDown. A call to KeyDown should followed by a call to KeyUp, on the same widget. There is no return value.

KeyUp(keysym, state, widget)
This function generates a key release event dispatched to the widget specified in the last argument. The keysym is a code representing the key te send. The state and widget arguments are as described for BtnDown. A call to KeyUp should only follow a call to KeyDown, on the same widget. There is no return value.


next up previous contents index
Next: Mouse Input Up: Main Functions 2 Previous: System Command Interface   Contents   Index
Stephen R. Whiteley 2024-09-29