|
1 /* |
|
2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation for avkon based choice list control |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "peninputlayoutaknchoicelist.h" |
|
20 #include "peninputlayout.h" |
|
21 |
|
22 #include <avkon.hrh> // AknButton flags |
|
23 #include <AknsConstants.h> |
|
24 //#include <avkon.mbg> |
|
25 |
|
26 #include <eikclbd.h> |
|
27 #include <eiklbx.h> |
|
28 #include <eikscrlb.h> |
|
29 |
|
30 #include <AknLayout2ScalableDef.h> |
|
31 #include <aknlayoutscalable_avkon.cdl.h> |
|
32 |
|
33 #include <AknsFrameBackgroundControlContext.h> |
|
34 |
|
35 |
|
36 |
|
37 const TInt KMaxTxtLen = 256; |
|
38 |
|
39 NONSHARABLE_CLASS(CPenUiScrolbarCtrl) : public CFepUiBaseCtrl |
|
40 { |
|
41 public: |
|
42 CPenUiScrolbarCtrl(CCoeControl* aCtrl, CFepUiLayout* aLayout); |
|
43 void ConstructL(); |
|
44 }; |
|
45 |
|
46 CPenUiScrolbarCtrl::CPenUiScrolbarCtrl(CCoeControl* aCtrl, CFepUiLayout* aLayout) |
|
47 : CFepUiBaseCtrl(aCtrl,aLayout,EFalse) |
|
48 { |
|
49 } |
|
50 |
|
51 void CPenUiScrolbarCtrl::ConstructL() |
|
52 { |
|
53 BaseConstructL(); |
|
54 } |
|
55 |
|
56 // implementation for class CFepLayoutAknChoiceList |
|
57 EXPORT_C CFepLayoutAknChoiceList* CFepLayoutAknChoiceList::NewL(CFepUiLayout* aUiLayout, |
|
58 TInt aControlId,CCoeControl* aParent) |
|
59 { |
|
60 CFepLayoutAknChoiceList* self = new (ELeave) CFepLayoutAknChoiceList(aUiLayout, |
|
61 aControlId,aParent); |
|
62 CleanupStack::PushL(self); |
|
63 self->ConstructL(); |
|
64 CleanupStack::Pop(self); |
|
65 return self; |
|
66 } |
|
67 |
|
68 EXPORT_C CFepLayoutAknChoiceList::CFepLayoutAknChoiceList(CFepUiLayout* aUiLayout, |
|
69 TInt aControlId,CCoeControl* aParent) |
|
70 : CFepLayoutChoiceList(aUiLayout,aControlId) |
|
71 { |
|
72 iParent = aParent; |
|
73 } |
|
74 |
|
75 EXPORT_C CFepLayoutAknChoiceList::~CFepLayoutAknChoiceList() |
|
76 { |
|
77 delete iScrollbarCtrl; |
|
78 delete iTxtTransferBuf; |
|
79 delete iBgContext; |
|
80 } |
|
81 |
|
82 EXPORT_C void CFepLayoutAknChoiceList::ConstructL() |
|
83 { |
|
84 CFepLayoutChoiceList::ConstructL(); |
|
85 |
|
86 iListBox = new(ELeave) CAknSinglePopupMenuStyleListBox ;//CAknSingleStyleListBox; |
|
87 |
|
88 iListBox->ConstructL(iParent,EAknListBoxMenuList); |
|
89 iListBox->MakeVisible(EFalse); |
|
90 |
|
91 |
|
92 CWindowGc* gc = RootControl()->GetRWindowGcL();//(static_cast<CGenericItutUiLayout*>(UiLayout()))->WindowGc(); |
|
93 iListBox->SetGc(gc); |
|
94 |
|
95 iListBox->SetGc(gc); |
|
96 iListBox->ItemDrawer()->SetGc(gc); |
|
97 |
|
98 iListBox->CreateScrollBarFrameL(ETrue,EFalse,EFalse); |
|
99 iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, |
|
100 CEikScrollBarFrame::EAuto); |
|
101 |
|
102 CEikScrollBar* scrbar = iListBox->ScrollBarFrame()->VerticalScrollBar(); |
|
103 iScrollbarCtrl = new(ELeave) CPenUiScrolbarCtrl(scrbar, UiLayout()); |
|
104 static_cast<CPenUiScrolbarCtrl*>(iScrollbarCtrl)->ConstructL(); |
|
105 UpdateTextColors(); |
|
106 |
|
107 CFormattedCellListBoxData* d = iListBox->ItemDrawer()->FormattedCellData(); |
|
108 TBool b = d->SubCellIsTransparent(0); |
|
109 TMargins m = d->SubCellMargins(0); |
|
110 //UseSubCellColors |
|
111 |
|
112 |
|
113 iWndControl = iListBox; |
|
114 |
|
115 iTxtTransferBuf = HBufC::NewL(KMaxTxtLen); |
|
116 |
|
117 TRect nullRect( 0, 0, 0, 0 ); |
|
118 |
|
119 iBgContext = CAknsFrameBackgroundControlContext::NewL( |
|
120 KAknsIIDQsnFrPopupSub, nullRect, nullRect, EFalse ); |
|
121 |
|
122 |
|
123 } |
|
124 |
|
125 EXPORT_C void CFepLayoutAknChoiceList::SetItemsL(const RPointerArray<CFepLayoutChoiceList::SItem>& |
|
126 aItemList) |
|
127 { |
|
128 TRect r = iRect; |
|
129 CFepLayoutChoiceList::SetItemsL(aItemList); |
|
130 // |
|
131 CDesCArray* itemArray = static_cast<CDesCArray*>(FormatedCellListBox()->Model()->ItemTextArray()); |
|
132 //= (CDesCArray*) itemList; |
|
133 |
|
134 for(int ii = 0; ii < aItemList.Count(); ++ii) |
|
135 { |
|
136 itemArray->AppendL(aItemList[ii]->iText); |
|
137 } |
|
138 iListBox->HandleItemAdditionL(); |
|
139 SetRect(r); |
|
140 } |
|
141 |
|
142 |
|
143 EXPORT_C void CFepLayoutAknChoiceList::AddItemL(const CFepLayoutChoiceList::SItem& aItem) |
|
144 { |
|
145 TRect r = iRect; |
|
146 CFepLayoutChoiceList::AddItemL(aItem); |
|
147 CDesCArray* itemArray = static_cast<CDesCArray*>(FormatedCellListBox()->Model()->ItemTextArray()); |
|
148 itemArray->AppendL(AdjustColumnText(aItem.iText)); |
|
149 iListBox->HandleItemAdditionL(); |
|
150 SetRect(r); |
|
151 } |
|
152 |
|
153 |
|
154 EXPORT_C void CFepLayoutAknChoiceList::InsertItemL(TInt aPostion, |
|
155 const CFepLayoutChoiceList::SItem& aItem) |
|
156 { |
|
157 TRect r = iRect; |
|
158 CFepLayoutChoiceList::InsertItemL(aPostion,aItem); |
|
159 CDesCArray* itemArray = static_cast<CDesCArray*>(FormatedCellListBox()->Model()->ItemTextArray()); |
|
160 itemArray->InsertL(aPostion,AdjustColumnText(aItem.iText)); |
|
161 iListBox->HandleItemAdditionL(); |
|
162 SetRect(r); |
|
163 } |
|
164 |
|
165 EXPORT_C void CFepLayoutAknChoiceList::RemoveItemByCommand(TInt aCommand) |
|
166 { |
|
167 TInt idx = FindCommand(aCommand); |
|
168 if(idx > 0) |
|
169 { |
|
170 RemoveItemByIndex(idx); |
|
171 } |
|
172 } |
|
173 |
|
174 void CFepLayoutAknChoiceList::RemoveItemByIndexL(TInt aIndex) |
|
175 { |
|
176 CDesCArray* itemArray = static_cast<CDesCArray*>(FormatedCellListBox()->Model()->ItemTextArray()); |
|
177 __ASSERT_DEBUG(aIndex >= 0 && aIndex < itemArray->Count(),User::Leave(EUiGeneralIndexError)); |
|
178 CFepLayoutChoiceList::RemoveItemByIndex(aIndex); |
|
179 itemArray->Delete(aIndex); |
|
180 TRAP_IGNORE(iListBox->HandleItemRemovalL()); |
|
181 } |
|
182 |
|
183 EXPORT_C void CFepLayoutAknChoiceList::RemoveItemByIndex(TInt aIndex) |
|
184 { |
|
185 TRAP_IGNORE(RemoveItemByIndexL(aIndex)); |
|
186 } |
|
187 |
|
188 EXPORT_C void CFepLayoutAknChoiceList::ClearItemsL() |
|
189 { |
|
190 CFepLayoutChoiceList::ClearItemsL(); |
|
191 CDesCArray* itemArray = static_cast<CDesCArray*>(FormatedCellListBox()->Model()->ItemTextArray()); |
|
192 itemArray->Reset(); |
|
193 } |
|
194 |
|
195 EXPORT_C TInt CFepLayoutAknChoiceList::ItemsCount() |
|
196 { |
|
197 CDesCArray* itemArray = static_cast<CDesCArray*>(FormatedCellListBox()->Model()->ItemTextArray()); |
|
198 return itemArray->Count(); |
|
199 } |
|
200 |
|
201 EXPORT_C void CFepLayoutAknChoiceList::Draw() |
|
202 { |
|
203 |
|
204 if(iWndControl && AbleToDraw()) |
|
205 { |
|
206 DrawOpaqueMaskBackground(); |
|
207 CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc()); |
|
208 gc->Activate( BitmapDevice() ); |
|
209 |
|
210 const TRect& r = Rect(); |
|
211 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
212 TRAP_IGNORE(CWindowGc& sysgc = *(RootControl()->GetRWindowGcL())); |
|
213 //if ( !AknsDrawUtils::Background( skin, iBgContext, sysgc, r ) ) |
|
214 { |
|
215 gc->Clear( Rect()); |
|
216 } |
|
217 |
|
218 iWndControl->DrawNow(); |
|
219 UpdateArea(iRect, EFalse); |
|
220 } |
|
221 |
|
222 } |
|
223 |
|
224 EXPORT_C void CFepLayoutAknChoiceList::SetItemRect(const TRect& , const TRect& ) |
|
225 { |
|
226 //do nothing |
|
227 } |
|
228 |
|
229 // CFepLayoutChoiceList::OnDisplay |
|
230 // Prepare display. |
|
231 // (other items were commented in a header). |
|
232 // --------------------------------------------------------------------------- |
|
233 // |
|
234 EXPORT_C void CFepLayoutAknChoiceList::OnDisplay(const TPoint& /*aOffset*/) |
|
235 { |
|
236 //set window position |
|
237 //iListBox->ActivateL(); |
|
238 //TBool b = iListBox->IsVisible(); |
|
239 TPoint layoutPos = UiLayout()->LayoutOwner()->LayoutRect().iTl; |
|
240 layoutPos = TPoint(0,0); |
|
241 //CFepLayoutChoiceList::OnDisplay(aOffset); |
|
242 // iListBox->SetExtent(layoutPos + aOffset,Rect().Size()); |
|
243 |
|
244 CListBoxView* view = iListBox->View(); |
|
245 TRect r = view->ViewRect(); |
|
246 r.iBr.iY -= 50; |
|
247 view->SetViewRect(r); |
|
248 |
|
249 TSize is = view->ItemSize(0); |
|
250 TInt w = MinItemWidthInPixels(); |
|
251 TSize s = iListBox->ItemDrawer()->MinimumCellSize(); |
|
252 TSize ls = iListBox->ItemDrawer()->LafItemSize (); |
|
253 |
|
254 UpdateControlContext(); |
|
255 UpdateTextColors(); |
|
256 iListBox->MakeVisible(ETrue); |
|
257 TRAP_IGNORE(iListBox->ActivateL()); |
|
258 // iListBox->ItemDrawer()->FormattedCellData()->SetSkinEnabledL( EFalse ); |
|
259 // Marquee can be requested.. ;) |
|
260 // iListBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( EFalse ); |
|
261 |
|
262 } |
|
263 |
|
264 |
|
265 |
|
266 EXPORT_C CEikColumnListBox* CFepLayoutAknChoiceList::ListBox() |
|
267 { |
|
268 return 0;//iListBox; |
|
269 } |
|
270 EXPORT_C CEikFormattedCellListBox* CFepLayoutAknChoiceList::FormatedCellListBox() |
|
271 { |
|
272 return iListBox; |
|
273 } |
|
274 |
|
275 void CFepLayoutAknChoiceList::UpdateTextColors() |
|
276 { |
|
277 TRgb color( KRgbBlack ); // sane default for nonskinned case |
|
278 if ( AknsUtils::AvkonSkinEnabled() ) |
|
279 { |
|
280 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), |
|
281 color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8 ); |
|
282 } |
|
283 |
|
284 iListBox->ItemDrawer()->SetTextColor( color ); |
|
285 iListBox->ItemDrawer()->SetBackColor( AKN_LAF_COLOR( 0 ) ); |
|
286 |
|
287 if ( AknsUtils::AvkonSkinEnabled() ) |
|
288 { |
|
289 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), |
|
290 color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8 ); |
|
291 } |
|
292 |
|
293 CFormattedCellListBoxData* d = iListBox->ItemDrawer()->FormattedCellData(); |
|
294 |
|
295 iListBox->ItemDrawer()->SetHighlightedTextColor( color ); |
|
296 iListBox->ItemDrawer()->SetHighlightedBackColor( AKN_LAF_COLOR( 0 ) ); |
|
297 } |
|
298 |
|
299 void CFepLayoutAknChoiceList::UpdateControlContext() |
|
300 { |
|
301 |
|
302 CFormattedCellListBoxItemDrawer* itemDrawer = iListBox->ItemDrawer(); |
|
303 CFormattedCellListBoxData* d = itemDrawer->FormattedCellData(); |
|
304 |
|
305 TAknLayoutRect cellRect; |
|
306 cellRect.LayoutRect( Rect(), |
|
307 AknLayoutScalable_Avkon::list_single_choice_list_pane(0) ); |
|
308 |
|
309 TRect cell( cellRect.Rect() ); |
|
310 |
|
311 TRAP_IGNORE(iListBox->SetItemHeightL( cell.Height() )); |
|
312 |
|
313 //d->SetTextSubCellL( 0, AknLayoutScalable_Avkon::list_single_choice_list_pane_t1(0) ); |
|
314 { |
|
315 |
|
316 const TAknTextLineLayout& aTextLayout = |
|
317 AknLayoutScalable_Avkon::list_single_choice_list_pane_t1(0); |
|
318 |
|
319 TAknLayoutText t; |
|
320 TInt subCell = 0; |
|
321 t.LayoutText( iListBox->View()->ItemDrawer()->ItemCellSize(), aTextLayout ); |
|
322 CFormattedCellListBoxData* d = iListBox->ItemDrawer()->FormattedCellData(); |
|
323 TRAP_IGNORE(d->SetSubCellSizeL( subCell, t.TextRect().Size() )); |
|
324 TRAP_IGNORE(d->SetSubCellPositionL( subCell, t.TextRect().iTl )); |
|
325 TRAP_IGNORE(d->SetSubCellFontL( subCell, t.Font() )); |
|
326 TRAP_IGNORE(d->SetSubCellAlignmentL( subCell, |
|
327 AknLayoutUtils::TextAlignFromId( aTextLayout.iJ ) )); |
|
328 TInt B = 22;//AknLayoutUtils::CorrectBaseline( iListBox->View()->ItemDrawer()->ItemCellSize().iHeight, aTextLayout.iB, aTextLayout.FontId() ); |
|
329 TRAP_IGNORE(d->SetSubCellBaselinePosL( subCell, B )); |
|
330 } |
|
331 |
|
332 |
|
333 { |
|
334 TAknLayoutRect cellRect; |
|
335 cellRect.LayoutRect( Rect(), |
|
336 AknLayoutScalable_Avkon::list_single_choice_list_pane(0) ); |
|
337 |
|
338 iListBox->View()->ItemDrawer()->SetItemCellSize( cellRect.Rect().Size() ); |
|
339 |
|
340 TRAP_IGNORE(iListBox->SetItemHeightL( cell.Height()*2 )); |
|
341 |
|
342 } |
|
343 /* TRect rectParent( Rect() ); |
|
344 |
|
345 TAknLayoutRect layoutRect; |
|
346 TInt variety = 0; |
|
347 |
|
348 // check if scrollbar-layout should be selected |
|
349 if ( ScrollbarVisible() ) |
|
350 { |
|
351 variety = 1; |
|
352 |
|
353 iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn); |
|
354 |
|
355 AknLayoutUtils::LayoutVerticalScrollBar( iListBox->ScrollBarFrame(), |
|
356 rectParent, |
|
357 AknLayoutScalable_Avkon::scroll_pane_cp23().LayoutLine() |
|
358 ); |
|
359 } |
|
360 else |
|
361 { |
|
362 iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff); |
|
363 } |
|
364 |
|
365 layoutRect.LayoutRect( rectParent, |
|
366 AknLayoutScalable_Avkon::list_choice_list_pane( variety ).LayoutLine() ); |
|
367 iListBox->SetRect( layoutRect.Rect() ); |
|
368 |
|
369 TAknLayoutRect innerRect; |
|
370 innerRect.LayoutRect( |
|
371 rectParent, |
|
372 AknLayoutScalable_Avkon::list_choice_list_pane(0).LayoutLine() |
|
373 ); |
|
374 |
|
375 iBgContext->SetFrameRects(rectParent, innerRect.Rect()); */ |
|
376 } |
|
377 // --------------------------------------------------------------------------- |
|
378 // CFepLayoutPopupWnd::SetRect |
|
379 // Set the pop up window's rect |
|
380 // --------------------------------------------------------------------------- |
|
381 // |
|
382 EXPORT_C void CFepLayoutAknChoiceList::SetRect(const TRect& aRect) |
|
383 { |
|
384 |
|
385 //Ensure that the top left of pop up window is always (0,0) |
|
386 //iRect.Move(-aRect.iTl.iX,-aRect.iTl.iY); |
|
387 if(iRect == aRect) |
|
388 return; |
|
389 |
|
390 iRect = aRect; |
|
391 /* |
|
392 if(iWndControl) |
|
393 iWndControl->SetRect(iRect); |
|
394 */ |
|
395 iListBox->SetRect( aRect); |
|
396 UpdateControlContext(); |
|
397 if(iScrollbarCtrl) |
|
398 { |
|
399 //set the rect of the scroll bar |
|
400 TRect rect = iScrollbarCtrl->WndControl()->Rect(); |
|
401 iScrollbarCtrl->SetRect(rect); |
|
402 } |
|
403 |
|
404 } |
|
405 |
|
406 EXPORT_C TBool CFepLayoutAknChoiceList::ScrollbarVisible() |
|
407 { |
|
408 return ETrue; |
|
409 } |
|
410 |
|
411 // --------------------------------------------------------------------------- |
|
412 // CFepLayoutAknChoiceList::HandlePointerDownEventL |
|
413 // Handle pointer down event |
|
414 // (other items were commented in a header). |
|
415 // --------------------------------------------------------------------------- |
|
416 // |
|
417 EXPORT_C CFepUiBaseCtrl* CFepLayoutAknChoiceList::HandlePointerDownEventL(const TPoint& aPoint) |
|
418 { |
|
419 if(ScrollbarVisible()) |
|
420 { |
|
421 if(iScrollbarCtrl->Rect().Contains(aPoint)) |
|
422 { |
|
423 iScrollbarCaptured = ETrue; |
|
424 return iScrollbarCtrl->HandlePointerDownEventL(aPoint); |
|
425 } |
|
426 } |
|
427 CFepUiBaseCtrl::HandlePointerDownEventL(aPoint); |
|
428 //CFepLayoutChoiceList::HandlePointerDownEventL(aPoint); |
|
429 return this; |
|
430 } |
|
431 |
|
432 // --------------------------------------------------------------------------- |
|
433 // CFepLayoutAknChoiceList::HandlePointerUpEventL |
|
434 // Handle pointer up event |
|
435 // (other items were commented in a header). |
|
436 // --------------------------------------------------------------------------- |
|
437 // |
|
438 EXPORT_C CFepUiBaseCtrl* CFepLayoutAknChoiceList::HandlePointerUpEventL( |
|
439 const TPoint& aPoint) |
|
440 { |
|
441 if(iScrollbarCaptured) |
|
442 { |
|
443 iScrollbarCaptured = EFalse; |
|
444 return iScrollbarCtrl->HandlePointerUpEventL(aPoint); |
|
445 } |
|
446 //CFepUiBaseCtrl::HandlePointerUpEventL(aPoint); |
|
447 CFepLayoutChoiceList::HandlePointerUpEventL(aPoint); |
|
448 return this; |
|
449 } |
|
450 |
|
451 // --------------------------------------------------------------------------- |
|
452 // CFepLayoutAknChoiceList::HandlePointerMoveEventL |
|
453 // Handle pointer move event |
|
454 // (other items were commented in a header). |
|
455 // --------------------------------------------------------------------------- |
|
456 // |
|
457 EXPORT_C CFepUiBaseCtrl* CFepLayoutAknChoiceList::HandlePointerMoveEventL( |
|
458 const TPoint& aPoint) |
|
459 { |
|
460 if(iScrollbarCaptured) |
|
461 { |
|
462 iScrollbarCtrl->HandlePointerMoveEventL(aPoint); |
|
463 } |
|
464 if(PointerDown()) //only handle move event after pointer down |
|
465 CFepUiBaseCtrl::HandlePointerMoveEventL(aPoint); |
|
466 //CFepLayoutChoiceList::HandlePointerMoveEventL(aPoint); |
|
467 return this; |
|
468 |
|
469 } |
|
470 |
|
471 // --------------------------------------------------------------------------- |
|
472 // CFepLayoutAknChoiceList::AdjustColumnText |
|
473 // Adjust the txt which is added to column list. |
|
474 // (other items were commented in a header). |
|
475 // --------------------------------------------------------------------------- |
|
476 // |
|
477 const TDesC& CFepLayoutAknChoiceList::AdjustColumnText(const TDesC& aTxt) |
|
478 { |
|
479 return aTxt; |
|
480 /*_LIT(KLitTabulate,"\t"); |
|
481 if(aTxt.Find(KLitTabulate) >=0) |
|
482 return aTxt; |
|
483 if(KMaxTxtLen < aTxt.Length() + KLitTabulate().Length()) |
|
484 { |
|
485 delete iTxtTransferBuf; |
|
486 iTxtTransferBuf = 0; |
|
487 iTxtTransferBuf = HBufC::NewL(aTxt.Length() + KLitTabulate().Length()); |
|
488 } |
|
489 TPtr ptr = iTxtTransferBuf->Des(); |
|
490 ptr.Zero(); |
|
491 ptr.Append(KLitTabulate); |
|
492 ptr.Append(aTxt); |
|
493 return *iTxtTransferBuf;*/ |
|
494 } |
|
495 |
|
496 // CFepLayoutAknChoiceList::ReCalcLayout |
|
497 // Calculates the displaying rect. |
|
498 // (other items were commented in a header). |
|
499 // --------------------------------------------------------------------------- |
|
500 // |
|
501 EXPORT_C void CFepLayoutAknChoiceList::ReCalcLayout() |
|
502 { |
|
503 //do nothing |
|
504 } |
|
505 |
|
506 EXPORT_C TInt CFepLayoutAknChoiceList::MinItemWidthInPixels() |
|
507 { |
|
508 |
|
509 TInt minWidth = 0; |
|
510 for(TInt i = 0; i < ItemsCount(); ++i) |
|
511 { |
|
512 TInt itemWidth = iListBox->ItemDrawer()->ItemWidthInPixels (i); |
|
513 minWidth = itemWidth > minWidth ? itemWidth : minWidth; |
|
514 } |
|
515 |
|
516 |
|
517 CFormattedCellListBoxData* d = iListBox->ItemDrawer()->FormattedCellData(); |
|
518 TSize s1 = d->SubCellSize(0); |
|
519 TSize s2 = d->SubCellSize(1); |
|
520 return minWidth; |
|
521 } |
|
522 |
|
523 //END OF FILE |
|
524 |