SimpleMenu.h revision 7a84e134
1/* 2 * $Xorg: SimpleMenu.h,v 1.4 2001/02/09 02:03:45 xorgcvs Exp $ 3 * 4Copyright 1989, 1994, 1998 The Open Group 5 6Permission to use, copy, modify, distribute, and sell this software and its 7documentation for any purpose is hereby granted without fee, provided that 8the above copyright notice appear in all copies and that both that 9copyright notice and this permission notice appear in supporting 10documentation. 11 12The above copyright notice and this permission notice shall be included in 13all copies or substantial portions of the Software. 14 15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 19AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 22Except as contained in this notice, the name of The Open Group shall not be 23used in advertising or otherwise to promote the sale, use or other dealings 24in this Software without prior written authorization from The Open Group. 25 * 26 * Author: Chris D. Peterson, MIT X Consortium 27 */ 28/* $XFree86: xc/lib/Xaw/SimpleMenu.h,v 1.7 2001/01/17 19:42:30 dawes Exp $ */ 29 30/* 31 * SimpleMenu.h - Public Header file for SimpleMenu widget. 32 * 33 * This is the public header file for the Athena SimpleMenu widget. 34 * It is intended to provide one pane pulldown and popup menus within 35 * the framework of the X Toolkit. As the name implies it is a first and 36 * by no means complete implementation of menu code. It does not attempt to 37 * fill the needs of all applications, but does allow a resource oriented 38 * interface to menus. 39 * 40 * Date: April 3, 1989 41 * 42 * By: Chris D. Peterson 43 * MIT X Consortium 44 * kit@expo.lcs.mit.edu 45 */ 46 47#ifndef _SimpleMenu_h 48#define _SimpleMenu_h 49 50#include <X11/Shell.h> 51#include <X11/Xmu/Converters.h> 52 53/* 54 * SimpleMenu widget 55 */ 56 57/* Resources: 58 59 Name Class RepType Default Value 60 ---- ----- ------- ------------- 61 background Background Pixel XtDefaultBackground 62 backgroundPixmap BackgroundPixmap Pixmap None 63 borderColor BorderColor Pixel XtDefaultForeground 64 borderPixmap BorderPixmap Pixmap None 65 borderWidth BorderWidth Dimension 1 66 bottomMargin VerticalMargins Dimension VerticalSpace 67 columnWidth ColumnWidth Dimension Width of widest text 68 cursor Cursor Cursor None 69 destroyCallback Callback Pointer NULL 70 displayList DisplayList XawDisplayList* NULL 71 height Height Dimension 0 72 label Label String NULL (No label) 73 labelClass LabelClass Pointer smeBSBObjectClass 74 leftMargin HorizontalMargins Dimension 0 75 mappedWhenManaged MappedWhenManaged Boolean True 76 rightMargin HorizontalMargins Dimension 0 77 rowHeight RowHeight Dimension Height of Font 78 sensitive Sensitive Boolean True 79 topMargin VerticalMargins Dimension VerticalSpace 80 width Width Dimension 0 81 x Position Position 0 82 y Position Position 0 83 84*/ 85 86typedef struct _SimpleMenuClassRec* SimpleMenuWidgetClass; 87typedef struct _SimpleMenuRec* SimpleMenuWidget; 88 89extern WidgetClass simpleMenuWidgetClass; 90 91#define XtNcursor "cursor" 92#define XtNbottomMargin "bottomMargin" 93#define XtNcolumnWidth "columnWidth" 94#define XtNlabelClass "labelClass" 95#define XtNmenuOnScreen "menuOnScreen" 96#define XtNpopupOnEntry "popupOnEntry" 97#define XtNrowHeight "rowHeight" 98#define XtNtopMargin "topMargin" 99#define XtNleftMargin "leftMargin" 100#define XtNrightMargin "rightMargin" 101 102#define XtCColumnWidth "ColumnWidth" 103#define XtCLabelClass "LabelClass" 104#define XtCMenuOnScreen "MenuOnScreen" 105#define XtCPopupOnEntry "PopupOnEntry" 106#define XtCRowHeight "RowHeight" 107 108#define XtCVerticalMargins "VerticalMargins" 109 110#ifndef OLDXAW 111#define XtCHorizontalMargins "HorizontalMargins" 112#define XawNdisplayList "displayList" 113#define XawCDisplayList "DisplayList" 114#define XawRDisplayList "XawDisplayList" 115#endif 116 117/* 118 * Public Functions 119 */ 120 121_XFUNCPROTOBEGIN 122 123/* 124 * Function: 125 * XawSimpleMenuAddGlobalActions 126 * 127 * Parameters: 128 * app_con - appcontext 129 * 130 * Description: 131 * Adds the global actions to the simple menu widget. 132 */ 133void XawSimpleMenuAddGlobalActions 134( 135 XtAppContext app_con 136 ); 137 138/* 139 * Function: 140 * XawSimpleMenuGetActiveEntry 141 * 142 * Parameters: 143 * w - smw widget 144 * 145 * Description: 146 * Gets the currently active (set) entry. 147 * 148 * Returns: 149 * The currently set entry or NULL if none is set 150 */ 151Widget XawSimpleMenuGetActiveEntry 152( 153 Widget w 154 ); 155 156/* 157 * Function: 158 * XawSimpleMenuClearActiveEntry 159 * 160 * Parameters: 161 * w - smw widget 162 * 163 * Description: 164 * Unsets the currently active (set) entry. 165 */ 166void XawSimpleMenuClearActiveEntry 167( 168 Widget w 169); 170 171_XFUNCPROTOEND 172 173#endif /* _SimpleMenu_h */ 174