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


C++ TDC类代码示例

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


在下文中一共展示了TDC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: LineViewer

void TSensorView::LineViewer(TDC& dc,PSHORTREAL pData)
{
  m_xSize = m_nDimSize[0]-1;
  m_ySize = m_nDimSize[1]-1;
  m_yAdd = (int) (500L * m_ySize / m_xSize / 2);
  dc.SetWindowExt(TSize(m_xSize * 2 +  m_ySize,500 + m_yAdd));
  Grid3D(dc);
  if(m_nDimSize[1] == 1)
    for(int x = 0; x < m_nDimSize[0]; x++)
    {
      TPoint pt = Project2D(x,0,pData[x]);
      if (x)
        LINE(dc,pt);
      else
        MOVE(dc,pt);
    }
  else
  {
    TBrush br(SYSCOLOR(COLOR_BTNFACE));
    dc.SelectObject(br);
    for (int y = 0; y < m_nDimSize[1]-1; y++)
      for (int x = 0; x < m_nDimSize[0]-1; x++)
      {
        TPoint pt[4] =
        {
          Project2D(x,y,pData[x + (LONGINT) m_nDimSize[0] * y]),
          Project2D(x+1,y,pData[x+1 + (LONGINT) m_nDimSize[0] * y]),
          Project2D(x+1,y+1,pData[x+1 + (LONGINT) m_nDimSize[0] * (y+1)]),
          Project2D(x,y+1,pData[x + (LONGINT) m_nDimSize[0] * (y+1)])
        };
        POLY(dc,pt,4);
      }
  }
  dc.RestorePen();
}
开发者ID:OS2World,项目名称:APP-SCIENCE-SimRobot2,代码行数:35,代码来源:srSensorView.cpp

示例4: DrawDisabledButton

void DrawDisabledButton(TDC& dc, const TRect& rc)
{
  // create a monochrome memory DC
  //
  TMemoryDC ddc;
  TBitmap bmp(ddc, rc.Width(), rc.Height());
  ddc.SelectObject(bmp);

  // build a mask
  //
  ddc.PatBlt(0, 0, rc.Width(), rc.Height(), WHITENESS);
  dc.SetBkColor(TColor::Sys3dFace);
  ddc.BitBlt(0, 0, rc.Width(), rc.Height(), dc, rc.left, rc.top, SRCCOPY);
  dc.SetBkColor(TColor::Sys3dHilight);
  ddc.BitBlt(0, 0, rc.Width(), rc.Height(), dc, rc.left, rc.top, SRCPAINT);

  // Copy the image from the toolbar into the memory DC
  // and draw it (grayed) back into the toolbar.
  //
  dc.FillRect(rc, TBrush(TColor::Sys3dFace));
  dc.SetBkColor(RGB(0, 0, 0));
  dc.SetTextColor(RGB(255, 255, 255));
  TBrush brShadow(TColor::Sys3dShadow);
  TBrush brHilight(TColor::Sys3dHilight);
  dc.SelectObject(brHilight);
  dc.BitBlt(rc.left+1, rc.top+1, rc.Width(), rc.Height(), ddc, 0, 0, 0x00E20746L);
  dc.SelectObject(brShadow);
  dc.BitBlt(rc.left, rc.top, rc.Width(), rc.Height(), ddc, 0, 0, 0x00E20746L);

  // reset DCs
  //
  dc.RestoreBrush();
  dc.RestoreBrush();
  ddc.RestoreBitmap();
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:35,代码来源:owlext.cpp

示例5:

//
/// Retrieves information about this font when selected in the specified dc.
//
void
TFont::GetTextMetrics(TEXTMETRIC& tm, TDC& dc) const
{
  dc.SelectObject(*this);
  dc.GetTextMetrics(tm);
  dc.RestoreFont();
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:10,代码来源:font.cpp

示例6: brsh

//
/// Paints a 2-color single pixel-thick frame. Bevel corners get their own color.
//
void
TUIBorder::PaintFrameC(TDC& dc, const TRect& fr, uint flags, const TColor& tlColor, const TColor& brColor, const TColor& bcColor)
{
  if (flags & (Top | Left)) {
    TBrush brsh(tlColor);
    dc.SelectObject(brsh);
    if (flags & Top) {
      dc.PatBlt(fr.left, fr.top, fr.Width()-2, 1);
      dc.SetPixel(fr.right-1, fr.top, bcColor);
    }
    if (flags & Left)
      dc.PatBlt(fr.left, fr.top+1, 1, fr.Height()-2);
    dc.RestoreBrush();
  }

  if (flags & (Bottom | Right)) {
    TBrush brsh(brColor);
    dc.SelectObject(brsh);
    if (flags & Bottom) {
      dc.SetPixel(fr.left, fr.bottom-1, bcColor);
      dc.PatBlt(fr.left+1, fr.bottom-1, fr.Width(), 1);
    }
    if (flags & Right)
      dc.PatBlt(fr.right-1, fr.top, 1, fr.Height()-1);
    dc.RestoreBrush();    
  }
}
开发者ID:GarMeridian3,项目名称:Meridian59,代码行数:30,代码来源:uiborder.cpp

示例7: GreyViewer

void TSensorView::GreyViewer(TDC& dc,PSHORTREAL pData)
{
  dc.SetWindowExt(TSize(m_nDimSize[0],m_nDimSize[1]));
  for (int y = 0; y < m_nDimSize[1]; y++)
  {
    int xStart = 0,
        x = 0;
    int clrLast,
        clrThis;
    while(x < m_nDimSize[0])
    {
      SHORTREAL r = pData[x + y * (LONGINT) m_nDimSize[0]];
      if (r > 1)
        r = 1;
      else if (r < 0)
        r = 0;
      clrThis = (int) (pow(r,m_dBright) * 255);
      if(!x)
        clrLast = clrThis;
      else if(clrThis != clrLast)
      {
        TBrush br(TColor(clrLast,clrLast,clrLast));
        TRect rect(xStart,y,x,y+1);
        dc.FillRect(rect,br);
        xStart = x;
        clrLast = clrThis;
      }
      x++;
    }
    TBrush br(TColor(clrLast,clrLast,clrLast));
    TRect rect(xStart,y,x,y+1);
    dc.FillRect(rect,br);
  }
  Grid2D(dc);
}
开发者ID:OS2World,项目名称:APP-SCIENCE-SimRobot2,代码行数:35,代码来源:srSensorView.cpp

示例8: pen

void TSensorView::Grid3D(TDC& dc)
{
  if(m_bGrid)
  {
    TPen pen(TColor(192,192,192),0);
    dc.SelectObject(pen);
    for (int y = 0; y <= m_ySize ; y++)
    {
      MOVE(dc,Project2D(0,y,1));
      LINE(dc,Project2D(0,y,0));
      LINE(dc,Project2D(m_xSize,y,0));
    }
    for (int x = 0; x <= m_xSize; x++)
    {
      MOVE(dc,Project2D(x,0,1));
      LINE(dc,Project2D(x,0,0));
      LINE(dc,Project2D(x,m_ySize,0));
    }
    for (SHORTREAL z = 0; z < 1.05; z += (SHORTREAL) 0.1)
    {
      MOVE(dc,Project2D(0,m_ySize,z));
      LINE(dc,Project2D(0,0,z));
      LINE(dc,Project2D(m_xSize,0,z));
    }
    dc.RestorePen();
  }
}
开发者ID:OS2World,项目名称:APP-SCIENCE-SimRobot2,代码行数:27,代码来源:srSensorView.cpp

示例9: FillSolidRect

// MFC style function, that draws a filled rect. Is this faster???
void
FillSolidRect(TDC& dc, int x, int y, int cx, int cy, TColor clr)
{
  TColor oldColor = dc.SetBkColor(clr);
  TRect rect(x, y, x + cx, y + cy);
  dc.ExtTextOut(0, 0, ETO_OPAQUE, &rect, _T(""), 0, 0);
  dc.SetBkColor(oldColor);
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:9,代码来源:owlext.cpp

示例10:

void
TGaugeGadget::Paint(TDC& dc, bool erase, TRect &rect)
{
  // Select the approprate font
  dc.SelectObject(Window->GetFont());
  TGauge::Paint(dc, erase, rect);
  dc.RestoreFont();
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:8,代码来源:gaugegad.cpp

示例11: calc_size

void TCheckBox::calc_size()
{
  int cx,cy;
  TDC *dc = m_parent->get_dc();
  // If the parent was a TComboBox, then it won't have a DC ready...
  if (dc != NULL) {
	  dc->get_text_extent(get_text(),cx,cy,m_font);
	  resize(int(1.05*cx)+30,int(1.05*cy));
  }
}
开发者ID:Konctantin,项目名称:scite-ru,代码行数:10,代码来源:twl_cntrls.cpp

示例12: Print_CreateWidths

void TFuncSpecView::Print_CreateWidths(TFuncSpecView::XPosVector& xpos, uint& divider, TDC& dc) const
{
  xpos.erase(xpos.begin(), xpos.end());

  uint x=0;
  string text;
  char pch[64];
  ostrstream os(pch, 64);
  XPosInfo xinfo;

  // Calculate for inputs
  unsigned long inputs=swdoc->GetSystem()->GetInputs();
  while (inputs--) {
    xinfo.x=x;
    // create input symbol
    os.seekp(0);
    os << 'x' << inputs << " " << ends;
    xinfo.s=pch;

    xpos.push_back(xinfo);

    // move x position
    x += dc.GetTextExtent(pch, strlen(pch)).cx;
  }

  // Calculate for divider
  divider=x;
  x += (divider - xpos.back().x);

  // Calculate for outputs
  swmin::FunctionSet::iterator i=swdoc->GetSystem()->GetFuncsConst()->begin(),
                        e=swdoc->GetSystem()->GetFuncsConst()->end();
  while (i!=e) {
    xinfo.x=x;
    // create output symbol
    os.seekp(0);
    os << (*i).id << " " << ends;
    xinfo.s=pch;

    xpos.push_back(xinfo);

    // move x position
    x += dc.GetTextExtent(pch, strlen(pch)).cx;

    i++;
  }

  xinfo.x=x;
  xinfo.s="";
  xpos.push_back(xinfo);  // save ending x-position
}
开发者ID:double16,项目名称:switchmin-w32,代码行数:51,代码来源:funcspecview.cpp

示例13: ini

int IniFile::ReadAndFillTDC(){
    std::ifstream ini( sFileName.c_str() );
    std::stringstream parser;
    std::string token, value, line, group;
    iError = INI_OK;
    // Loading the file into the parser
    if( ini ){
        parser << ini.rdbuf();
        ini.close();
    } else {
        iError = INI_ERROR_CANNOT_OPEN_READ_FILE;
        return iError;
    }
    group = "";
    TdcMap mapTDC;
    MapVector mapVector;
    while( std::getline( parser, line ) && ( iError == INI_OK ) ){
            // Check if the line is comment
            if( !CheckIfComment( line ) ){
                // Check for group
                if( !CheckIfGroup( line, group ) ){
                    // Check for token
                    if( CheckIfToken( line, token, value ) ){
                        // Make the key in format group.key if the group is not empty
                        //if( group.size() > 1 ) token = group + "." + token;
                        mData[ token ] = value;
                    }   else {
                        iError = INI_ERROR_WRONG_FORMAT;
                        return iError;
                    }
                }
                else{
                  mapVector.push_back(mData);
                  mData.clear();
                }
            }
        }
    mapVector.push_back(mData);



    for(int i=3 ; i<mapVector.size() ; i++){
      TDC tempTDC;
      tempTDC.SetName(mapVector[i]["Name"]);
      //std::cout<<"TriggerWindowWidth : "<<mapVector[i]["TriggerWindowWidth"]<<std::endl;
      tempTDC.SetTriggerWindowWidth(std::stoi(mapVector[i]["TriggerWindowWidth"], nullptr,10 ));
      tempTDC.SetTriggerWindowOffset(std::stoi(mapVector[i]["TriggerWindowOffset"], nullptr,10 ));
      tempTDC.SetTriggerExtraSearchMargin(std::stoi(mapVector[i]["TriggerExtraSearchMargin"], nullptr,10 ));
      tempTDC.SetTriggerRejectMargin(std::stoi(mapVector[i]["TriggerRejectMargin"], nullptr,10 ));
      tempTDC.SetEnableTriggerTimeSubstraction(std::stoi(mapVector[i]["EnableTriggerTimeSubstraction"], nullptr,10 ));
      tempTDC.SetIndividualLSB(std::stoi(mapVector[i]["IndividualLSB"], nullptr,10 ));

      fTdcVector.push_back(tempTDC);
      //std::cout<<"Tdc-NName : "<<mapVector[i]["Name"]<<std::endl;
      //std::cout<<"TDC-NAME : "<<mapVector[i]["Name"]<<std::endl;
    }

    std::cout<<"Num of Groups in INI file : "<<mapVector.size()<<std::endl;

}
开发者ID:vatsal512,项目名称:MuonTomography,代码行数:60,代码来源:IniFile.cpp

示例14: FillMaskRect

void
FillMaskRect(TDC& dc, TRect rect)
{
  THatch8x8Brush br(THatch8x8Brush::Hatch11F1, TColor::Sys3dHilight,
    TColor::Sys3dFace);
  dc.FillRect(rect, br);
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:7,代码来源:owlext.cpp

示例15: ColumnViewer

void TSensorView::ColumnViewer(TDC& dc,PSHORTREAL pData)
{
  m_xSize = m_nDimSize[0];
  m_ySize = m_nDimSize[1];
  m_yAdd = (int) (500L * m_ySize / m_xSize / 2);
  dc.SetWindowExt(TSize(m_xSize * 2 +  m_ySize,500 + m_yAdd));
  Grid3D(dc);
  TBrush brGray(SYSCOLOR(COLOR_BTNFACE)),
			brWhite(SYSCOLOR(COLOR_BTNHIGHLIGHT)),
			brDark(SYSCOLOR(COLOR_BTNSHADOW));
  for (int y = 0; y < m_nDimSize[1]; y++)
    for (int x = 0; x < m_nDimSize[0]; x++)
    {
      SHORTREAL r = pData[x + (LONGINT) m_nDimSize[0] * y];
      TPoint pt[4] =
      {
        Project2D(x,y+1,r),
        Project2D(x+1,y+1,r),
        Project2D(x+1,y,r),
        Project2D(x,y,r)
      };
      dc.SelectObject(brWhite);
      POLY(dc,pt,4);
      SHORTREAL r2 = y == m_nDimSize[1]-1
                     ? 0
                     : pData[x + (LONGINT) m_nDimSize[0] * (y+1)];
      if(r2 < r)
      {
        pt[2] = Project2D(x+1,y+1,r2);
        pt[3] = Project2D(x,y+1,r2);
        dc.SelectObject(brGray);
        POLY(dc,pt,4);
      }
      r2 = x == m_nDimSize[0]-1 ? 0
                  : pData[x+1 + (LONGINT) m_nDimSize[0] * y];
      if (r2 < r)
      {
        pt[0] = Project2D(x+1,y,r);
        pt[2] = Project2D(x+1,y+1,r2);
        pt[3] = Project2D(x+1,y,r2);
        dc.SelectObject(brDark);
        POLY(dc,pt,4);
      }
    }
  dc.RestoreBrush();
}
开发者ID:OS2World,项目名称:APP-SCIENCE-SimRobot2,代码行数:46,代码来源:srSensorView.cpp


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