1 /*---------------------------------------------------------------------------- 2 -- 3 -- Module: xitRwPixB 4 -- 5 -- Project: xitRw - Roger's Widget set. 6 -- System: <> 7 -- Subsystem: <> 8 -- Function block: <> 9 -- 10 -- Description: 11 -- This is the public header file for the widget. 12 -- A PixB button can display both a text and a pixmap. 13 -- 14 -- Resources for the pixel button widget. 15 -- 16 -- All Core and Primitive resources apply. 17 -- The following list describes resources added in this widget. 18 -- 19 -- XmNactivateCallback 20 -- Callback called when button is activated. 21 -- Type: XtCallbackList 22 -- Default: NULL 23 -- 24 -- XmNalignment 25 -- Defines how the components should be aligned. 26 -- XmALIGNMENT_CENTER centers the components within 27 -- the widget and in relation to each other. 28 -- XmALIGNMENT_BEGINNING positions the components as 29 -- far to the left and top as possible, XmALIGNMENT_END 30 -- positions them to the right and bottom. 31 -- Alignment is used in the dimension that the parts are 32 -- laid out. 33 -- Type: int 34 -- Default: XmALIGNMENT_CENTER 35 -- 36 -- XmNarmCallback 37 -- Callback called when button is armed. 38 -- Type: XtCallbackList 39 -- Default: NULL 40 -- 41 -- XmNdisarmCallback 42 -- Callback called when button is disarmed. 43 -- Type: XtCallbackList 44 -- Default: NULL 45 -- 46 -- XmNfontList 47 -- Font for label text. 48 -- Type: XmFontList 49 -- Default: Fixed 50 -- 51 -- XmNlabelPixmap 52 -- Pixmap to be displayed in the button. 53 -- Pixmap is NOT copied locally and should not be deallocated by caller. 54 -- Type: Pixmap 55 -- Default: XmUNSPECIFIED_PIXMAP 56 -- 57 -- XmNlabelString 58 - String to be displayed in the button. 59 -- String is copied locally and can be deallocated by caller. 60 -- Type: XmString 61 -- Default: NULL 62 -- 63 -- XmNmarginBottom 64 -- Specifies the amount of spacing between the bottom 65 -- of the label or pixmap and the top of the bottom 66 -- margin (specified by XmNmarginHeight). 67 -- Type: int 68 -- Default: 0 69 -- 70 -- XmNmarginHeight 71 -- Specifies the amount of spacing vertically between 72 -- the shadow and the label or pixmap. The top and 73 -- bottom margins are added. 74 -- Type: int 75 -- Default: 2 76 -- 77 -- XmNmarginLeft 78 -- Specifies the amount of spacing between the left edge 79 -- of the label or pixmap and the right edge of the left 80 -- margin (specified by XmNmarginWidth). 81 -- Type: int 82 -- Default: 0 83 -- 84 -- XmNmarginRight 85 -- Specifies the amount of spacing between the right 86 -- edge of the label or pixmap and the left edge of the 87 -- right margin (specified by XmNmarginWidth). 88 -- Type: int 89 -- Default: 0 90 -- 91 -- XmNmarginTop 92 -- Specifies the amount of spacing between the top 93 -- of the label or pixmap and the bottom of the top 94 -- margin (specified by XmNmarginHeight). 95 -- Type: int 96 -- Default: 0 97 -- 98 -- XmNmarginWidth 99 -- Specifies the amount of spacing horizontally between 100 -- the shadow and the label or pixmap. The left and 101 -- right margins are added. 102 -- Type: int 103 -- Default: 2 104 -- 105 -- XitRwNoppositeAlignment 106 -- Defines how the components should be aligned. 107 -- XmALIGNMENT_CENTER centers the components within 108 -- the widget and in relation to each other. 109 -- XmALIGNMENT_BEGINNING positions the components as 110 -- far to the left and top as possible, XmALIGNMENT_END 111 -- positions them to the right and bottom. 112 -- Alignment is used in the opposite dimension to the one in which 113 -- the parts are laid out. 114 -- 115 -- Note! Only implemented for XitRwNpixmapPosition = XitRw(LEFT|RIGHT)! 116 -- 117 -- Type: int 118 -- Default: XmALIGNMENT_CENTER 119 -- 120 -- XitRwNpixmapPosition 121 -- The position of the pixmap relative to the string. 122 -- XitRwLEFT, XitRwRIGHT, XitRwTOP, XitRwBOTTOM. 123 -- The resource is only meaningful if both the pixmap 124 -- and the string are specified. 125 -- Type: int 126 -- Default: XitRwLEFT 127 -- 128 -- XmNrecomputeSize 129 -- If True, the button requests a new size when new values are set. 130 -- If False, the button keeps its old size, regardless of the changes that 131 -- are made to its values. 132 -- Type: Boolean 133 -- Default: False 134 -- 135 -- XmNshadowType 136 -- The type of shadow to be drawn around the button in 137 -- the unarmed state. 138 -- XmSHADOW_OUT specifies a shadow so that the button 139 -- protrudes from the background. With XmSHADOW_IN, 140 -- the button will look like it has been pressed into 141 -- the background. 142 -- When the button is armed, the shadows will be inverted. 143 -- Type: int 144 -- Default: XmSHADOW_OUT 145 -- 146 -- XmNspacing 147 -- Specifies the amount of spacing between the label and the pixmap. 148 -- Type: int 149 -- Default: 2 150 -- 151 -- Filename: xitRwPixB.h 152 -- 153 -- Authors: Roger Larsson, Ulrika Bornetun 154 -- Creation date: 1992-10-17 155 -- 156 -- 157 -- (C) Copyright Ulrika Bornetun, Roger Larsson (1995) 158 -- All rights reserved 159 -- 160 -- Permission to use, copy, modify, and distribute this software and its 161 -- documentation for any purpose and without fee is hereby granted, 162 -- provided that the above copyright notice appear in all copies. Ulrika 163 -- Bornetun and Roger Larsson make no representations about the usability 164 -- of this software for any purpose. It is provided "as is" without express 165 -- or implied warranty. 166 ----------------------------------------------------------------------------*/ 167 168 /* SCCS module identifier. */ 169 /* SCCSID = @(#) Module: xitRwPixB.h, Version: 1.1, Date: 95/02/18 15:10:46 */ 170 171 172 /* Only include once. */ 173 #ifndef define_xitRwPixB_h 174 # define define_xitRwPixB_h 175 176 177 /*---------------------------------------------------------------------------- 178 -- Include files 179 ----------------------------------------------------------------------------*/ 180 181 /* Include file for the superclass. */ 182 #include <Xm/Xm.h> 183 184 /*---------------------------------------------------------------------------- 185 -- Macro definitions 186 ----------------------------------------------------------------------------*/ 187 188 /* Resource names. */ 189 #define XitRwNpixmapPosition "pixmapPosition" 190 #define XitRwNoppositeAlignment "oppositeAlignment" 191 192 #define XitRwCPixmapPosition "PixmapPosition" 193 194 /* Pixmap positions. */ 195 #define XitRwLEFT 0 196 #define XitRwRIGHT 1 197 #define XitRwTOP 2 198 #define XitRwBOTTOM 3 199 200 #ifndef xitRwIsPixButton 201 # define xitRwIsPixButton( w ) XtIsSubclass( w, xitRwPixButtonWidgetClass ) 202 #endif 203 204 205 /*---------------------------------------------------------------------------- 206 -- Type declarations 207 ----------------------------------------------------------------------------*/ 208 209 210 /*---------------------------------------------------------------------------- 211 -- Global definitions 212 ----------------------------------------------------------------------------*/ 213 214 /* Class record constants. */ 215 extern WidgetClass xitRwPixButtonWidgetClass; 216 217 218 typedef struct _XitRwPixButtonClassRec *XitRwPixButtonWidgetClass; 219 typedef struct _XitRwPixButtonRec *XitRwPixButtonWidget; 220 221 222 /*---------------------------------------------------------------------------- 223 -- Function prototypes 224 ----------------------------------------------------------------------------*/ 225 226 Boolean 227 xitRwPixButIsArmed( Widget w ); 228 229 230 #endif 231