NoticeShell(3W)
NAME
NoticeShell − notice shell widget
SYNOPSIS
#include <Xol/OpenLook.h>
#include <Xol/Notice.h>
. . .
ANCESTRY
Core-Composite-Shell-WMShell-VendorShell-TransientShell-NoticeShell
DESCRIPTION
The NoticeShell widge creates a pop-up to notify the user. It is typically used to allow the user to confirm a choice, or to warn the user of a problem. When a NoticeShell is popped up, all other interaction with the application is precluded until the NoticeShell is popped down.
Components
The Notice widget has three main components (see the diagram below):
A Text Area - where the message to the end user is displayed;
A Control Area - containing one or more widgets that the end user uses to control how to continue with an application;
A Default Button - button to acknowledge notice, or to confirm action.
Another important element is the Emanate Widget, which is typically the control activated by the end user that requires immediate attention.
The application identifies the Emanate Widget to the Notice widget.
Figure 1 Notice Widget
Subwidgets
The NoticeShell contains two subwidgets, a StaticText, and a ControlArea, provided automatically, and accessible through the XtNtextArea, XtNcontrolArea resources respectively.
Figure 2 NoticeShell Subwidgets
NoticeShell
|
_____________________________
| |
StaticText ControlArea
(XtNtextArea) (XtNcontrolArea)
Subclass of the Shell Widget
The Notice widget is a sub-class of Shell so, the XtCreatePopupShell() routine is used to create a notice instead of the normal XtCreateWidget().
Popping the Notice
The application controls when the Notice widget is to be displayed or popped up. The XtPopup() routine can be used for this.
However, the application does not need to control when the Notice widget is to be popped down. The widget itself detects when to pop down: the end user clicks SELECT on an OblongButton widget in the Control Area. This behavior requires that there be at least one OblongButton widget in the Control Area. If other types of controls are used instead, the application can "manually" pop the notice down using a routine such as XtPopdown().
Busy Button, Busy Application
When the Notice pops up, it "freezes" the entire application except the Notice to prevent the end user from interacting with any other part of the application. As feedback of this to the user, the Notice causes the headers of all the base windows and pop-up windows to be stippled in the busy pattern, and causes a stipple pattern in the Emanate Widget. The latter stipple pattern is caused by setting the XtNbusy resource to TRUE in the Emanate Widget. If the widget does not recognize this resource, nothing will happen.
On popping down, the Notice widget clears all stipple patterns and "unfreezes" the application.
Text and ControlAreas
The Text and ControlArea are handled by separate widget interfaces. The widget IDs of the Text (XtNtextArea) and the ControlArea (XtNcontrolArea) can be obtained from the Notice widget.
The Text and ControlArea abut with no space between them. An application can control the distance between the Textand the controls by setting margins in the ControlArea.
Coloration
of the Notice widget.
Figure 3 Notice Coloration
Keyboard Traversal
The Notice widget limits keyboard traversal of the application to the buttons within the ControlArea.
The user can traverse between the controls in the ControlArea using the NEXT_FIELD, PREV_FIELD, MOVEUP, MOVEDOWN, MOVERIGHT, and MOVELEFT keys. The NEXTAPP key will traverse to the next application, and the PREVAPP key will traverse to the the previous application, but the NEXTWINDOW and PREVWINDOW keys are disabled. When keyboard traversal is used to move back to the Notice’s application, focus goes to the Notice.
Notice Activation Types
OL_CANCEL: Beep
OL_DEFAULTACTION: Call OlActivateWidget for the default widget with parameter
OL_SELECTKEY
RESOURCES
Control Area component
Name: controlarea
Class: ControlArea
Table 1 Control Area application Resources
Name Type Default Access
XtNhPad- XtCHPad Dimension 0
XtNhSpace- Dimension 4 I
XtNlayoutType- OllDefine OL_FIXEDROWS I
XtNmeasure- int 1 I
XtNsameSize OlDefine OL_COLUMNS I
XtNvPad- Dimension 0 I
XtNvSpace- Dimension 4 I
Access: S = XtSetValues G = XtGetValues
I = init time O = other access
† see resources(3W)
See ControlArea(3W) for the descriptions of these resources.
Text Area component
Name: textarea
Class: StaticText
Table 2 Text Area Resources
Name Type Default Access
XtNalignment- int OL_LEFT I
XtNfont- XFontStruct∗ (OPEN LOOK ont) SI
XtNfontColor- Pixel Black SGI
XtNlineSpace- int 0 I
XtNstring- String NULL I
XtNstrip- Boolean TRUE I
XtNwrap- Boolean TRUE I
Access: S = XtSetValues G = XtGetValues
I = init time O = other access
See StaticText(3W) widget for the descriptions of these resources.
Table 3 Notice Widget Resource Summary
Name Type Default Access
XtNallowShellResize- Boolean TRUE SGI
XtNancestorSensitive- Boolean TRUE GO
XtNbackground- Pixel XtDefaultBackground G
XtNbackgroundPixmap- Pixmap (none) SGI
XtNborderColor- Pixel XtDefaultBackground SGI
XtNborderPixmap- Pixmap (none) SGI
XtNconsumeEvent- XtCallbackList NULL SGI
XtNcontrolArea Widget (none) G
XtNcreatePopupChildProc- XtCreatePopupChildProc NULL SGI
XtNdepth- int (parent’s) GI
XtNdestroyCallback- XtCallbackList NULL SI
XtNemanateWidget Widget (parent’s) SGI
XtNfocusWidget Widget NULL SGI
XtNgeometry- String NULL GI
XtNheight- Dimension (calculated) SGI
XtNpopdownCallback- XtCallbackList NULL SI
XtNpointerWarping Boolean TRUE SGI
XtNpopupCallback- XtCallbackList NULL SI
XtNsaveUnder- Boolean FALSE SGI
XtNsensitive- Boolean TRUE GIO
XtNtextArea Widget (none) G
XtNuserData XtPointer NULL SGI
XtNwidth- Dimension (calculated) SGI
XtNx- Position 0 G
XtNy- Position 0 G
Access: S = XtSetValues G = XtGetValues
I = init time O = other access
† see resources(3W)
XtNcontrolArea
class:XtCControlAreatype:Widgetdefault:(none)(none)’u’access:GG’u’
Action: gives the widget ID of the ControlArea widget.
Values: ID of existing widget
This value is available once the Notice widget has been created. Any widgets of the class OblongButton added to the Control Area are assumed to be window disposition controls; that is, when the end user activates one of them, the Notice widget pops itself down.
XtNemanateWidget
class:XtCEmanateWidgettype:Widgetdefault:(parent’s)(parent’s)’u’access:SGISGI’u’
Action: identifies the emanate widget.
Values: ID of existing widget
On popping up, the Notice widget attempts to set this widget to be busy, by making its XtNbusy resource TRUE; if the widget doesn’t recognize the resource, nothing happens.
On popping down, the Notice widget clears the XtNbusy resource. When the Notice widget pops up, it tries not to cover this widget; this may fail depending on its location and the size of the Notice widget. The default for this resource is the parent. The parent, however, cannot be a gadget (OblongButtonGadget, for instance). To emanate a Notice from a gadget, specify another widget as the parent and set XtNemanateWidget to the Gadget.
XtNfocusWidget
class:XtCTextAreatype:Widgetdefault:NULLNULL’u’access:SGISGI’u’ This is the ID of the widget to get focus the next time this shell takes focus. Therefore, as a user traverses objects via the keyboard or explicitly sets focus to an object (e.g.clicking SELECT), the value of the XtNfocusWidget resource is updated to reflect this as the object with focus.
XtNpointerWarping
class:XtCPointerWarpingtype:Booleandefault:TRUETRUE’u’access:SGISGI’u’
Action: Specifies whether pointer will jump to the default button when the Notice is displayed. Values: TRUE – the pointer jumps to the default button. FALSE – the pointer doesn’t jump.
XtNtextArea
class:XtCTextAreatype:Widgetdefault:(none)(none)’u’access:GG’u’
Action: gives the widget ID of the StaticText widget that controls the text area
Values: ID of existing widget
This value is available once the Notice widget has been created.
SEE ALSO
ControlArea(3W), resources(3W), StaticText(3W)
Version 3.0.1 — Last change: June 92