当前位置: 首页>>代码示例>>C++>>正文


C++ TDC::TextRect方法代码示例

本文整理汇总了C++中TDC::TextRect方法的典型用法代码示例。如果您正苦于以下问题:C++ TDC::TextRect方法的具体用法?C++ TDC::TextRect怎么用?C++ TDC::TextRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDC的用法示例。


在下文中一共展示了TDC::TextRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: glyphRect

//
/// Paints a close box on the tiny caption bar. You can override the default box if
/// you want to design your own close box.
//
void
TTinyCaption::PaintCloseBox(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);

    // Do something different to differentiate from standard system menu--
    // draw a recessed black box glyph about half the button size, centered
    //
    int glyphWidth  = boxRect.Width() > 7 ?
                      boxRect.Width()-boxRect.Width()/2-1 : boxRect.Width()-3;
    int glyphHeight = boxRect.Height() > 7 ?
                      boxRect.Height()-boxRect.Height()/2-1 : boxRect.Height()-3;
    if (glyphWidth > 1 && glyphHeight > 1) {
        TRect glyphRect(0, 0, glyphWidth, glyphHeight);
        glyphRect.Offset(boxRect.left + (boxRect.Width()-glyphWidth-1)/2,
                         boxRect.top + (boxRect.Height()-glyphHeight-1)/2);

        dc.TextRect(glyphRect, TColor::Sys3dShadow);
        glyphRect.Offset(1,1);
        dc.TextRect(glyphRect, TColor::Sys3dHilight);
        glyphRect.BottomRight().Offset(-1,-1);
        dc.TextRect(glyphRect, TColor::SysBtnText);
    }
}
开发者ID:bowlofstew,项目名称:Meridian59,代码行数:33,代码来源:tinycapt.cpp

示例2: ventRect

//
/// Paints the system box.
//
void
TTinyCaption::PaintSysBox(TDC& dc, TRect& boxRect, bool /*pressed*/)
{
    // Dont paint over the left & top borders
    //
    boxRect.left++;
    boxRect.top++;

    // Fill the box with 3d face
    //
    dc.TextRect(boxRect, TColor::Sys3dFace);

    // Draw the ventilator (sysmenu) box, with shadow
    //
    TPoint begPt = boxRect.TopLeft().OffsetBy(2, (boxRect.Height()-3)/2);
    TRect ventRect(begPt, TSize(boxRect.Width()-5, 3));

    // Draw shadow down and right 1
    //
    dc.TextRect(ventRect.left+1, ventRect.top+1,
                ventRect.right+1, ventRect.bottom+1, TColor::Sys3dShadow);

    // Draw ventilator rectangle
    //
    TBrush btnTextBr(TColor::SysBtnText);
    dc.FrameRect(ventRect, btnTextBr);

    // Draw white interior of ventilator
    //
    dc.TextRect(ventRect.left+1, ventRect.top+1,
                ventRect.right-1, ventRect.top+2, TColor::Sys3dHilight);

    dc.TextRect(boxRect.right, boxRect.top,
                boxRect.right+1, boxRect.bottom, TColor::SysBtnText);
}
开发者ID:bowlofstew,项目名称:Meridian59,代码行数:38,代码来源:tinycapt.cpp

示例3: GetClientRect

//
/// Adjusts the message bar and paints a highlight line. Then, PaintGadgets either
/// paints the hint text if any is set or calls TGadgetWindow::PaintGadgets to
/// repaint each gadget.
//
void
TMessageBar::PaintGadgets(TDC& dc, bool erase, TRect& rect)
{
  if (HighlightLine && rect.top == 0)
    dc.TextRect(0, 0, rect.right, TUIMetric::CyBorder, TColor::Sys3dHilight);

  if (!HintText.empty())
  {
    TRect clientRect = GetClientRect();
    int y = (clientRect.bottom - GetFontHeight()) / 2;
    if (HighlightLine)
      clientRect.top += TUIMetric::CyBorder;
    dc.SelectObject(GetFont());
    dc.SetBkColor(TColor::Sys3dFace);
    dc.ExtTextOut(5, y, ETO_OPAQUE, &clientRect, HintText, static_cast<int>(HintText.length()));
  }
  else
  {
    TGadgetWindow::PaintGadgets(dc, erase, rect);
  }
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:26,代码来源:messageb.cpp

示例4: 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);
        }
    }
}
开发者ID:bowlofstew,项目名称:Meridian59,代码行数:25,代码来源:tinycapt.cpp


注:本文中的TDC::TextRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。