Lines Matching refs:cbw

170 Get_GC(cbw, fg, bg)
171 CommandWidget cbw;
178 values.font = cbw->label.font->fid;
181 if (cbw->command.highlight_thickness > 1 )
182 values.line_width = cbw->command.highlight_thickness;
186 if ( cbw->simple.international == True )
187 return XtAllocateGC((Widget)cbw, 0,
191 return XtGetGC((Widget)cbw,
204 CommandWidget cbw = (CommandWidget) new;
207 if (cbw->command.shape_style != XawShapeRectangle
210 cbw->command.shape_style = XawShapeRectangle;
211 if (cbw->command.highlight_thickness == DEFAULT_SHAPE_HIGHLIGHT) {
212 if (cbw->command.shape_style != XawShapeRectangle)
213 cbw->command.highlight_thickness = 0;
215 cbw->command.highlight_thickness = DEFAULT_HIGHLIGHT_THICKNESS;
218 cbw->command.normal_GC = Get_GC(cbw, cbw->label.foreground,
219 cbw->core.background_pixel);
220 cbw->command.inverse_GC = Get_GC(cbw, cbw->core.background_pixel,
221 cbw->label.foreground);
222 XtReleaseGC(new, cbw->label.normal_GC);
223 cbw->label.normal_GC = cbw->command.normal_GC;
225 cbw->command.set = FALSE;
226 cbw->command.highlighted = HighlightNone;
230 HighlightRegion(cbw)
231 CommandWidget cbw;
236 if (cbw->command.highlight_thickness == 0 ||
237 cbw->command.highlight_thickness >
238 (Dimension) ((Dimension) Min(cbw->core.width, cbw->core.height)/2))
249 rect.width = cbw->core.width;
250 rect.height = cbw->core.height;
252 rect.x = rect.y = cbw->command.highlight_thickness;
253 rect.width -= cbw->command.highlight_thickness * 2;
254 rect.height -= cbw->command.highlight_thickness * 2;
274 CommandWidget cbw = (CommandWidget)w;
276 if (cbw->command.set)
279 cbw->command.set= TRUE;
292 CommandWidget cbw = (CommandWidget)w;
294 if (!cbw->command.set)
297 cbw->command.set = FALSE;
312 CommandWidget cbw = (CommandWidget)w;
314 if (cbw->command.set) {
315 cbw->command.highlighted = HighlightNone;
329 CommandWidget cbw = (CommandWidget)w;
332 cbw->command.highlighted = HighlightWhenUnset;
339 cbw->command.highlighted = HighlightAlways;
342 cbw->command.highlighted = HighlightWhenUnset;
348 PaintCommandWidget(w, event, HighlightRegion(cbw), TRUE);
359 CommandWidget cbw = (CommandWidget)w;
361 cbw->command.highlighted = HighlightNone;
363 PaintCommandWidget(w, event, HighlightRegion(cbw), TRUE);
374 CommandWidget cbw = (CommandWidget)w;
380 if (cbw->command.set)
381 XtCallCallbackList(w, cbw->command.callbacks, (XtPointer) NULL);
419 CommandWidget cbw = (CommandWidget) w;
424 very_thick = cbw->command.highlight_thickness >
425 (Dimension)((Dimension) Min(cbw->core.width, cbw->core.height)/2);
427 if (cbw->command.set) {
428 cbw->label.normal_GC = cbw->command.inverse_GC;
429 XFillRectangle(XtDisplay(w), XtWindow(w), cbw->command.normal_GC,
430 0, 0, cbw->core.width, cbw->core.height);
434 cbw->label.normal_GC = cbw->command.normal_GC;
436 if ((int)cbw->command.highlight_thickness <= 0)
446 if (cbw->command.set == (cbw->command.highlighted == HighlightNone)) {
447 norm_gc = cbw->command.inverse_GC;
448 rev_gc = cbw->command.normal_GC;
451 norm_gc = cbw->command.normal_GC;
452 rev_gc = cbw->command.inverse_GC;
455 if ( !( (!change && (cbw->command.highlighted == HighlightNone)) ||
456 ((cbw->command.highlighted == HighlightWhenUnset) &&
457 (cbw->command.set))) ) {
459 cbw->label.normal_GC = norm_gc; /* Give the label the right GC. */
461 0, 0, cbw->core.width, cbw->core.height);
465 int offset = cbw->command.highlight_thickness/2;
467 cbw->core.width - cbw->command.highlight_thickness,
468 cbw->core.height - cbw->command.highlight_thickness);
478 CommandWidget cbw = (CommandWidget) w;
481 if (cbw->label.normal_GC == cbw->command.normal_GC)
482 XtReleaseGC( w, cbw->command.inverse_GC );
484 XtReleaseGC( w, cbw->command.normal_GC );
499 CommandWidget cbw = (CommandWidget) new;
502 if ( oldcbw->core.sensitive != cbw->core.sensitive && !cbw->core.sensitive) {
504 cbw->command.set = FALSE;
505 cbw->command.highlighted = HighlightNone;
509 if ( (oldcbw->label.foreground != cbw->label.foreground) ||
510 (oldcbw->core.background_pixel != cbw->core.background_pixel) ||
512 cbw->command.highlight_thickness) ||
513 (oldcbw->label.font != cbw->label.font) )
517 XtReleaseGC(new, cbw->command.inverse_GC);
519 XtReleaseGC(new, cbw->command.normal_GC);
521 cbw->command.normal_GC = Get_GC(cbw, cbw->label.foreground,
522 cbw->core.background_pixel);
523 cbw->command.inverse_GC = Get_GC(cbw, cbw->core.background_pixel,
524 cbw->label.foreground);
525 XtReleaseGC(new, cbw->label.normal_GC);
526 cbw->label.normal_GC = (cbw->command.set
527 ? cbw->command.inverse_GC
528 : cbw->command.normal_GC);
534 && oldcbw->command.shape_style != cbw->command.shape_style
535 && !ShapeButton(cbw, TRUE))
537 cbw->command.shape_style = oldcbw->command.shape_style;
552 ShapeButton(cbw, checkRectangular)
553 CommandWidget cbw;
558 if ( (cbw->command.shape_style == XawShapeRoundedRectangle) ) {
559 corner_size = (cbw->core.width < cbw->core.height) ? cbw->core.width
560 : cbw->core.height;
561 corner_size = (int) (corner_size * cbw->command.corner_round) / 100;
564 if (checkRectangular || cbw->command.shape_style != XawShapeRectangle) {
565 if (!XmuReshapeWidget((Widget) cbw, cbw->command.shape_style,
567 cbw->command.shape_style = XawShapeRectangle;