277 FXEvent* ev = (FXEvent*)ptr;
278 FXDCWindow dc(
this, ev);
289 dc.setForeground(backColor);
290 dc.fillRectangle(0, 0, width, height);
291 if (!label.empty()) {
292 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
294 dc.setForeground(hiliteColor);
295 dc.drawText(xx + 1, yy + 1, label);
296 if (!accel.empty()) {
297 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel) + 1, yy + 1, accel);
300 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff) + 1, yy + 2, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
302 dc.setForeground(shadowColor);
303 dc.drawText(xx, yy, label);
304 if (!accel.empty()) {
305 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
308 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
311 }
else if (isActive()) {
313 dc.setForeground(selbackColor);
314 dc.fillRectangle(0, 0, width, height);
315 if (!label.empty()) {
316 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
318 dc.setForeground(isEnabled() ? seltextColor : shadowColor);
319 dc.drawText(xx, yy, label);
320 if (!accel.empty()) {
321 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
324 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
329 dc.setForeground(backColor);
330 dc.fillRectangle(0, 0, width, height);
331 if (!label.empty()) {
332 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
334 dc.setForeground(textColor);
335 dc.drawText(xx, yy, label);
336 if (!accel.empty()) {
337 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
340 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
346 yy = (height - 9) / 2;
348 dc.setForeground(backColor);
351 dc.fillRectangle(xx + 1, yy + 1, 8, 8);
352 dc.setForeground(shadowColor);
353 dc.drawRectangle(xx, yy, 9, 9);
358 seg[0].x1 = 2 + (FXshort)xx;
359 seg[0].y1 = 4 + (FXshort)yy;
360 seg[0].x2 = 4 + (FXshort)xx;
361 seg[0].y2 = 6 + (FXshort)yy;
362 seg[1].x1 = 2 + (FXshort)xx;
363 seg[1].y1 = 5 + (FXshort)yy;
364 seg[1].x2 = 4 + (FXshort)xx;
365 seg[1].y2 = 7 + (FXshort)yy;
366 seg[2].x1 = 2 + (FXshort)xx;
367 seg[2].y1 = 6 + (FXshort)yy;
368 seg[2].x2 = 4 + (FXshort)xx;
369 seg[2].y2 = 8 + (FXshort)yy;
370 seg[3].x1 = 4 + (FXshort)xx;
371 seg[3].y1 = 6 + (FXshort)yy;
372 seg[3].x2 = 8 + (FXshort)xx;
373 seg[3].y2 = 2 + (FXshort)yy;
374 seg[4].x1 = 4 + (FXshort)xx;
375 seg[4].y1 = 7 + (FXshort)yy;
376 seg[4].x2 = 8 + (FXshort)xx;
377 seg[4].y2 = 3 + (FXshort)yy;
378 seg[5].x1 = 4 + (FXshort)xx;
379 seg[5].y1 = 8 + (FXshort)yy;
380 seg[5].x2 = 8 + (FXshort)xx;
381 seg[5].y2 = 4 + (FXshort)yy;
384 dc.setForeground(shadowColor);
386 dc.setForeground(textColor);
389 dc.setForeground(shadowColor);
391 dc.drawLineSegments(seg, 6);
397 xx += 5 +
myIcon->getWidth();
400 xx += 5 +
myIcon->getWidth();