Lines Matching refs:cbw

190 Get_GC(cbw, fg, bg)
191 CommandWidget cbw;
198 values.font = cbw->label.font->fid;
201 if (cbw->command.highlight_thickness > 1 )
202 values.line_width = cbw->command.highlight_thickness;
206 return XtGetGC((Widget)cbw,
219 CommandWidget cbw = (CommandWidget) new;
223 if (cbw->command.shape_style != XawShapeRectangle
226 cbw->command.shape_style = XawShapeRectangle;
227 if (cbw->command.highlight_thickness == DEFAULT_SHAPE_HIGHLIGHT) {
228 if (cbw->command.shape_style != XawShapeRectangle)
229 cbw->command.highlight_thickness = 0;
231 cbw->command.highlight_thickness = DEFAULT_HIGHLIGHT_THICKNESS;
235 cbw->command.normal_GC = Get_GC(cbw, cbw->label.foreground,
236 cbw->core.background_pixel);
237 cbw->command.inverse_GC = Get_GC(cbw, cbw->core.background_pixel,
238 cbw->label.foreground);
239 XtReleaseGC(new, cbw->label.normal_GC);
240 cbw->label.normal_GC = cbw->command.normal_GC;
242 cbw->command.set = FALSE;
243 cbw->command.highlighted = HighlightNone;
247 HighlightRegion(cbw)
248 CommandWidget cbw;
253 if (cbw->command.highlight_thickness == 0 ||
254 cbw->command.highlight_thickness > Min(cbw->core.width,
255 cbw->core.height)/2)
266 rect.width = cbw->core.width;
267 rect.height = cbw->core.height;
269 rect.x = rect.y = cbw->command.highlight_thickness;
270 rect.width -= cbw->command.highlight_thickness * 2;
271 rect.height -= cbw->command.highlight_thickness * 2;
291 CommandWidget cbw = (CommandWidget)w;
293 if (cbw->command.set)
296 cbw->command.set= TRUE;
309 CommandWidget cbw = (CommandWidget)w;
311 if (!cbw->command.set)
314 cbw->command.set = FALSE;
329 CommandWidget cbw = (CommandWidget)w;
331 if (cbw->command.set) {
332 cbw->command.highlighted = HighlightNone;
347 CommandWidget cbw = (CommandWidget)w;
350 cbw->command.highlighted = HighlightWhenUnset;
357 cbw->command.highlighted = HighlightAlways;
360 cbw->command.highlighted = HighlightWhenUnset;
366 PaintCommandWidget(w, HighlightRegion(cbw), TRUE);
377 CommandWidget cbw = (CommandWidget)w;
379 cbw->command.highlighted = HighlightNone;
381 PaintCommandWidget(w, HighlightRegion(cbw), TRUE);
392 CommandWidget cbw = (CommandWidget)w;
398 if (cbw->command.set)
399 XtCallCallbackList(w, cbw->command.callbacks, NULL);
436 CommandWidget cbw = (CommandWidget) w;
440 very_thick = cbw->command.highlight_thickness > Min(cbw->core.width,
441 cbw->core.height)/2;
443 if (cbw->command.set) {
444 cbw->label.normal_GC = cbw->command.inverse_GC;
445 XFillRectangle(XtDisplay(w), XtWindow(w), cbw->command.normal_GC,
446 0, 0, cbw->core.width, cbw->core.height);
450 cbw->label.normal_GC = cbw->command.normal_GC;
452 if (cbw->command.highlight_thickness <= 0)
462 if (cbw->command.set == (cbw->command.highlighted == HighlightNone)) {
463 norm_gc = cbw->command.inverse_GC;
464 rev_gc = cbw->command.normal_GC;
467 norm_gc = cbw->command.normal_GC;
468 rev_gc = cbw->command.inverse_GC;
471 if ( !( (!change && (cbw->command.highlighted == HighlightNone)) ||
472 ((cbw->command.highlighted == HighlightWhenUnset) &&
473 (cbw->command.set))) ) {
475 cbw->label.normal_GC = norm_gc; /* Give the label the right GC. */
477 0, 0, cbw->core.width, cbw->core.height);
481 int offset = cbw->command.highlight_thickness/2;
483 cbw->core.width - cbw->command.highlight_thickness,
484 cbw->core.height - cbw->command.highlight_thickness);
494 CommandWidget cbw = (CommandWidget) w;
497 if (cbw->label.normal_GC == cbw->command.normal_GC)
498 XtReleaseGC( w, cbw->command.inverse_GC );
500 XtReleaseGC( w, cbw->command.normal_GC );
513 CommandWidget cbw = (CommandWidget) new;
516 if ( oldcbw->core.sensitive != cbw->core.sensitive && !cbw->core.sensitive) {
518 cbw->command.set = FALSE;
519 cbw->command.highlighted = HighlightNone;
523 if ( (oldcbw->label.foreground != cbw->label.foreground) ||
524 (oldcbw->core.background_pixel != cbw->core.background_pixel) ||
526 cbw->command.highlight_thickness) ||
527 (oldcbw->label.font != cbw->label.font) )
531 XtReleaseGC(new, cbw->command.inverse_GC);
533 XtReleaseGC(new, cbw->command.normal_GC);
535 cbw->command.normal_GC = Get_GC(cbw, cbw->label.foreground,
536 cbw->core.background_pixel);
537 cbw->command.inverse_GC = Get_GC(cbw, cbw->core.background_pixel,
538 cbw->label.foreground);
539 XtReleaseGC(new, cbw->label.normal_GC);
540 cbw->label.normal_GC = (cbw->command.set
541 ? cbw->command.inverse_GC
542 : cbw->command.normal_GC);
549 && oldcbw->command.shape_style != cbw->command.shape_style
550 && !ShapeButton(cbw))
552 cbw->command.shape_style = oldcbw->command.shape_style;
573 ShapeButton(cbw)
574 CommandWidget cbw;
578 if ( (cbw->command.shape_style == XawShapeRoundedRectangle) ) {
579 corner_size = (cbw->core.width < cbw->core.height) ? cbw->core.width
580 : cbw->core.height;
581 corner_size = (corner_size * cbw->command.corner_round) / 100;
584 if (cbw->command.shape_style != XawShapeRectangle) {
585 if (!XmuReshapeWidget((Widget) cbw, cbw->command.shape_style,
587 cbw->command.shape_style = XawShapeRectangle;