本文整理汇总了C++中JRect::Shrink方法的典型用法代码示例。如果您正苦于以下问题:C++ JRect::Shrink方法的具体用法?C++ JRect::Shrink怎么用?C++ JRect::Shrink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRect
的用法示例。
在下文中一共展示了JRect::Shrink方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScrollToRect
JBoolean
JXWidget::ScrollToRectCentered
(
const JRect& origRect,
const JBoolean forceScroll
)
{
const JRect ap = GetAperture();
if (!forceScroll && ap.Contains(origRect))
{
return kJFalse;
}
JRect r = origRect;
const JCoordinate dw = ap.width() - r.width();
if (dw > 0)
{
r.Shrink(-dw/2, 0);
}
const JCoordinate dh = ap.height() - r.height();
if (dh > 0)
{
r.Shrink(0, -dh/2);
}
return ScrollToRect(r);
}
示例2: if
void
JXTabGroup::PlaceCardFile()
{
const JSize h = kSelMargin + kBorderWidth + 2*kTextMargin +
(GetFontManager())->GetLineHeight(itsFontName, itsFontSize, itsFontStyle);
JRect r = GetAperture();
if (itsEdge == kTop)
{
r.top += h;
}
else if (itsEdge == kLeft)
{
r.left += h;
}
else if (itsEdge == kBottom)
{
r.bottom -= h;
}
else if (itsEdge == kRight)
{
r.right -= h;
}
else
{
assert( 0 );
}
r.Shrink(kBorderWidth, kBorderWidth);
itsCardFile->Place(r.left, r.top);
itsCardFile->SetSize(r.width(), r.height());
}
示例3: AdjustRectForSeparator
void
JXStyleMenuTable::TableDrawCell
(
JPainter& p,
const JPoint& cell,
const JRect& origRect
)
{
if (cell.x == kTextColumnIndex && cell.y >= JXStyleMenu::kFirstColorCmd)
{
JRect rect = AdjustRectForSeparator(cell.y, origRect);
JRect colorRect = rect;
colorRect.Shrink(0, kHilightBorderWidth);
colorRect.right = colorRect.left + colorRect.height();
const JBoolean origFill = p.IsFilling();
p.SetFilling(kJTrue);
p.SetPenColor(itsStyleMenu->IndexToColor(cell.y));
p.Rect(colorRect);
p.SetFilling(origFill);
rect = origRect;
rect.left += colorRect.width() + kHMarginWidth;
JXTextMenuTable::TableDrawCell(p, cell, rect);
}
else
{
JXTextMenuTable::TableDrawCell(p, cell, origRect);
}
}
示例4: 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);
}
}
示例5:
JRect
JXWidget::GetApertureGlobal()
const
{
JRect apG = itsFrameG;
apG.Shrink(itsBorderWidth, itsBorderWidth);
return apG;
}
示例6: GetColormap
void
CMLineIndexTable::DrawBreakpoints
(
JPainter& p,
const JPoint& cell,
const JRect& rect
)
{
// check for breakpoint(s) on this line
JBoolean hasMultiple;
if (!FindNextBreakpoint(cell.y, &hasMultiple))
{
return;
}
// draw breakpoint(s)
JRect r = rect;
r.Shrink(kMarginWidth, kMarginWidth);
if (hasMultiple)
{
if (r.height() < 9) // to allow concentric circles to be distinguished
{
r.top = rect.ycenter() - 4;
r.bottom = r.top + 9;
r.left = rect.xcenter() - 4;
r.right = r.left + 9;
}
p.Ellipse(r);
r.Shrink(3, 3);
p.Ellipse(r);
}
else
{
DrawBreakpoint(itsBPList->NthElement(itsBPDrawIndex), p, GetColormap(), r);
}
}