174
180
static char* GetLabelGadgetAccelerator(Widget);
175
181
static KeySym GetLabelGadgetMnemonic(Widget);
176
182
static void GetColors(Widget widget, XmAccessColorData color_data);
178
183
/******** End Static Function Declarations ********/
180
185
void _XmLabelConvert(Widget w, XtPointer ignore, XmConvertCallbackStruct*);
1247
1252
LabG_NormalGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values,
1248
1253
dynamicMask, 0);
1256
/*generally gray insensitive foreground (instead stipple)*/
1257
values.foreground = _XmAssignInsensitiveColor((Widget)lw);
1258
values.background = LabG_Background(lw);
1250
1260
valueMask |= GCFillStyle | GCStipple;
1251
1261
values.foreground = LabG_Background(lw);
1252
1262
values.background = LabG_Foreground(lw);
1253
1263
values.fill_style = FillOpaqueStippled;
1255
1264
values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw);
1257
1267
LabG_InsensitiveGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values,
1258
1268
dynamicMask, 0);
1270
/*light shadow for insensitive text (instead stipple)*/
1271
values.foreground = LabG_TopShadowColor(lw);
1272
LabG_ShadowGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values,
2174
2191
XtReleaseGC (XtParent(w), LabG_NormalGC(w));
2175
2192
XtReleaseGC (XtParent(w), LabG_InsensitiveGC(w));
2194
XtReleaseGC (XtParent(w), LabG_ShadowGC(w));
2177
2196
XtReleaseGC (XtParent(w), LabG_BackgroundGC(w));
2178
2197
XtReleaseGC (XtParent(w), LabG_HighlightGC(w));
2179
2198
XtReleaseGC (XtParent(w), LabG_TopShadowGC(w));
2358
2376
Pixmap pix_use = Pix_insen (lw) ;
2360
2378
if (pix_use == XmUNSPECIFIED_PIXMAP)
2380
Pix_insen(lw) = pix_use = _XmConvertToBW(wid, Pix(lw));
2363
2384
if (pix_use != XmUNSPECIFIED_PIXMAP)
2365
2386
gc = LabG_InsensitiveGC(lw);
2382
2403
lw->rectangle.y + LabG_TextRect(lw).y + LabG_PixmapRect(lw).y,
2385
2407
/* if no insensitive pixmap but a regular one, we need
2386
2408
to do the stipple manually, since copyarea doesn't */
2387
if (pix_use == Pix(lw))
2409
if (pix_use == Pix(lw)) {
2389
2410
/* need fill stipple, not opaque */
2390
2411
XSetFillStyle(XtDisplay(lw), gc, FillStippled);
2391
2412
XFillRectangle(XtDisplay(lw), XtWindow(lw),
2416
2438
tmp[_XmOSKeySymToCharacter(LabG_Mnemonic(lw), NULL, tmp)] = '\0';
2417
2439
underline = XmStringCreate(tmp, LabG_MnemonicCharset(lw));
2441
if (XtIsSensitive(wid) )
2443
/*Draw normal text*/
2444
XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw),
2445
LabG_Font(lw), LabG__label(lw),
2447
lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x,
2448
lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y,
2449
LabG_StringRect(lw).width, LabG_Alignment(lw),
2450
LayoutG(lw), NULL, underline);
2454
/*Draw shadow for insensitive text*/
2455
XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw),
2456
LabG_Font(lw), LabG__label(lw),
2458
lw->rectangle.x+1 + LabG_TextRect(lw).x + LabG_StringRect(lw).x,
2459
lw->rectangle.y+1 + LabG_TextRect(lw).y + LabG_StringRect(lw).y,
2460
LabG_StringRect(lw).width, LabG_Alignment(lw),
2461
LayoutG(lw), NULL, underline);
2462
/*Draw insensitive text*/
2463
XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw),
2464
LabG_Font(lw), LabG__label(lw),
2465
LabG_InsensitiveGC(lw),
2466
lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x,
2467
lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y,
2468
LabG_StringRect(lw).width, LabG_Alignment(lw),
2469
LayoutG(lw), NULL, underline);
2419
2472
XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw),
2420
2473
LabG_Font(lw), LabG__label(lw),
2421
2474
(XtIsSensitive(wid) ?
2424
2477
lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y,
2425
2478
LabG_StringRect(lw).width, LabG_Alignment(lw),
2426
2479
LayoutG(lw), NULL, underline);
2427
2482
XmStringFree(underline);
2487
if (XtIsSensitive(wid) )
2489
/*Draw normal text*/
2490
XmStringDraw (XtDisplay(lw), XtWindow(lw),
2491
LabG_Font(lw), LabG__label(lw),
2493
lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x,
2494
lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y,
2495
LabG_StringRect(lw).width,
2496
LabG_Alignment(lw), LayoutG(lw), NULL);
2500
/*Draw shadow for insensitive text*/
2501
XmStringDraw (XtDisplay(lw), XtWindow(lw),
2502
LabG_Font(lw), LabG__label(lw),
2504
lw->rectangle.x + LabG_TextRect(lw).x+1 + LabG_StringRect(lw).x,
2505
lw->rectangle.y + LabG_TextRect(lw).y+1 + LabG_StringRect(lw).y,
2506
LabG_StringRect(lw).width,
2507
LabG_Alignment(lw), LayoutG(lw), NULL);
2508
/*Draw insensitive text*/
2509
XmStringDraw (XtDisplay(lw), XtWindow(lw),
2510
LabG_Font(lw), LabG__label(lw),
2511
LabG_InsensitiveGC(lw),
2512
lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x,
2513
lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y,
2514
LabG_StringRect(lw).width,
2515
LabG_Alignment(lw), LayoutG(lw), NULL);
2430
2519
XmStringDraw (XtDisplay(lw), XtWindow(lw),
2431
2520
LabG_Font(lw), LabG__label(lw),
2432
2521
(XtIsSensitive(wid) ?
2435
2524
lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y,
2436
2525
LabG_StringRect(lw).width,
2437
2526
LabG_Alignment(lw), LayoutG(lw), NULL);
2439
2531
if (!XtIsSensitive(wid)) {
2440
2532
XSetFillStyle(XtDisplay(lw), LabG_InsensitiveGC(lw), FillStippled);
2464
2557
LabG_MarginLeft(lw) + LabG_TextRect(lw).width +
2465
2558
LabG_MarginRight(lw)))
2561
if (XtIsSensitive(wid) )
2563
/*Draw normal text*/
2564
XmStringDraw (XtDisplay(lw), XtWindow(lw),
2565
LabG_Font(lw), LabG__acceleratorText(lw),
2567
lw->rectangle.x + LabG_AccTextRect(lw).x,
2568
lw->rectangle.y + LabG_AccTextRect(lw).y,
2569
LabG_AccTextRect(lw).width, XmALIGNMENT_END,
2574
/*Draw shadow for insensitive text*/
2575
XmStringDraw (XtDisplay(lw), XtWindow(lw),
2576
LabG_Font(lw), LabG__acceleratorText(lw),
2578
lw->rectangle.x + LabG_AccTextRect(lw).x+1,
2579
lw->rectangle.y + LabG_AccTextRect(lw).y+1,
2580
LabG_AccTextRect(lw).width, XmALIGNMENT_END,
2582
/*Draw insensitive text*/
2583
XmStringDraw (XtDisplay(lw), XtWindow(lw),
2584
LabG_Font(lw), LabG__acceleratorText(lw),
2585
LabG_InsensitiveGC(lw),
2586
lw->rectangle.x + LabG_AccTextRect(lw).x,
2587
lw->rectangle.y + LabG_AccTextRect(lw).y,
2588
LabG_AccTextRect(lw).width, XmALIGNMENT_END,
2467
2592
XmStringDraw (XtDisplay(lw), XtWindow(lw),
2468
2593
LabG_Font(lw), LabG__acceleratorText(lw),
2469
2594
(XtIsSensitive(wid) ?