void JXTextMenuTable::Draw ( JXWindowPainter& p, const JRect& rect ) { JXMenuTable::Draw(p, rect); const JCoordinate w = GetApertureWidth(); const JSize rowCount = GetRowCount(); for (JIndex i=1; i<rowCount; i++) // ignore separator after last item { if (itsTextMenuData->HasSeparator(i)) { JRect r = GetCellRect(JPoint(1,i)); r.top = r.bottom - kSeparatorHeight; r.right = r.left + w; // JXDrawDownFrame(p, r, kSeparatorHeight/2); r.top = r.ycenter() - 1; r.bottom = r.top + 2; JXDrawDownFrame(p, r, 1); } } if (itsHilightRow != 0) { const JRect r = GetCellRect(JPoint(1, itsHilightRow)); JRect r1 = AdjustRectForSeparator(itsHilightRow, r); r1.right = r1.left + w; JXDrawUpFrame(p, r1, kHilightBorderWidth); } }
void JXImageCheckbox::DrawBorder ( JXWindowPainter& p, const JRect& frame ) { const JBoolean drawChecked = DrawChecked(); const JBoolean isActive = IsActive(); const JSize borderWidth = GetBorderWidth(); if (drawChecked && isActive) { JXDrawDownFrame(p, frame, borderWidth); } else if (isActive) { JXDrawUpFrame(p, frame, borderWidth); } else if (borderWidth > 0) { p.SetLineWidth(borderWidth); if (drawChecked) { p.SetPenColor((GetColormap())->GetWhiteColor()); } else { p.SetPenColor((GetColormap())->GetInactiveLabelColor()); } p.RectInside(frame); } }
void JXButton::DrawBorder ( JXWindowPainter& p, const JRect& origFrame ) { JSize borderWidth = GetBorderWidth(); if (borderWidth > 0 && IsActive()) { JRect frame = origFrame; if (itsIsReturnButtonFlag) { p.JPainter::Rect(frame); frame.Shrink(1,1); borderWidth--; } if (itsIsPushedFlag) { JXDrawDownFrame(p, frame, borderWidth); } else { JXDrawUpFrame(p, frame, borderWidth); } } else if (borderWidth > 0) { p.SetLineWidth(borderWidth); p.SetPenColor((GetColormap())->GetInactiveLabelColor()); p.RectInside(origFrame); } }
void Widget::DrawBorder ( JXWindowPainter& p, const JRect& frame ) { JXDrawDownFrame(p, frame, kJXDefaultBorderWidth); }
void JXTextCheckbox::Draw ( JXWindowPainter& p, const JRect& rect ) { const JRect bounds = GetBounds(); const JCoordinate y = bounds.ycenter(); // draw button const JRect boxRect(y - kBoxHalfHeight, kMarginWidth, y + kBoxHalfHeight, kMarginWidth + kBoxHeight); const JBoolean drawChecked = DrawChecked(); const JBoolean isActive = IsActive(); if (drawChecked && isActive) { JXDrawDownFrame(p, boxRect, kJXDefaultBorderWidth, kJTrue, itsPushedColor); } else if (isActive) { JXDrawUpFrame(p, boxRect, kJXDefaultBorderWidth, kJTrue, itsNormalColor); } else { p.SetFilling(kJTrue); if (drawChecked) { p.SetPenColor(itsPushedColor); } else { p.SetPenColor(itsNormalColor); } p.JPainter::Rect(boxRect); p.SetFilling(kJFalse); p.SetLineWidth(kJXDefaultBorderWidth); p.SetPenColor((GetColormap())->GetInactiveLabelColor()); p.RectInside(boxRect); } // draw text JRect textRect = bounds; textRect.left += 2*kMarginWidth + kBoxHeight; p.SetFont(itsFontName, itsFontSize, itsFontStyle); p.String(textRect.left, textRect.top, itsLabel, itsULIndex, textRect.width(), JPainter::kHAlignLeft, textRect.height(), JPainter::kVAlignCenter); }
void JX3DWidget::DrawBorder ( JXWindowPainter& p, const JRect& frame ) { const JSize borderWidth = GetBorderWidth(); if (itsShowFocusFlag && HasFocus() && borderWidth > 0) { p.SetLineWidth(borderWidth); p.SetPenColor((p.GetColormap())->GetWhiteColor()); p.RectInside(frame); } else { JXDrawDownFrame(p, frame, borderWidth); } }