264 FXEvent* ev = (FXEvent*)ptr;
265 FXDCWindow dc(
this, ev);
276 dc.setForeground(backColor);
277 dc.fillRectangle(0, 0, width, height);
278 if (!label.empty()) {
279 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
281 dc.setForeground(hiliteColor);
282 dc.drawText(xx + 1, yy + 1, label);
283 if (!accel.empty()) {
284 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel) + 1, yy + 1, accel);
287 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff) + 1, yy + 2, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
289 dc.setForeground(shadowColor);
290 dc.drawText(xx, yy, label);
291 if (!accel.empty()) {
292 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
295 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
298 }
else if (isActive()) {
300 dc.setForeground(selbackColor);
301 dc.fillRectangle(0, 0, width, height);
302 if (!label.empty()) {
303 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
305 dc.setForeground(isEnabled() ? seltextColor : shadowColor);
306 dc.drawText(xx, yy, label);
307 if (!accel.empty()) {
308 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
311 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
316 dc.setForeground(backColor);
317 dc.fillRectangle(0, 0, width, height);
318 if (!label.empty()) {
319 yy = font->getFontAscent() + (height - font->getFontHeight()) / 2;
321 dc.setForeground(textColor);
322 dc.drawText(xx, yy, label);
323 if (!accel.empty()) {
324 dc.drawText(width -
TRAILSPACE - font->getTextWidth(accel), yy, accel);
327 dc.fillRectangle(xx + font->getTextWidth(&label[0], hotoff), yy + 1, font->getTextWidth(&label[hotoff], wclen(&label[hotoff])), 1);
333 yy = (height - 9) / 2;
335 dc.setForeground(backColor);
338 dc.fillRectangle(xx + 1, yy + 1, 8, 8);
339 dc.setForeground(shadowColor);
340 dc.drawRectangle(xx, yy, 9, 9);
345 seg[0].x1 = 2 + (FXshort)xx;
346 seg[0].y1 = 4 + (FXshort)yy;
347 seg[0].x2 = 4 + (FXshort)xx;
348 seg[0].y2 = 6 + (FXshort)yy;
349 seg[1].x1 = 2 + (FXshort)xx;
350 seg[1].y1 = 5 + (FXshort)yy;
351 seg[1].x2 = 4 + (FXshort)xx;
352 seg[1].y2 = 7 + (FXshort)yy;
353 seg[2].x1 = 2 + (FXshort)xx;
354 seg[2].y1 = 6 + (FXshort)yy;
355 seg[2].x2 = 4 + (FXshort)xx;
356 seg[2].y2 = 8 + (FXshort)yy;
357 seg[3].x1 = 4 + (FXshort)xx;
358 seg[3].y1 = 6 + (FXshort)yy;
359 seg[3].x2 = 8 + (FXshort)xx;
360 seg[3].y2 = 2 + (FXshort)yy;
361 seg[4].x1 = 4 + (FXshort)xx;
362 seg[4].y1 = 7 + (FXshort)yy;
363 seg[4].x2 = 8 + (FXshort)xx;
364 seg[4].y2 = 3 + (FXshort)yy;
365 seg[5].x1 = 4 + (FXshort)xx;
366 seg[5].y1 = 8 + (FXshort)yy;
367 seg[5].x2 = 8 + (FXshort)xx;
368 seg[5].y2 = 4 + (FXshort)yy;
371 dc.setForeground(shadowColor);
373 dc.setForeground(textColor);
376 dc.setForeground(shadowColor);
378 dc.drawLineSegments(seg, 6);
384 xx += 5 +
myIcon->getWidth();
387 xx += 5 +
myIcon->getWidth();