本文整理汇总了C++中JXWindowPainter类的典型用法代码示例。如果您正苦于以下问题:C++ JXWindowPainter类的具体用法?C++ JXWindowPainter怎么用?C++ JXWindowPainter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JXWindowPainter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRowCount
void
GMFilterNameTable::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
JXEditTable::Draw(p, rect);
if (itsDNDIsValid)
{
p.ResetClipRect();
p.SetLineWidth(kDragLineWidth);
if (itsCurrentDNDIndex == 0)
{
JRect crect =
GetCellRect(JPoint(1, GetRowCount()));
p.Line(0, crect.bottom, GetBoundsWidth(), crect.bottom);
}
else
{
JRect crect =
GetCellRect(JPoint(1, itsCurrentDNDIndex));
p.Line(0, crect.top, GetBoundsWidth(), crect.top);
}
}
}
示例2: if
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);
}
}
示例3: if
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);
}
}
示例4: GetBounds
void
JXSearchTextButton::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
const JRect bounds = GetBounds();
JRect r;
r.top = bounds.ycenter() - kArrowHalfHeight;
r.bottom = r.top + 2*kArrowHalfHeight + 1;
r.left = bounds.xcenter() - kArrowHalfWidth;
r.right = r.left + 2*kArrowHalfWidth;
const JColorIndex colorIndex =
IsActive() ? (p.GetColormap())->GetGrayColor(40) :
(p.GetColormap())->GetInactiveLabelColor();
if (itsFwdFlag)
{
r.right++;
JXFillArrowRight(p, r, colorIndex);
}
else
{
r.left--;
JXFillArrowLeft(p, r, colorIndex);
}
}
示例5:
void
JXWidget::DrawBackground
(
JXWindowPainter& p,
const JRect& frame
)
{
p.SetPenColor(GetCurrBackColor());
p.SetFilling(kJTrue);
p.JPainter::Rect(frame);
}
示例6: if
void
JXTabGroup::DrawCloseButton
(
const JIndex index,
JXWindowPainter& p,
const JRect& rect
)
{
if (index != itsMouseIndex)
{
return;
}
else if (!TabCanClose(index))
{
itsCloseRect.Set(0,0,0,0);
return;
}
if (itsEdge == kTop || itsEdge == kBottom)
{
itsCloseRect.top = rect.ycenter() - itsCloseImage->GetHeight()/2;
itsCloseRect.bottom = itsCloseRect.top + itsCloseImage->GetHeight();
itsCloseRect.right = rect.right - kCloseMarginWidth;
itsCloseRect.left = itsCloseRect.right - itsCloseImage->GetWidth();
}
else if (itsEdge == kLeft)
{
itsCloseRect.top = rect.top + kCloseMarginWidth;
itsCloseRect.bottom = itsCloseRect.top + itsCloseImage->GetHeight();
itsCloseRect.left = rect.xcenter() - itsCloseImage->GetWidth()/2;
itsCloseRect.right = itsCloseRect.left + itsCloseImage->GetWidth();
}
else // itsEdge == kRight
{
itsCloseRect.bottom = rect.bottom - kCloseMarginWidth;
itsCloseRect.top = itsCloseRect.bottom - itsCloseImage->GetHeight();
itsCloseRect.left = rect.xcenter() - itsCloseImage->GetWidth()/2;
itsCloseRect.right = itsCloseRect.left + itsCloseImage->GetWidth();
}
if (itsClosePushedFlag)
{
p.Image(*itsClosePushedImage, itsClosePushedImage->GetBounds(), itsCloseRect);
}
else
{
p.Image(*itsCloseImage, itsCloseImage->GetBounds(), itsCloseRect);
}
}
示例7: boxRect
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);
}
示例8: GetBorderWidth
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);
}
}
示例9: GetColormap
void
Widget::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
JXColormap* cmap = GetColormap();
// This is where everything happens
// See JPainter.h for available functions
p.SetPenColor(cmap->GetGreenColor());
p.Rect(10, 10, 50, 50);
p.SetFilling(kJTrue);
p.SetPenColor(cmap->GetBlueColor());
p.Rect(10, 70, 50, 50);
}
示例10: GetColormap
void
ScrollingWidget::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
JXColormap* cmap = GetColormap();
// Drawing goes here
// See JPainter.h for available functions
p.SetPenColor(cmap->GetGreenColor());
p.Rect(10, 10, 50, 50);
p.SetFilling(kJTrue);
p.SetPenColor(cmap->GetBlueColor());
p.Rect(10, 70, 50, 50);
}
示例11: GetBounds
void
JXImageWidget::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
if (itsImage != NULL)
{
p.Image(*itsImage, itsImage->GetBounds(), GetBounds());
}
}
示例12: GetBounds
void
CBCommandTable::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
JXEditTable::Draw(p, rect);
if (itsDNDRowIndex > 0)
{
p.ResetClipRect();
const JSize origLineWidth = p.GetLineWidth();
p.SetLineWidth(3);
const JRect b = GetBounds();
if (RowIndexValid(itsDNDRowIndex))
{
const JRect r = GetCellRect(JPoint(1, itsDNDRowIndex));
p.Line(b.left, r.top, b.right, r.top);
}
else
{
const JRect r = GetCellRect(JPoint(1, GetRowCount()));
p.Line(b.left, r.bottom, b.right, r.bottom);
}
p.SetLineWidth(origLineWidth);
}
}
示例13: GetAperture
void
JXVertPartition::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
p.SetPenColor((p.GetColormap())->GetGray60Color());
const JRect ap = GetAperture();
const JCoordinate x1 = ap.left+1;
const JCoordinate x2 = ap.right-2;
const JSize compartmentCount = GetCompartmentCount();
JCoordinate y = 0;
for (JIndex i=1; i<compartmentCount; i++)
{
y += GetCompartmentSize(i);
p.Line(x1, y+1, x2, y+1);
p.Line(x1, y+3, x2, y+3);
y += kDragRegionSize;
}
}
示例14: GetAperture
void
JXHorizPartition::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
p.SetPenColor((p.GetColormap())->GetGray60Color());
const JRect ap = GetAperture();
const JCoordinate y1 = ap.top+1;
const JCoordinate y2 = ap.bottom-2;
const JSize compartmentCount = GetCompartmentCount();
JCoordinate x = 0;
for (JIndex i=1; i<compartmentCount; i++)
{
x += GetCompartmentSize(i);
p.Line(x+1, y1, x+1, y2);
p.Line(x+3, y1, x+3, y2);
x += kDragRegionSize;
}
}
示例15: GetColormap
void
ClipboardWidget::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
// We need the colormap in order to specify colors.
JXColormap* cmap = GetColormap();
// This is where everything happens
// See JPainter.h for available functions
// This sets the color of the pen.
p.SetPenColor(cmap->GetCyanColor());
// This draws our rectangle.
p.Rect(10, 10, 150, 50);
// This draws itsText.
p.String(20,20,itsText,
130, JPainter::kHAlignCenter,
30, JPainter::kVAlignCenter);
}