本文整理汇总了C++中TPoint::Offset方法的典型用法代码示例。如果您正苦于以下问题:C++ TPoint::Offset方法的具体用法?C++ TPoint::Offset怎么用?C++ TPoint::Offset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPoint
的用法示例。
在下文中一共展示了TPoint::Offset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LocalToTopLevel
void TWindow::LocalToTopLevel(TPoint& point) const
{
const TWindow* window = this;
const TPoint& scroll = GetScroll();
point.Offset(-scroll.h, -scroll.v);
while (window->fParent)
{
point.Offset(window->fBounds.left, window->fBounds.top);
window = window->fParent;
}
}
示例2: LocalToRoot
void TWindow::LocalToRoot(TPoint& point) const
{
int x, y;
Window childWindow;
XTranslateCoordinates(sDisplay, fWindow, gApplication->GetRootWindow(),
0, 0, &x, &y, &childWindow);
const TPoint& scroll = GetScroll();
point.Offset(x - scroll.h, y - scroll.v);
}
示例3: PaintButton
//
/// Paints a maximize box on the tiny caption bar.
//
void
TTinyCaption::PaintMaxBox(TDC& dc, TRect& boxRect, bool pressed)
{
// Fill the box with light gray & draw bevel if possible
//
PaintButton(dc, boxRect, pressed);
if (pressed)
boxRect.Offset(1,1);
// Down triangle
//
int bh = boxRect.Height();
int bw = boxRect.Width();
if (IsZoomed()) {
TPoint begPt = boxRect.BottomLeft().OffsetBy((bw+1)/4, -bh*3/8);
TPoint endPt = begPt.OffsetBy((bw+1)/2, 0);
while (begPt.x < endPt.x) {
dc.MoveTo(begPt);
dc.LineTo(endPt);
begPt.Offset(1,1);
endPt.Offset(-1,1);
}
}
// Up triangle
//
{
TPoint begPt = boxRect.TopLeft().OffsetBy((bw+1)/4, IsZoomed() ? bh*3/8 : bh*2/3);
TPoint endPt = begPt.OffsetBy((bw+1)/2, 0);
while (begPt.x < endPt.x) {
dc.MoveTo(begPt);
dc.LineTo(endPt);
begPt.Offset(1, -1);
endPt.Offset(-1, -1);
}
}
}