本文整理汇总了C++中TRect类的典型用法代码示例。如果您正苦于以下问题:C++ TRect类的具体用法?C++ TRect怎么用?C++ TRect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TRect类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: InitLayout
void CSelectGroup::InitLayout(TRect aRect)
{
iRect=aRect;
iStartPoint=aRect.iTl;
iLineWidth = aRect.Width();
iLineHeight=iMainEngine.ScreenLayout().FontHeight();
iLineHeight+=iLineHeight>>1;
iItemSize.iHeight=iLineHeight;
iItemSize.iWidth=iLineWidth;
iMaxLinePerPage = iMainEngine.ScreenLayout().GetClientRect().Height()/iLineHeight-1;
}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:16,代码来源:SelectGroup.cpp
示例2: initialPos
void TCacheResource::addRef2(const TRect &rect)
{
//DIAGNOSTICS_NUMBEREDSTRSET(prefix + QString::number((UINT) this) + " | Stack | ",
//"crStack", "addRef", ::traduce(rect));
//Add a reference to all cells intersecting the passed one
TPoint initialPos(getCellPos(rect.getP00()));
TPoint pos;
for (pos.x = initialPos.x; pos.x <= rect.x1; pos.x += latticeStep)
for (pos.y = initialPos.y; pos.y <= rect.y1; pos.y += latticeStep) {
PointLess cellIndex(getCellIndex(pos));
CellData &cellData = m_cellDatas[cellIndex];
cellData.m_referenced = true;
cellData.m_refsCount++;
}
}
开发者ID:GREYFOXRGR,项目名称:opentoonz,代码行数:16,代码来源:tcacheresource.cpp
示例3: TRect
/** If the display mode of iBitmapInfo is not expected, return EFalse
* or render to the back buffer and returns ETrue
*/
TBool CCommonInterfaces::DrawColor(const TRect& aRect,const TRgb& aColour)
{
TRect local = TRect(aRect.iTl-iRect.iTl, aRect.Size());
TUint16* pBuffer16;
TUint32* pBuffer32;
if (iBitmapInfo.iDisplayMode != iDispMode)
{
return EFalse;
}
for (TInt y = local.iTl.iY; y < local.iBr.iY; y++)
{
for (TInt x = local.iTl.iX; x < local.iBr.iX; x++)
{
switch (iDispMode)
{
case EColor64K:
pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color64K();
break;
case EColor16M:
pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color64K();
break;
case EColor16MU:
pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MU();
break;
case EColor16MA:
pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MA();
break;
case EColor4K:
pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color4K();
break;
case EColor16MAP:
pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MAP();
break;
default:
break;
}
}
}
return ETrue;
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:50,代码来源:TDirectScreenBitmap.cpp
示例4: primaryFontTotalHeight
void CTcContainer::CreateLabelsL( const TRect& aRect )
{
// Create labels
CEikLabel* label;
TInt primaryFontTotalHeight( FontTotalHeightInPixels( EAknLogicalFontPrimaryFont ) );
TInt secondaryFontTotalHeight( FontTotalHeightInPixels( EAknLogicalFontSecondaryFont ) );
TInt labelBase = KLabelTlY + primaryFontTotalHeight;
AknLayoutUtils::SAknLayoutTextMultiline labelLayout =
GetLabelLayout( aRect, labelBase, EAknLogicalFontPrimaryFont );
TRect rect( KLabelTlX, KLabelTlY,
aRect.Width() - KLabelTlX, KLabelTlY + primaryFontTotalHeight );
label = CreateLabelL( rect, KTestCase );
AknLayoutUtils::LayoutLabel( label, rect, labelLayout );
rect.Move( 0, secondaryFontTotalHeight );
labelBase += secondaryFontTotalHeight;
labelLayout = GetLabelLayout( aRect, labelBase, EAknLogicalFontSecondaryFont );
label = CreateLabelL( rect, KNone );
AknLayoutUtils::LayoutLabel( label, rect, labelLayout );
rect.Move( 0, primaryFontTotalHeight );
labelBase += primaryFontTotalHeight;
labelLayout = GetLabelLayout( aRect, labelBase, EAknLogicalFontPrimaryFont );
label = CreateLabelL( rect, KRequest );
AknLayoutUtils::LayoutLabel( label, rect, labelLayout );
rect.Move( 0, secondaryFontTotalHeight );
labelBase += secondaryFontTotalHeight;
labelLayout = GetLabelLayout( aRect, labelBase, EAknLogicalFontSecondaryFont );
label = CreateLabelL( rect, KNone );
AknLayoutUtils::LayoutLabel( label, rect, labelLayout );
rect.Move( 0, primaryFontTotalHeight );
labelBase += primaryFontTotalHeight;
labelLayout = GetLabelLayout( aRect, labelBase, EAknLogicalFontPrimaryFont );
label = CreateLabelL( rect, KStatus );
AknLayoutUtils::LayoutLabel( label, rect, labelLayout );
rect.Move( 0, secondaryFontTotalHeight );
labelBase += secondaryFontTotalHeight;
labelLayout = GetLabelLayout( aRect, labelBase, EAknLogicalFontSecondaryFont );
label = CreateLabelL( rect, KNone );
AknLayoutUtils::LayoutLabel( label, rect, labelLayout );
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:46,代码来源:CTcContainer.cpp
示例5: 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);
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:44,代码来源:urllink.cpp
示例6: vgGetfv
void CHuiVg10CanvasGc::DoClearRenderBuffer( CHuiCanvasRenderBuffer& aImage, const TRect & aRect )
{
HUIFX_VG_INVARIANT();
const CHuiVg10CanvasRenderBuffer* vg10RenderBuffer = (const CHuiVg10CanvasRenderBuffer*) &aImage;
const TInt COLOR_COMPONENTS = 4;
VGfloat savedColor[COLOR_COMPONENTS];
vgGetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, savedColor);
VGfloat color[COLOR_COMPONENTS] =
{
0.0f, 0.0f, 0.0f, 0.0f
};
vgSetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, color);
vgClearImage(vg10RenderBuffer->Image(), aRect.iTl.iX, aRect.iTl.iY, aRect.Size().iWidth, aRect.Size().iHeight);
vgSetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, savedColor);
HUIFX_VG_INVARIANT();
}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:18,代码来源:huivg10canvasgc.cpp
示例7: YPosToLine
TInt CEikCapCArray::YPosToLine(const TRect &aRect,
TInt aTop, TInt aMiddle, TInt aBottom,
TInt aYCoord)
{
TInt top = aTop;
TInt middle = aMiddle;
TInt bottom = aBottom;
CalcItemIndexes(top, middle, bottom, aRect.Size());
for(int i = top ; i < top+middle; i++)
{
CEikCaptionedControl *fst = (*this)[i];
if (aYCoord < fst->Rect().iTl.iY)
{
if (i > 0)
return i-1;
else
return KErrNotFound;
}
}
if (Count() == 0) return -1;
TInt ii = top+middle-1;
CEikCaptionedControl *last = (*this)[ii];
if ( aYCoord < last->Rect().iBr.iY )
{
return ii;
}
else
{
if ( ii+1 < Count() )
{
return ii+1;
}
else if ( aYCoord > last->Rect().iBr.iY )
{
return KErrNotFound;
}
else
{
return ii;
}
}
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:43,代码来源:EIKCAPCA.CPP
示例8: fillautoInks
//-----------------------------------------------------------------------------
// questa funzione viene chiamata dopo il fill rect delle aree, e colora gli
// inchiostri di tipo "autoink"
// che confinano con le aree appena fillate con il rect. rbefore e' il rect del
// raster prima del rectfill.
void fillautoInks(TRasterCM32P &rin, TRect &rect, const TRasterCM32P &rbefore,
TPalette *plt) {
assert(plt);
TRasterCM32P r = rin->extract(rect);
assert(r->getSize() == rbefore->getSize());
int i, j;
for (i = 0; i < r->getLy(); i++) {
TPixelCM32 *pix = r->pixels(i);
TPixelCM32 *pixb = rbefore->pixels(i);
for (j = 0; j < r->getLx(); j++, pix++, pixb++) {
int paint = pix->getPaint();
int tone = pix->getTone();
int ink = pix->getInk();
if (paint != pixb->getPaint() && tone > 0 && tone < 255 && ink != paint &&
plt->getStyle(ink)->getFlags() != 0)
inkFill(rin, TPoint(j, i) + rect.getP00(), paint, 0, NULL, &rect);
}
}
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:25,代码来源:fillutil.cpp
示例9: Draw
void CFontSizeTestControl::Draw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
gc.SetBrushColor(iBackgroundColor);
// get the nearest font matching the desired height
CFont* font = NULL;
TFontSpec fontSpec;
fontSpec.iTypeface.iName = KNokiaSeries60Font;
fontSpec.iHeight = iFontSize;
CWsScreenDevice* screen = CCoeEnv::Static()->ScreenDevice();
ASSERT(screen->GetNearestFontToDesignHeightInPixels(font, fontSpec) == KErrNone);
iBidiText->WrapText(aRect.Width() - ESideBearingsAllowance, *font, NULL, EMaximumTextLines);
// it's recommended to create the text drawer in the actual draw function
XCoeTextDrawer textDrawer(TextDrawer());
textDrawer->SetMargins(iMargin);
textDrawer->SetAlignment(TGulAlignment(EHCenterVCenter));
textDrawer->SetTextColor(KRgbBlack);
textDrawer->SetLineGapInPixels(EGapBetweenTextLines);
textDrawer.SetClipRect(aRect);
textDrawer.DrawText(gc, *iBidiText, aRect, *font);
// Release font, otherwise there are problems deleting iScreen (still holds references)
screen->ReleaseFont(font);
// Draw font 1 pixel larger or smaller next time.
if (iIncreaseFontSize)
{
++iFontSize;
}
else
{
if (iFontSize > 1)
{
--iFontSize;
}
}
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:41,代码来源:tfontmultiplesizes.cpp
示例10: if
/**
* Draws the left adornment to the graphics context aGc, in the rectangle aRect. The menu pane
* flags determines the type of adornment to be drawn.
*/
EXPORT_C void LafMenuPane::DrawLeftAdornment(const MLafEnv& aLafEnv, const CCoeControl& /*aMenuPane*/, CWindowGc& aGc, const TRect& aRect, const TItemAttributes& aItemAttributes)
{
// Brush the background of the rect.
aGc.SetPenStyle(CGraphicsContext::ENullPen);
aGc.DrawRect(aRect);
aGc.SetPenStyle(CGraphicsContext::ESolidPen);
const TInt itemFlags = aItemAttributes.iFlags;
if (itemFlags&EEikMenuItemSymbolOn)
{
if (itemFlags&EEikMenuItemCheckBox)
{
TRect rect = aRect;
rect.iTl.iY += aItemAttributes.iBaseLine;
TBuf<1> buf;
buf.Append(TChar(ESymFontTick));
aGc.UseFont(SymbolFont(aLafEnv));
aGc.SetPenStyle(CGraphicsContext::ESolidPen);
// as the tick is big, ignore KPreLeftAdornment and steal 1 pixels from left.
aGc.DrawText(buf,TPoint(rect.iTl.iX-1, rect.iTl.iY));
aGc.UseFont(NormalFont(aLafEnv));
}
else if (itemFlags&KLafMenuItemRadio)
{
TUid bmpUid(TUid::Uid(KLafUidEikonOptiVal));
const CFbsBitmap* bitmap = aLafEnv.Bitmap(bmpUid);
TSize bitsize = bitmap->SizeInPixels();
TRect butRect(TPoint(0,0), TPoint(bitsize.iWidth,bitsize.iHeight));
TInt yoffset = (aRect.Size().iHeight - bitsize.iHeight) / 2;
TInt xoffset = KLafPreLeftAdornmentSpace;
TPoint offset(xoffset,yoffset);
if (aItemAttributes.iHighlightType == SLafMenuPane::EDrawHighlight)
{
bmpUid=TUid::Uid(KLafUidEikonOptihVal);
bitmap = aLafEnv.Bitmap(bmpUid);
}
bmpUid=TUid::Uid(KLafUidEikonOptimVal);
const CFbsBitmap* mask = aLafEnv.Bitmap(bmpUid);
aGc.BitBltMasked((aRect.iTl+offset), bitmap, butRect, mask,ETrue);
}
}
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:45,代码来源:LAFMENUP.CPP
示例11: DrawText
EXPORT_C void DrawUtils::DrawText(CGraphicsContext& aGc,const TDesC& aString,const TRect& aBox,TInt aBaseLineOffset,
CGraphicsContext::TTextAlign aHoriz,TInt aMargin,const CFont* aFont)
/** Draws text inside a rectangle.
@param aGc The graphics context.
@param aString The text string to draw.
@param aBox The rectangle to draw the text in.
@param aBaseLineOffset An offset from the top of the box to the text baseline.
@param aHoriz The horizontal text alignment.
@param aMargin The margin around the text.
@param aFont The font to use. */
{ // static
if (aHoriz!=CGraphicsContext::ELeft)
{
const TInt extraWidth=aBox.Width()-aFont->TextWidthInPixels(aString)-aMargin;
if (aHoriz==CGraphicsContext::ECenter)
aMargin+=extraWidth/2;
else
aMargin=extraWidth;
}
aGc.DrawText(aString,aBox,aBaseLineOffset,CGraphicsContext::ELeft,aMargin);
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:22,代码来源:GULUTIL.CPP
示例12: IsValidDestination
// ---------------------------------------------------------------------------
// CFepUiLayoutRootCtrl::IsValidDestination
// Test whether the rect conflicts with other controls
// (other items were commented in a header).
// ---------------------------------------------------------------------------
//
TBool CFepUiLayoutRootCtrl::IsValidDestination(const TRect& aRect,
CDragBar* aDragBar,
TBool& aVInfo,
TBool& aHInfo)
{
aVInfo = EFalse;
aHInfo = EFalse;
if(!Rect().Contains(aRect.iTl) || !Rect().Contains(aRect.iBr)) //outside of the ui layout
return EFalse;
CFepUiBaseCtrl* ctrl;
for(TInt i = iCtrlList.Count()-1; i >= 0;i--)
{
ctrl = iCtrlList[i];
TBool bIsDragingComponent = EFalse;
if(aDragBar)
{
if(aDragBar->IsDraggingComponent(ctrl))
bIsDragingComponent = ETrue;
}
if(!bIsDragingComponent && aRect.Intersects(ctrl->Rect())) //conflicts with others
{
//is the control one of the dragbar component.
if(!ctrl->AllowOverlap())
{
//if the control not allow overlapping, then it's invalid pos
return EFalse;
}
}
}
return ETrue;
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:44,代码来源:peninputlayoutrootctrl.cpp
示例13: get_image
void TChain::get_image(cv::Mat& mat, const TRect& grid, unsigned int dim1, unsigned int dim2,
bool norm, double sigma1, double sigma2, double nsigma) const {
assert((dim1 >= 0) && (dim1 < N) && (dim2 >= 0) && (dim2 < N) && (dim1 != dim2));
mat = cv::Mat::zeros(grid.N_bins[0], grid.N_bins[1], CV_64F);
//std::cout << grid.N_bins[0] << " " << grid.N_bins[1] << std::endl;
unsigned int i1, i2;
for(size_t i=0; i<length; i++) {
if(grid.get_index(x[N*i+dim1], x[N*i+dim2], i1, i2)) {
mat.at<double>(i1, i2) += w[i];
//std::cerr << mat.at<double>(i1, i2) << std::endl;
}
}
if(norm) { mat /= total_weight; }
if((sigma1 >= 0.) && (sigma2 >= 0.)) {
double s1 = sigma1 / grid.dx[0];
double s2 = sigma2 / grid.dx[1];
//std::cout << std::endl;
//std::cout << dim1 << " " << dim2 << std::endl;
//std::cout << "dx = " << sigma1 << " / " << grid.dx[0] << " = " << s1 << std::endl;
//std::cout << "dy = " << sigma2 << " / " << grid.dx[1] << " = " << s2 << std::endl;
//std::cout << std::endl;
int w1 = 2 * ceil(nsigma*s1) + 1;
int w2 = 2 * ceil(nsigma*s2) + 1;
cv::GaussianBlur(mat, mat, cv::Size(w2,w1), s2, s1, cv::BORDER_REPLICATE);
}
// Convert to float
mat.convertTo(mat, CV_32F);
}
开发者ID:gregreen,项目名称:bayestar,代码行数:37,代码来源:chain.cpp
示例14: CreateWindowL
// -----------------------------------------------------------------------------
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CPixelMetricsMapperViewContainer::ConstructL( const TRect& aRect )
{
CreateWindowL();
SetCanDrawOutsideRect();
iTexts = new( ELeave ) CDesCArrayFlat( 10 );
iTexts->AppendL( _L( "\tStarted." ) );
iListbox = new( ELeave ) CAknSingleStyleListBox;
iListbox->SetContainerWindowL( *this );
iListbox->ConstructL( this, EAknListBoxViewerFlags );
iListbox->Model()->SetItemTextArray( iTexts );
iListbox->SetRect( TRect( aRect.Size() ) );
iListbox->CreateScrollBarFrameL( ETrue );
iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOn,
CEikScrollBarFrame::EOn );
SetRect( aRect );
iListbox->ActivateL();
ActivateL();
}
开发者ID:mpvader,项目名称:qt,代码行数:28,代码来源:pm_mapperview.cpp
示例15: CreateWindowL
// ---------------------------------------------------------------------------
// CAppMngr2ListContainer::ConstructL()
// ---------------------------------------------------------------------------
//
void CAppMngr2ListContainer::ConstructL( const TRect& aRect )
{
CreateWindowL();
SetRect( aRect );
iListBox = new (ELeave) CAknDoubleLargeStyleListBox;
iListBox->SetContainerWindowL( *this );
iListBox->ConstructL( this, EAknListBoxSelectionList );
iListBox->SetListBoxObserver( this );
// Dont display default "(no data)" empty text
iListBox->View()->SetListEmptyTextL( KNullDesC );
LoadIconsL();
CreateItemArrayL();
PopulateItemArrayL();
iListBox->CreateScrollBarFrameL();
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
iListBox->SetRect( aRect.Size() );
// Enable marquee effect
iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:28,代码来源:appmngr2listcontainer.cpp
示例16: GetRectFromConfig
TBool CDataWrapperBase::GetRectFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRect& aResult)
{
TBuf<KMaxTestExecuteCommandLength> tempStore;
TInt top;
tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectTop);
TBool ret=GetIntFromConfig(aSectName, tempStore, top);
TInt left;
tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectLeft);
if ( !GetIntFromConfig(aSectName, tempStore, left) )
{
ret=EFalse;
}
TInt bottom;
tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectBottom);
if ( !GetIntFromConfig(aSectName, tempStore, bottom) )
{
ret=EFalse;
}
TInt right;
tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectRight);
if ( !GetIntFromConfig(aSectName, tempStore, right) )
{
ret=EFalse;
}
if ( ret )
{
aResult.SetRect(left, top, right, bottom);
}
return ret;
}
开发者ID:fedor4ever,项目名称:default,代码行数:36,代码来源:DataWrapperBase.cpp
示例17: HideLines_Edwin
/**
* Sets a clipping rectangle for hiding the whole or a part of edwin's text.
*
* The reason for using this function is the multiline edwins. The text inside
* an edwin can be broken to two or more lines, which must be hidden or shown
* independently from each other. That is why it is not enough just to move
* the whole edwin out of the screen.
*
* @param aClipRect The clipping rect for edwin's text. An empty rect disables
* hiding.
*
* @return How many subcontrols were hidden
*/
static TInt HideLines_Edwin(CEikEdwin *aEdwin, TRect aClipRect)
{
aEdwin->SetTextLinesRect(aClipRect);
// Create rects of the first and last edwin lines
TPoint edwinTl( aEdwin->Rect().iTl );
TPoint edwinBr( aEdwin->Rect().iBr );
TRect textFirstLine;
aEdwin->TextLayout()->GetLineRect(edwinTl.iY, textFirstLine);
textFirstLine.Move( edwinTl.iX, edwinTl.iY + aEdwin->Margins().iTop );
TRect textLastLine;
aEdwin->TextLayout()->GetLineRect(edwinBr.iY, textLastLine);
textLastLine.Move( edwinBr.iX, edwinBr.iY - aEdwin->Margins().iTop - textLastLine.Height() );
// Check if at least one line fits to the clipping rect
if( aClipRect.Contains(textFirstLine.iTl) &&
aClipRect.iBr.iY >= textFirstLine.iBr.iY ) // The first line fits
return 0;
if( aClipRect.Contains(textLastLine.iTl) &&
aClipRect.iBr.iY >= textLastLine.iBr.iY ) // The last line fits
return 0;
return 1;
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:36,代码来源:EIKCAPCA.CPP
示例18: Root
// ---------------------------------------------------------------------------
// From class CAknTreeItem.
// Draws the simple data row to the appointed graphics context.
// ---------------------------------------------------------------------------
//
void CAknSingleColumnStyleSimpleDataRow::Draw( CWindowGc& aGc,
const TRect& aItemRect, const TRect& /*aRect*/, TBool aFocused ) const
{
CAknTree* root = Root();
__ASSERT_DEBUG( root, User::Invariant() );
// Icon.
TInt iconVariety = IsMarked() ? 1 : 0;
TRect iconRect = RectFromLayout( aItemRect, AknLayoutScalable_Avkon::
list_single_2heading_msg_pane_g1( iconVariety ) );
TInt iconId = IconId( aFocused );
if ( iIcon != AknTreeListIconID::KNone )
{
root->DrawIcon( iconId, iconRect.Size(), aGc, iconRect.iTl,
iconRect.Size() );
}
// Optional icon ID.
TInt optIconId = OptionalIconId( aFocused );
// Text.
TAknLayoutText layoutText;
TInt textVariety = ( optIconId == KNone ) ? 0 : 1;
layoutText.LayoutText( aItemRect, AknLayoutScalable_Avkon::
list_single_2heading_msg_pane_t1( textVariety ).LayoutLine() );
root->DrawText( aGc, aItemRect, AknLayoutScalable_Avkon::
list_single_2heading_msg_pane_t1( textVariety ), *iText, NULL,
this, aFocused, ETrue );
// Optional indication icon.
TInt optIconVariety = 0; // Marked folder.
TRect optIconRect = RectFromLayout( aItemRect, AknLayoutScalable_Avkon::
list_single_2heading_msg_pane_g2( optIconVariety ) );
if ( optIconId != KNone )
{
root->DrawIcon( optIconId, optIconRect.Size(), aGc,
optIconRect.iTl, optIconRect.Size() );
}
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:45,代码来源:aknsinglecolumnstylesimpledatarow.cpp
示例19: MainL
void MainL()
{
RWsSession ws;
ws.Connect();
CWsScreenDevice* scr = new(ELeave) CWsScreenDevice(ws);
scr->Construct();
CWindowGc* gc = new(ELeave) CWindowGc(scr);
gc->Construct();
RWindowGroup grp(ws);
grp.Construct(0xc0decafe, ETrue);
RWindow win(ws);
win.Construct(grp, 0xbeefcafe);
win.SetExtent(TPoint(20,160), TSize(320,240));
win.Activate();
win.Invalidate();
win.BeginRedraw();
gc->Activate(win);
gc->SetPenStyle(CGraphicsContext::ENullPen);
gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
TBool color = EFalse;
if (Profiler::Start() == KErrNotFound)
{
_LIT(KProfiler,"profiler");
_LIT(KStart,"start -noui -drive=S");
RProcess p;
if (p.Create(KProfiler,KStart) == KErrNone)
{
p.Resume();
p.Close();
}
}
for (TInt col=0; col<KCol; ++col)
{
color = !color;
for (TInt row=0; row<KRow; ++row)
{
TRect rect;
rect.iTl.iX = col * KSize.iWidth;
rect.iTl.iY = row * KSize.iHeight;
rect.SetSize(KSize);
color = !color;
gc->SetBrushColor(color? KRgbBlue : KRgbBlack);
gc->DrawRect(rect);
}
}
gc->Deactivate();
win.EndRedraw();
ws.Flush();
User::After(3000000);
win.Close();
grp.Close();
delete gc;
delete scr;
ws.Close();
Profiler::Stop();
Profiler::Close();
Profiler::Unload();
}
开发者ID:cdaffara,项目名称:symbian-oss_adapt,代码行数:65,代码来源:grid.cpp
示例20: rl
void TFieldDlg::setupDialog()
{
TObjDlg::setupDialog();
TRect rlCopy;
TRect rcCopy;
TRect rl( 2, 5, 12, 6 );
TRect rc = rl;
rc.move( 10, 0 );
rc.b.x = rc.a.x + 6;
rc.a.x++;
insert( length = new TNNumericInputLine( rc, 3 ) );
insert( lengthLabel = new TLabel( rl, "L„nge", length ) );
rc.a.x--;
rc.move( 0, 1 );
rl.move( 0, 1 );
insert( offset = new TNNumericInputLine( rc, 4 ) );
insert( offsetLabel = new TLabel( rl, "Offset", offset ) );
rcCopy = rc;
rlCopy = rl;
rc.move( 10, -1 );
rc.b.x = rc.a.x + 15;
insert( dumpable = new TNCheckBoxes( rc, new TSItem( "Unbenutzt", 0 ) ) );
rl.move( 0, 2 );
rl.b.x = rl.a.x + 20;
rc = rl;
rc.move( 1, 1 );
rc.b.x = rc.a.x + 18;
rc.b.y++;
insert( posSel = new TNRadioButtons( rc,
new TSItem( "Automatisch",
new TSItem( "Benutzerwahl", 0 )) ) );
insert( posSelLabel = new TLabel( rl, "Positionsauswahl", posSel ) );
rcCopy.move( 22, 3 );
rlCopy.move( 22, 3 );
insert( track = new TNNumericInputLine( rcCopy, 4 ) );
insert( trackLabel = new TLabel( rlCopy, "Spur", track ) );
rcCopy.move( 0, 1 );
rlCopy.move( 0, 1 );
insert( pos = new TNNumericInputLine( rcCopy, 4 ) );
insert( posLabel = new TLabel( rlCopy, "Position", pos ) );
rc.move( 0, 4 );
rc.b.y++;
rc.b.x = rc.a.x + 25;
rl.move( 0, 4 );
insert( restr = new TNRadioButtons( rc,
new TSItem( "keine",
new TSItem( "Magnetspuren",
new TSItem( "Anzeige-/Magnetspur", 0 ))) ) );
insert( restrLabel = new TLabel( rl, "Einschr„nkung", restr ) );
}
开发者ID:jskripsky,项目名称:ancient,代码行数:59,代码来源:TFLDDLG.CPP
注:本文中的TRect类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论