265 FXEvent* ev = (FXEvent*)ptr;
266 FXDCWindow dc(
this, ev);
277 dc.setForeground(backColor);
278 dc.fillRectangle(0, 0, width, height);
279 if (!label.empty()) {
280 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
282 dc.setForeground(hiliteColor);
283 dc.drawText(xx + 1, yy + 1, label);
284 if (!accel.empty()) {
285 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel) + 1, yy + 1, accel);
288 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff) + 1, yy + 2, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
290 dc.setForeground(shadowColor);
291 dc.drawText(xx, yy, label);
292 if (!accel.empty()) {
293 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
296 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
299 }
else if (isActive()) {
301 dc.setForeground(selbackColor);
302 dc.fillRectangle(0, 0, width, height);
303 if (!label.empty()) {
304 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
306 dc.setForeground(isEnabled() ? seltextColor : shadowColor);
307 dc.drawText(xx, yy, label);
308 if (!accel.empty()) {
309 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
312 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
317 dc.setForeground(backColor);
318 dc.fillRectangle(0, 0, width, height);
319 if (!label.empty()) {
320 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
322 dc.setForeground(textColor);
323 dc.drawText(xx, yy, label);
324 if (!accel.empty()) {
325 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
328 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
334 yy = (height - 9) / 2;
336 dc.setForeground(backColor);
339 dc.fillRectangle(xx + 1, yy + 1, 8, 8);
340 dc.setForeground(shadowColor);
341 dc.drawRectangle(xx, yy, 9, 9);
346 seg[0].x1 = 2 + (FXshort)xx;
347 seg[0].y1 = 4 + (FXshort)yy;
348 seg[0].x2 = 4 + (FXshort)xx;
349 seg[0].y2 = 6 + (FXshort)yy;
350 seg[1].x1 = 2 + (FXshort)xx;
351 seg[1].y1 = 5 + (FXshort)yy;
352 seg[1].x2 = 4 + (FXshort)xx;
353 seg[1].y2 = 7 + (FXshort)yy;
354 seg[2].x1 = 2 + (FXshort)xx;
355 seg[2].y1 = 6 + (FXshort)yy;
356 seg[2].x2 = 4 + (FXshort)xx;
357 seg[2].y2 = 8 + (FXshort)yy;
358 seg[3].x1 = 4 + (FXshort)xx;
359 seg[3].y1 = 6 + (FXshort)yy;
360 seg[3].x2 = 8 + (FXshort)xx;
361 seg[3].y2 = 2 + (FXshort)yy;
362 seg[4].x1 = 4 + (FXshort)xx;
363 seg[4].y1 = 7 + (FXshort)yy;
364 seg[4].x2 = 8 + (FXshort)xx;
365 seg[4].y2 = 3 + (FXshort)yy;
366 seg[5].x1 = 4 + (FXshort)xx;
367 seg[5].y1 = 8 + (FXshort)yy;
368 seg[5].x2 = 8 + (FXshort)xx;
369 seg[5].y2 = 4 + (FXshort)yy;
372 dc.setForeground(shadowColor);
374 dc.setForeground(textColor);
377 dc.setForeground(shadowColor);
379 dc.drawLineSegments(seg, 6);
385 xx += 5 +
myIcon->getWidth();
388 xx += 5 +
myIcon->getWidth();