本文整理汇总了C++中TRect::Inflate方法的典型用法代码示例。如果您正苦于以下问题:C++ TRect::Inflate方法的具体用法?C++ TRect::Inflate怎么用?C++ TRect::Inflate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRect
的用法示例。
在下文中一共展示了TRect::Inflate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: brush
void
TFlatPainter::Paint(TDC& dc, TRect& rect)
{
TWindow* wnd = TYPESAFE_DOWNCAST(this, TWindow);
if(!wnd)
return;
if(IsSet(fpMouseIn) && wnd->IsWindowEnabled()){
// We draw the "tracked" situation
#ifdef TEST
TBrush brush (TColor::LtRed);
#else
TBrush brush (TColor::Sys3dFace);
#endif
dc.FrameRect(rect, brush);
rect.Inflate(-1, -1);
dc.FrameRect(rect, brush);
rect.Inflate(-1, -1);
dc.FrameRect(rect, brush);
rect.Inflate(1, 1);
TUIBorder::DrawEdge(dc, rect, TUIBorder::SunkenOuter, TUIBorder::Rect);
}
else{
// We draw the "untracked" situation
#ifdef TEST
TBrush brush(TColor::LtBlue);
TBrush brush2(TColor::LtGreen);
#else
TBrush brush(TColor::Sys3dFace);
TBrush brush2(TColor::SysWindow);
#endif
dc.FrameRect(rect,brush);
rect.Inflate(-1, -1);
dc.FrameRect(rect,brush);
rect.Inflate(-1, -1);
dc.FrameRect(rect, brush2);
}
}
示例2: if
/// Move and resize the window so that the window is the same size as the hyperlink
/// text. This stops the hyperlink cursor being active when it is not directly over
/// the text. If the text is left justified then the window is merely shrunk, but if
/// it is centred or right justified then the window will have to be moved as well.
//
// Suggested by Pål K. Tønder
void
TUrlLink::PositionWindow()
{
// Get the current window position
TRect rect;
GetWindowRect(rect);
TWindow* pParent = GetParentO();
if(pParent){
pParent->ScreenToClient(rect.TopLeft());
pParent->ScreenToClient(rect.BottomRight());
}
// Get the size of the window text
TTmpBuffer<tchar> buffer(MAX_PATH);
GetText(buffer, MAX_PATH);
TSize size = LinkFont->GetTextExtent(&buffer[0]);
// Get the text justification via the window style
uint32 style = GetStyle(); //TWindow
// Recalc the window size and position based on the text justification
if (style & SS_CENTERIMAGE)
rect.Inflate(0, -(rect.Height() - size.cy)/2);
else
rect.bottom = rect.top + size.cy;
if (style & SS_CENTER)
rect.Inflate( -(rect.Width() - size.cx)/2, 0);
else if (style & SS_RIGHT)
rect.left = rect.right - size.cx;
else // SS_LEFT = 0, so we can't test for it explicitly
rect.right = rect.left + size.cx;
// Move the window
SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER);
}
示例3: winFrameBr
//
/// Paints a blank button.
//
void
TTinyCaption::PaintButton(TDC& dc, TRect& r, bool pressed)
{
TBrush winFrameBr(TColor::SysWindowFrame);
// dc.OWLFastWindowFrame(winFrameBr, r, 1, 1);
dc.FrameRect(r, winFrameBr);
r.Inflate(-1,-1);
dc.TextRect(r, TColor::Sys3dFace);
if (r.Width() > 4 && r.Height() > 4) {
if (pressed) {
dc.TextRect(r.left, r.top, r.right, r.top+1, TColor::Sys3dShadow);
dc.TextRect(r.left, r.top+1, r.left+1, r.bottom, TColor::Sys3dShadow);
}
else {
dc.TextRect(r.left, r.top, r.right-1, r.top+1, TColor::Sys3dHilight);
dc.TextRect(r.left, r.top+1, r.left+1, r.bottom-1, TColor::Sys3dHilight);
dc.TextRect(r.right-1, r.top+1, r.right, r.bottom, TColor::Sys3dShadow);
dc.TextRect(r.left+1, r.bottom-1, r.right-1, r.bottom, TColor::Sys3dShadow);
}
}
}