FAQ: User Interface


8.1 When I set a font in a UIshell, is this font 'inherited' by all of the UIshell's child objects?

Yes. So, for example, if you set the UIshell's fontAttributes.family subobject to "courier", all of the objects parented to that shell will 'inherit' the courier font as their default font (you can override the value in any child widget by setting its fontAttributes.family subobject to a different value, such as "times".)

However, if you set one fontAttribute in the child widget, it uses all of the fontAttribute values in that object. For example, you set fontAttributes.family to "courier" and fontAttributes.weight to "medium" in a UIshell. All child objects of that UIshell inherit those fonts attributes by default. Now, in a UItext child of the UIshell, you set fontAttributes.family to "times". Since you set a value here, AVS/Express uses all the values from this object and doesn't inherit any from the parent. So, weight will be set to the default "bold" and not to the value it was set to in the UIshell, "medium".

8.2 Can I limit the size of a UItext typein?

Yes, by setting the width and the resize_to_text to 0.

8.3 How can I get an hourglass cursor to display when my module fires?

You can specify a cursor for a particular shell using the UI kit object, UIfontCursor. There is no UI kit object or OM call that allows you to display the cursor everywhere.

AVS/Express implements the display of the hourglass cursor with its own internal code. This code is not supported, so its interface could change. However, in the present implementation, the following code change the cursor in all AVS/Express windows:

#include <avs/wt.h>

Widget w; /* Valid widget handle. On the PC, use HWND w; */
WTset_cursor(w, WT_hourglass_cursor);

To change the cursor back to the default cursor:

WTset_cursor(w, NULL);

The cursor functions must be called with any valid widget handle as the first argument. One way to obtain a widget handle is to get the value of the "handle.widget" subobject of any visible UIwindow object (UIwindow is an abstract class that is a high level object in the User Interface Kit widget class hierarchy.)

8.4 How would capture all x,y values from UItwoPoint so that you could use x,y results to, say, draw (ROI) lines?

You have to invoke an update method every time x or y changes and buffer the input. Wouldn't that be very slow? The update method won't be invoked every time you move the mouse one pixel - it depends on how often your operating system samples the mouse position.

8.5 Can I make multi-line text fields smaller?

No. The scrollable area displayed when you open a multi-line text field is a fixed size.

8.6 Is the Windows NT version of the UI Kit based on the MFC (Microsoft Foundation Classes) library?

Yes.

8.7 Is there any built-in function to return the size of a string?

No. Note that the size of the string will vary based on the string itself (the number of characters), but also characteristics of the text, such as the font used, its weight (bold or medium) and height and so on.