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


C++ TRect::Grow方法代码示例

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


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

示例1: Draw

// -----------------------------------------------------------------------------
// CFiletransferContainer::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CFiletransferContainer::Draw( const TRect& /*aRect*/ ) const
{
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();

    // Clears the screen
    gc.Clear( Rect() );

    //LOG("CFiletransferContainer::Draw: start");

    gc.SetPenColor(AKN_LAF_COLOR(185));//green
	//gc.SetPenColor(AKN_LAF_COLOR(35));//red
    gc.UseBrushPattern(&iFill);
    gc.SetBrushStyle(CGraphicsContext::EPatternedBrush);
    gc.SetBrushColor(AKN_LAF_COLOR(215));
    gc.SetPenStyle(CGraphicsContext::ENullPen);
    TInt i;
    for(i=0;i<iRects.Count();i++)
    {
    	if(i==iFiletransferView->iCurrentFileNo-1 || iDistanceBetweenRectangles<0)
    	{
    		gc.SetBrushStyle(CGraphicsContext::ENullBrush);
    		gc.SetPenStyle(CGraphicsContext::ESolidPen);
    	};
    	gc.DrawRoundRect(*iRects[i],TSize(iRound,iRound));

    };
    //fill the rect up to now
    TRect fRect;
    TReal hrzCurrent;

    if(iDistanceBetweenRectangles>=0)
    {
    	//we have one rectangle for each file
    	fRect=*iRects[iFiletransferView->iCurrentFileNo-1];
    	hrzCurrent=fRect.Width();
        hrzCurrent=iFiletransferView->iBytesTransfered*(hrzCurrent-iDistanceBetweenRectangles)/iFiletransferView->iCurrentFileSize;
    }
    else
    {
    	//we have one rectangle overall
		fRect=*iRects[0];
		hrzCurrent=fRect.Width();
		hrzCurrent=iFiletransferView->iTotalBytesTransfered*hrzCurrent/iFiletransferView->iTotalBytes2Transfer;
    };

    gc.UseBrushPattern(&iFill);
    gc.SetBrushStyle(CGraphicsContext::EPatternedBrush);
    gc.SetBrushColor(AKN_LAF_COLOR(215));
    gc.SetPenStyle(CGraphicsContext::ENullPen);

    TInt delta=iRound-(TInt)hrzCurrent;
    if(delta<0)delta=0;
	fRect.SetWidth((TInt)hrzCurrent);
	fRect.Grow(0,-delta);
	gc.DrawRoundRect(fRect,TSize(iRound-delta,iRound-delta));
	//LOG("CFiletransferContainer::Draw: end");
}
开发者ID:lohanf,项目名称:MLauncher,代码行数:63,代码来源:FiletransferContainer.cpp

示例2: ExpandVisualRect

void CHuiShadowBorderBrush::ExpandVisualRect(TRect& aRect) const
    {
    // We need access to visual to convert metric units into pixels,
    // currently a pointer to visual is provided through separate
    // method since we want to avoid breaking binary compatibility 
    // of this class.
    TReal32 widthInPixels = WidthInPixels(BrushGuide()); 
    aRect.Grow(HUI_ROUND_FLOAT_TO_INT(widthInPixels), HUI_ROUND_FLOAT_TO_INT(widthInPixels)); 
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:9,代码来源:HuiShadowBorderBrush.cpp

示例3: Draw

void CHuiShadowBorderBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
    {
    TRect content = aGuide.BrushRect().Round();
    TReal32 opacity = aGuide.BrushOpacity() * iOpacity.Now();

    if(opacity <= 0)
        {
        return;
        }

    aGc.SetPenAlpha(TInt(opacity * 255));
    aGc.SetPenColor(TRgb(0, 0, 30));

    const CHuiTexture* shadowTexture = NULL;
    TInt err = aGuide.BrushSkin().GetTexture(EHuiSkinShadowTexture, shadowTexture);
    if (err!=KErrNone)
    	{
    	ASSERT(EFalse); // failed to get the shadow texture - unable to proceed!
    	return;
	    }
    ASSERT(shadowTexture);
    THuiImage shadowImage(*shadowTexture);

    aGc.Disable(CHuiGc::EFeatureDepthWrite);
    
    TReal32 widthInPixels = WidthInPixels(BrushGuide()); 
    content.Grow(HUI_ROUND_FLOAT_TO_INT(widthInPixels), HUI_ROUND_FLOAT_TO_INT(widthInPixels)); 
    
    // ID:  EHJK-7G5AHB - shadow border leaves artifacts in the display while visual is moved.
    TReal32 offset = 0.0f; // NOTE: It was 1.f. 

    // Note: DrawBorders does not (yet) support different widths for every border.
    aGc.DrawBorders(content, 
                    widthInPixels-offset, 
                    widthInPixels+offset, 
                    widthInPixels-offset, 
                    widthInPixels+offset, 
                    CHuiGc::EBorderImage, 
                    &shadowImage);            

    aGc.Enable(CHuiGc::EFeatureDepthWrite);
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:42,代码来源:HuiShadowBorderBrush.cpp

示例4: r

TMyApp::TMyApp(int argc, char **argv): TProgram(argc, argv, EGA_CYAN)
{
  int i, _MaxX, _MaxY;
  TRect r ( Bounds );
  r.Grow( 10, 10 );
  doc = new QDocument();
  mainWindow = new TWindow( r,
	"One-Shot: Simulador de circuitos digitales" );
//  mainWindow->State |= stNoMoveable;
//  mainWindow->Align |= vaFixedSize;
  insert( mainWindow );
  mainWindow->GotFocus();

  mainWindow->getClientArea( r );
  _MaxX = r.deltax();
  _MaxY = r.deltay();
  r.b.y = r.a.y + Ht*2;

  mainMenu = new TMenuBar (r,
    new TSubMenu("Archivo",
      new TMenuItem("Nuevo",  cmNuevo,
      new TMenuItem("Abrir",  cmAbrir,
      new TMenuItem("Guardar", cmGuardar,
      new TMenuItem(mnuSeparatorLine, 0,
      new TMenuItem("Salir", cmSalir,
      NULL))))),
    new TSubMenu("Editar",
      new TMenuItem("Propiedades", cmPropiedades,
      new TMenuItem(mnuSeparatorLine, 0,
      new TMenuItem("Borrar", cmBorrar,
      NULL))),
    new TSubMenu("Simular",
      new TMenuItem("Arrancar", cmSimOn,
      new TMenuItem("Detener", cmSimOff,
    NULL)),
    new TSubMenu("Ayuda",
      new TMenuItem("Acerca de...", cmAcerca_de, NULL),
    NULL))))
  );

  mainWindow->insert( led = new QLed( QPoint( _MaxX-32, r.b.y+1 ) ) );
  led->Align = vaFixedSize+vaRight;

  r = TRect (2, mainMenu->Bounds.b.y, 3*_MaxX/4, _MaxY-12);
  mainWindow->insert (canvas = new TScrollCanvas (r, 1200, 1200));
  canvas->Align = vaClient+vaPropW+vaPropH;
  canvas->shpbg = EGA_BLACK;
  canvas->insert( visualBinding = new QVisualBinding() );

  r = TRect (r.b.x+2, r.a.y+24, _MaxX-2, r.b.y);
  mainWindow->insert (complist = new TListBox (r));
  complist->Align = vaPreservW+vaRight+vaTop+vaBottom+vaPropW+vaPropH;
  complist->height_item = 32;

  extern char *compList[];
  for (i=0; compList[i]; i++)
    complist->additem( compList[i] );
  complist->onSelect = onSelectComp;

  mainWindow->setMenuWindow( mainMenu );
}
开发者ID:mribelotta,项目名称:oneshot,代码行数:61,代码来源:main.cpp


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