Beispiel #1
0
void CWordStyleGallery::DoCalcColumnWidthsL()
	{
	CColumnListBoxData* columnData = ListBox()->ItemDrawer()->ColumnData();
	const CFont* font;
	//
	// column 0
	font = iEikonEnv->NormalFont();
	columnData->SetColumnFontL(0, font);
	columnData->SetColumnAlignmentL(0, CGraphicsContext::ELeft);
	//
	// column 1
	columnData->SetColumnWidthPixelL(1, KStyleColumnSpacerWidth);
	//
	// column 2
	font = iEikonEnv->LegendFont();
	columnData->SetColumnFontL(2, font);
	TBuf<KMaxStyleHotKeyDescription> hotkey;
	iCoeEnv->ReadResource(hotkey, R_WORD_HOTKEY);
	TInt width2 = font->TextWidthInPixels(hotkey) + font->MaxCharWidthInPixels();
	columnData->SetColumnWidthPixelL(2, width2);
	columnData->SetColumnAlignmentL(2, CGraphicsContext::ELeft);
	//
	// more column 0
	TInt width0 = ListBox()->View()->ViewRect().Width() - KStyleColumnSpacerWidth - width2 - CEikScrollBar::DefaultScrollBarBreadth(); // only works if called from PostLayout...
	columnData->SetColumnWidthPixelL(0, width0);
	}
void CPhotoModeListBox::SetIconsArray()
{
    CArrayPtr<CGulIcon>* iconArray = new (ELeave)
    CArrayPtrFlat<CGulIcon>(2);

    CleanupStack::PushL(iconArray);

    TBuf<128> path;
    path = CRippleVaultAppUi::ApplicationDriveAndPath();
    path.Append(KSmsMbmFileName);

    for(int i = 0 ; i < 2 ; i++)
    {
        iconArray->AppendL(iEikonEnv->CreateIconL(path,
                           EMbmSmsInbox, EMbmSmsInboxm));
    }

    CleanupStack::Pop(); // iconArray

    // Set the listbox's first column to fill the listbox's whole width
    CColumnListBoxData* colData = iListbox->ItemDrawer()->ColumnData();
    if(colData)
    {
        colData->SetIconArray(iconArray);

        colData->SetGraphicsColumnL(0, ETrue);
        colData->SetColumnWidthPixelL(0, 30);
        colData->SetColumnAlignmentL(0, CGraphicsContext::ELeft);

        colData->SetColumnWidthPixelL(1, 100);
    }

    iListbox->SetItemHeightL(30);
}