66
|
1 |
/*******************************************************************************
|
|
2 |
* Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved. This program and the accompanying materials
|
|
4 |
* are made available under the terms of the Eclipse Public License v1.0
|
|
5 |
* which accompanies this distribution, and is available at
|
|
6 |
* http://www.eclipse.org/legal/epl-v10.html
|
|
7 |
*
|
|
8 |
* Contributors:
|
|
9 |
* Nokia Corporation - S60 implementation
|
|
10 |
*******************************************************************************/
|
|
11 |
|
|
12 |
|
|
13 |
#include <eswtcore.rsg>
|
|
14 |
#include <AknsConstants.h>
|
|
15 |
#include <AknsUtils.h>
|
|
16 |
#include <AknUtils.h>
|
|
17 |
#include <avkon.mbg>
|
|
18 |
#include <gulicon.h>
|
|
19 |
#include <swtlaffacade.h>
|
|
20 |
#include "eswtmobileextensions.h"
|
|
21 |
#include "swtcontrolhelper.h"
|
|
22 |
#include "swttable.h"
|
|
23 |
#include "swttableitem.h"
|
|
24 |
#include "swttableitemdrawer.h"
|
|
25 |
#include "eikbtgpc.h"
|
|
26 |
#include "swttablelistbox.h"
|
|
27 |
#include "swttablelistboxview.h"
|
|
28 |
#include "swtimagetextitem.h"
|
|
29 |
#include "swtuiutils.h"
|
|
30 |
#include "swttableheader.h"
|
|
31 |
#include "swttablecolumn.h"
|
|
32 |
|
|
33 |
|
|
34 |
// ======== MEMBER FUNCTIONS ========
|
|
35 |
|
|
36 |
|
|
37 |
CSwtTable* CSwtTable::NewL(MSwtDisplay& aDisplay, TSwtPeer aPeer,
|
|
38 |
MSwtComposite& aParent, TInt aStyle)
|
|
39 |
{
|
|
40 |
CSwtTable* self = new(ELeave) CSwtTable(aDisplay, aPeer, aParent, aStyle);
|
|
41 |
CleanupStack::PushL(self);
|
|
42 |
self->ConstructL();
|
|
43 |
self->InitControlBaseL();
|
|
44 |
CleanupStack::Pop(self);
|
|
45 |
return self;
|
|
46 |
}
|
|
47 |
|
|
48 |
|
|
49 |
CSwtTable::~CSwtTable()
|
|
50 |
{
|
|
51 |
ASSERT(iTableItems.Count() == 0);
|
|
52 |
ASSERT(iTableColumns.Count() == 0);
|
|
53 |
|
|
54 |
iTableItems.Close();
|
|
55 |
iTableColumns.Close();
|
|
56 |
delete iHeader;
|
|
57 |
iHeader = NULL;
|
|
58 |
delete iTableListBox;
|
|
59 |
iTableListBox = NULL;
|
|
60 |
iColumnWidths.Close();
|
|
61 |
iImageTextItems.Close();
|
|
62 |
iColumnAlignments.Close();
|
|
63 |
iColumnImagesCounts.Close();
|
|
64 |
delete iCheckBoxOnBitmap;
|
|
65 |
delete iCheckBoxOnMask;
|
|
66 |
delete iCheckBoxOffBitmap;
|
|
67 |
delete iCheckBoxOffMask;
|
|
68 |
iCheckBoxOnBitmap = NULL;
|
|
69 |
iCheckBoxOnMask = NULL;
|
|
70 |
iCheckBoxOffBitmap = NULL;
|
|
71 |
iCheckBoxOffMask = NULL;
|
|
72 |
delete iOldSelectionArray;
|
|
73 |
}
|
|
74 |
|
|
75 |
|
|
76 |
const RPointerArray<CSwtImageTextItem>& CSwtTable::GetImageTextItems() const
|
|
77 |
{
|
|
78 |
return iImageTextItems;
|
|
79 |
}
|
|
80 |
|
|
81 |
|
|
82 |
void CSwtTable::PostSelectionEventL(TInt aDetail, TInt aItemIndex) const
|
|
83 |
{
|
|
84 |
ASSERT(aItemIndex != -1);
|
|
85 |
|
|
86 |
if ((aDetail == KSwtStyleCheck) && !(Style() & KSwtStyleCheck))
|
|
87 |
{
|
|
88 |
aDetail = KSwtNone;
|
|
89 |
}
|
|
90 |
|
|
91 |
TSwtPeer itemPeer(GetItemL(aItemIndex));
|
|
92 |
TRAP_IGNORE(iDisplay.PostSelectionEventL(iPeer, aDetail, itemPeer));
|
|
93 |
}
|
|
94 |
|
|
95 |
|
|
96 |
void CSwtTable::PostDefaultSelectionEventL(TInt aItemIndex) const
|
|
97 |
{
|
|
98 |
ASSERT(aItemIndex != -1);
|
|
99 |
|
|
100 |
TSwtPeer itemPeer(GetItemL(aItemIndex));
|
|
101 |
TInt detail = KSwtNone;
|
|
102 |
if (Style() & KSwtStyleCheck)
|
|
103 |
{
|
|
104 |
detail = KSwtStyleCheck;
|
|
105 |
}
|
|
106 |
iDisplay.PostDefaultSelectionEventL(iPeer, detail, itemPeer);
|
|
107 |
}
|
|
108 |
|
|
109 |
|
|
110 |
void CSwtTable::PostColumnSelectionEventL(TSwtPeer aColumn) const
|
|
111 |
{
|
|
112 |
iDisplay.PostSelectionEventL(aColumn);
|
|
113 |
}
|
|
114 |
|
|
115 |
|
|
116 |
void CSwtTable::PostColumnResizeEventL(TSwtPeer aColumn) const
|
|
117 |
{
|
|
118 |
iDisplay.PostResizeEventL(aColumn);
|
|
119 |
}
|
|
120 |
|
|
121 |
|
|
122 |
void CSwtTable::PostColumnMoveEventL(TSwtPeer aColumn) const
|
|
123 |
{
|
|
124 |
iDisplay.PostMoveEventL(aColumn);
|
|
125 |
}
|
|
126 |
|
|
127 |
|
|
128 |
// ---------------------------------------------------------------------------
|
|
129 |
// The header is placed above the view rectangle of the list box.
|
|
130 |
// ---------------------------------------------------------------------------
|
|
131 |
//
|
|
132 |
TRect CSwtTable::GetHeaderRect() const
|
|
133 |
{
|
|
134 |
TRect clientRect(BorderInnerRect());
|
|
135 |
TPoint headerTl(clientRect.iTl);
|
|
136 |
|
|
137 |
TInt columnCount(GetColumnCount());
|
|
138 |
TInt headerWidth(0);
|
|
139 |
for (TInt i = 0; i < columnCount; ++i)
|
|
140 |
{
|
|
141 |
headerWidth += GetColumnWidth(i);
|
|
142 |
}
|
|
143 |
TSwtTableMargins margins = GetMargins();
|
|
144 |
headerWidth += margins.iLeft;
|
|
145 |
headerWidth += margins .iRight;
|
|
146 |
if (Style() & KSwtStyleMulti || Style() & KSwtStyleCheck)
|
|
147 |
{
|
|
148 |
headerWidth += GetCheckBoxSize().iWidth;
|
|
149 |
}
|
|
150 |
TRect headerRect(headerTl,
|
|
151 |
TSize(Max(headerWidth, clientRect.Width()),
|
|
152 |
GetHeaderHeight()));
|
|
153 |
return headerRect;
|
|
154 |
}
|
|
155 |
|
|
156 |
|
|
157 |
TSwtTableMargins CSwtTable::GetMargins() const
|
|
158 |
{
|
|
159 |
TSwtTableMargins margins;
|
|
160 |
margins.iTop = iHighlightTopBottomMargin;
|
|
161 |
margins.iBottom = iHighlightTopBottomMargin;
|
|
162 |
margins.iLeft = iHighlightLeftRightMargin;
|
|
163 |
margins.iRight = iHighlightLeftRightMargin;
|
|
164 |
margins.iBetweenItems = iHighlightLeftRightMargin / 3;
|
|
165 |
return margins;
|
|
166 |
}
|
|
167 |
|
|
168 |
|
|
169 |
TSize CSwtTable::GetCheckBoxSize() const
|
|
170 |
{
|
|
171 |
return iCheckBoxSize;
|
|
172 |
}
|
|
173 |
|
|
174 |
|
|
175 |
void CSwtTable::GetCheckBoxBitmaps(const TBool& aChecked,
|
|
176 |
const CFbsBitmap** aBitmap,
|
|
177 |
const CFbsBitmap** aMask) const
|
|
178 |
{
|
|
179 |
if (aChecked)
|
|
180 |
{
|
|
181 |
*aBitmap = iCheckBoxOnBitmap;
|
|
182 |
*aMask = iCheckBoxOnMask;
|
|
183 |
}
|
|
184 |
else
|
|
185 |
{
|
|
186 |
*aBitmap = iCheckBoxOffBitmap;
|
|
187 |
*aMask = iCheckBoxOffMask;
|
|
188 |
}
|
|
189 |
}
|
|
190 |
|
|
191 |
|
|
192 |
TInt CSwtTable::IndexOfTableItem(const CSwtImageTextItem* aItem) const
|
|
193 |
{
|
|
194 |
if (!aItem)
|
|
195 |
return -1;
|
|
196 |
|
|
197 |
for (TInt i = 0; i < iImageTextItems.Count(); ++i)
|
|
198 |
{
|
|
199 |
if (iImageTextItems[ i ] == aItem)
|
|
200 |
{
|
|
201 |
return i;
|
|
202 |
}
|
|
203 |
}
|
|
204 |
return -1;
|
|
205 |
}
|
|
206 |
|
|
207 |
|
|
208 |
TRgb CSwtTable::GetHighlightTextRgb() const
|
|
209 |
{
|
|
210 |
if (iTableForegroundSet)
|
|
211 |
{
|
|
212 |
return iTableForeground;
|
|
213 |
}
|
|
214 |
else
|
|
215 |
{
|
|
216 |
return iTableDefaultHighlightText;
|
|
217 |
}
|
|
218 |
}
|
|
219 |
|
|
220 |
|
|
221 |
TBool CSwtTable::BackgroundSet() const
|
|
222 |
{
|
|
223 |
return iTableBackgroundSet;
|
|
224 |
}
|
|
225 |
|
|
226 |
|
|
227 |
TBool CSwtTable::IsChecked(const TInt& aIndex) const
|
|
228 |
{
|
|
229 |
if (Style() & KSwtStyleCheck)
|
|
230 |
{
|
|
231 |
if (aIndex < 0 || aIndex >= iTableItems.Count())
|
|
232 |
{
|
|
233 |
return EFalse;
|
|
234 |
}
|
|
235 |
return iTableListBox->View()->ItemIsSelected(aIndex);
|
|
236 |
}
|
|
237 |
return EFalse;
|
|
238 |
}
|
|
239 |
|
|
240 |
|
|
241 |
void CSwtTable::CheckItem(const TInt& aIndex)
|
|
242 |
{
|
|
243 |
TRAP_IGNORE
|
|
244 |
(
|
|
245 |
iTableListBox->SelectItemL(aIndex, EFalse);
|
|
246 |
UpdateMSKLabelL();
|
|
247 |
);
|
|
248 |
}
|
|
249 |
|
|
250 |
|
|
251 |
void CSwtTable::UncheckItem(const TInt& aIndex)
|
|
252 |
{
|
|
253 |
iTableListBox->DeselectRange(aIndex, aIndex);
|
|
254 |
TRAP_IGNORE(UpdateMSKLabelL());
|
|
255 |
}
|
|
256 |
|
|
257 |
|
|
258 |
TBool CSwtTable::ListMode() const
|
|
259 |
{
|
|
260 |
return !(GetTableColumnCount() > 0);
|
|
261 |
}
|
|
262 |
|
|
263 |
|
|
264 |
void CSwtTable::UpdateHeaderHScrollOffset(const TInt& aHScrollOffset)
|
|
265 |
{
|
|
266 |
iHeader->SetHScrollOffset(aHScrollOffset);
|
|
267 |
}
|
|
268 |
|
|
269 |
|
|
270 |
void CSwtTable::ListBoxDefaultFontChanged()
|
|
271 |
{
|
|
272 |
const MSwtFont* currentTableFont = GetFont();
|
|
273 |
TSwtTableMargins margins = GetMargins();
|
|
274 |
|
|
275 |
// The default font changed but we don't know if it's used by any
|
|
276 |
// item/cell. So let's not pass the default font height here but
|
|
277 |
// instead go through everything to find the highest one.
|
|
278 |
UpdateItemHeight(0);
|
|
279 |
|
|
280 |
iHeader->SetFont(¤tTableFont->Font());
|
|
281 |
|
|
282 |
// Header height might have changed due to the font change.
|
|
283 |
LayoutTable();
|
|
284 |
}
|
|
285 |
|
|
286 |
|
|
287 |
void CSwtTable::HandlePhysics(TBool aStatus)
|
|
288 |
{
|
|
289 |
GetShell().SetUrgentPaintControl(aStatus ? this : NULL);
|
|
290 |
}
|
|
291 |
|
|
292 |
|
|
293 |
const TRgb* CSwtTable::CustomForeground() const
|
|
294 |
{
|
|
295 |
if (iTableForegroundSet)
|
|
296 |
return &iTableForeground;
|
|
297 |
else
|
|
298 |
return NULL;
|
|
299 |
}
|
|
300 |
|
|
301 |
|
|
302 |
// ---------------------------------------------------------------------------
|
|
303 |
// From CCoeControl
|
|
304 |
// ---------------------------------------------------------------------------
|
|
305 |
//
|
|
306 |
TInt CSwtTable::CountComponentControls() const
|
|
307 |
{
|
|
308 |
TInt count(0);
|
|
309 |
if (iTableListBox)
|
|
310 |
{
|
|
311 |
++count;
|
|
312 |
}
|
|
313 |
if (iHeader)
|
|
314 |
{
|
|
315 |
++count;
|
|
316 |
}
|
|
317 |
return count;
|
|
318 |
}
|
|
319 |
|
|
320 |
|
|
321 |
// ---------------------------------------------------------------------------
|
|
322 |
// From CCoeControl
|
|
323 |
// ---------------------------------------------------------------------------
|
|
324 |
//
|
|
325 |
CCoeControl* CSwtTable::ComponentControl(TInt aIndex) const
|
|
326 |
{
|
|
327 |
CCoeControl* control = NULL;
|
|
328 |
|
|
329 |
// It is important that the header draws after the list. Kinetic scrolling
|
|
330 |
// can cause slight incorrect draw of the list on top of the header buttons.
|
|
331 |
if (aIndex == 0)
|
|
332 |
{
|
|
333 |
control = iTableListBox;
|
|
334 |
}
|
|
335 |
else if (aIndex == 1)
|
|
336 |
{
|
|
337 |
control = iHeader;
|
|
338 |
}
|
|
339 |
|
|
340 |
return control;
|
|
341 |
}
|
|
342 |
|
|
343 |
|
|
344 |
// ---------------------------------------------------------------------------
|
|
345 |
// From class CCoeControl.
|
|
346 |
// ---------------------------------------------------------------------------
|
|
347 |
//
|
|
348 |
void CSwtTable::SizeChanged()
|
|
349 |
{
|
|
350 |
LayoutTable();
|
|
351 |
CSwtComposite::SizeChanged();
|
|
352 |
}
|
|
353 |
|
|
354 |
|
|
355 |
// ---------------------------------------------------------------------------
|
|
356 |
// From class CCoeControl.
|
|
357 |
// ---------------------------------------------------------------------------
|
|
358 |
//
|
|
359 |
void CSwtTable::HandleResourceChange(TInt aType)
|
|
360 |
{
|
|
361 |
TRAP_IGNORE(HandleResourceChangeL(aType));
|
|
362 |
}
|
|
363 |
|
|
364 |
|
|
365 |
// ---------------------------------------------------------------------------
|
|
366 |
// From class CCoeControl.
|
|
367 |
// ---------------------------------------------------------------------------
|
|
368 |
//
|
|
369 |
TKeyResponse CSwtTable::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
|
|
370 |
{
|
|
371 |
TBool traversalDoIt = EFalse;
|
|
372 |
TSwtTraversal detail = ESwtTraverseNone;
|
|
373 |
TInt currentItemRowIndex = 0;
|
|
374 |
TInt lastItemRowIndex = 0;
|
|
375 |
TInt itemCount(GetItemCount());
|
|
376 |
|
|
377 |
// Up/down arrows, try to traverse if not at the middle
|
|
378 |
if (aKeyEvent.iCode == EKeyDownArrow ||
|
|
379 |
aKeyEvent.iCode == EKeyUpArrow)
|
|
380 |
{
|
|
381 |
if (itemCount > 0)
|
|
382 |
{
|
|
383 |
currentItemRowIndex = iTableListBox->View()->CurrentItemIndex();
|
|
384 |
lastItemRowIndex = itemCount - 1;
|
|
385 |
}
|
|
386 |
else
|
|
387 |
{
|
|
388 |
// In empty table this makes it to traverse
|
|
389 |
currentItemRowIndex = 0;
|
|
390 |
lastItemRowIndex = 0;
|
|
391 |
}
|
|
392 |
}
|
|
393 |
if (aKeyEvent.iCode == EKeyDownArrow)
|
|
394 |
{
|
|
395 |
if (currentItemRowIndex == lastItemRowIndex)
|
|
396 |
{
|
|
397 |
detail = ESwtTraverseArrowNext;
|
|
398 |
}
|
|
399 |
}
|
|
400 |
else if (aKeyEvent.iCode == EKeyUpArrow)
|
|
401 |
{
|
|
402 |
if (currentItemRowIndex == 0)
|
|
403 |
{
|
|
404 |
detail = ESwtTraverseArrowPrevious;
|
|
405 |
}
|
|
406 |
}
|
|
407 |
// Left/right arrows, always try to traverse
|
|
408 |
if (aKeyEvent.iCode == EKeyLeftArrow)
|
|
409 |
{
|
|
410 |
if (!iTableListBox->TableView()->CanScrollLeft())
|
|
411 |
{
|
|
412 |
detail = ESwtTraverseArrowPrevious;
|
|
413 |
}
|
|
414 |
}
|
|
415 |
else if (aKeyEvent.iCode == EKeyRightArrow)
|
|
416 |
{
|
|
417 |
if (!iTableListBox->TableView()->CanScrollRight())
|
|
418 |
{
|
|
419 |
detail = ESwtTraverseArrowNext;
|
|
420 |
}
|
|
421 |
}
|
|
422 |
|
|
423 |
// Tab key traversal is handled in HandleKeyL
|
|
424 |
if (aKeyEvent.iCode == EKeyTab)
|
|
425 |
{
|
|
426 |
traversalDoIt = ETrue;
|
|
427 |
}
|
|
428 |
|
|
429 |
if (detail != ESwtTraverseNone &&
|
|
430 |
(GetShell().FindTraversalTargetL(detail, *this)))
|
|
431 |
{
|
|
432 |
traversalDoIt = ETrue;
|
|
433 |
}
|
|
434 |
return HandleKeyL(aKeyEvent, aType, traversalDoIt);
|
|
435 |
}
|
|
436 |
|
|
437 |
|
|
438 |
// ---------------------------------------------------------------------------
|
|
439 |
// From class CCoeControl.
|
|
440 |
// ---------------------------------------------------------------------------
|
|
441 |
//
|
|
442 |
void CSwtTable::FocusChanged(TDrawNow aDrawNow)
|
|
443 |
{
|
|
444 |
TBool isFocused = IsFocusControl();
|
|
445 |
#ifdef RD_JAVA_S60_RELEASE_9_2
|
|
446 |
EnableFocusHighlight(isFocused);
|
|
447 |
#endif //RD_JAVA_S60_RELEASE_9_2
|
|
448 |
iTableListBox->SetFocus(isFocused);
|
|
449 |
HandleFocusChanged(aDrawNow);
|
|
450 |
}
|
|
451 |
|
|
452 |
|
|
453 |
// ---------------------------------------------------------------------------
|
|
454 |
// From class CCoeControl.
|
|
455 |
// ---------------------------------------------------------------------------
|
|
456 |
//
|
|
457 |
TTypeUid::Ptr CSwtTable::MopSupplyObject(TTypeUid aId)
|
|
458 |
{
|
|
459 |
if (aId.iUid == MAknsControlContext::ETypeId)
|
|
460 |
{
|
|
461 |
return TTypeUid::Null();
|
|
462 |
}
|
|
463 |
|
|
464 |
return ASwtControlBase::SwtMopSupplyObject(aId);
|
|
465 |
}
|
|
466 |
|
|
467 |
|
|
468 |
// ---------------------------------------------------------------------------
|
|
469 |
// From class CCoeControl.
|
|
470 |
// Overridden to prevent the background drawing implemented by CSwtComposite.
|
|
471 |
// The component controls take care of painting the background for Table.
|
|
472 |
// ---------------------------------------------------------------------------
|
|
473 |
//
|
|
474 |
void CSwtTable::Draw(const TRect& /*aRect*/) const
|
|
475 |
{
|
|
476 |
}
|
|
477 |
|
|
478 |
// ---------------------------------------------------------------------------
|
|
479 |
// From class MSwtTable
|
|
480 |
// ---------------------------------------------------------------------------
|
|
481 |
//
|
|
482 |
CSwtPeerArray* CSwtTable::GetTableItemsL()
|
|
483 |
{
|
|
484 |
const TInt itemCount = iTableItems.Count();
|
|
485 |
|
|
486 |
if (itemCount == 0)
|
|
487 |
{
|
|
488 |
return NULL;
|
|
489 |
}
|
|
490 |
|
|
491 |
CSwtPeerArray* array = new(ELeave) CSwtPeerArray(itemCount);
|
|
492 |
CleanupStack::PushL(array);
|
|
493 |
|
|
494 |
for (TInt i = 0; i < itemCount; ++i)
|
|
495 |
{
|
|
496 |
MSwtTableItem* item = iTableItems[ i ];
|
|
497 |
array->AppendL(item->JavaPeer());
|
|
498 |
}
|
|
499 |
|
|
500 |
CleanupStack::Pop(array);
|
|
501 |
return array;
|
|
502 |
}
|
|
503 |
|
|
504 |
|
|
505 |
// ---------------------------------------------------------------------------
|
|
506 |
// From class MSwtTable
|
|
507 |
// ---------------------------------------------------------------------------
|
|
508 |
//
|
|
509 |
CSwtPeerArray* CSwtTable::GetTableColumnsL()
|
|
510 |
{
|
|
511 |
const TInt columnCount = iTableColumns.Count();
|
|
512 |
|
|
513 |
if (columnCount == 0)
|
|
514 |
{
|
|
515 |
return NULL;
|
|
516 |
}
|
|
517 |
|
|
518 |
CSwtPeerArray* array = new(ELeave) CSwtPeerArray(columnCount);
|
|
519 |
CleanupStack::PushL(array);
|
|
520 |
|
|
521 |
for (TInt i = 0; i < columnCount; ++i)
|
|
522 |
{
|
|
523 |
MSwtTableColumn* column = iTableColumns[ i ];
|
|
524 |
array->AppendL(column->JavaPeer());
|
|
525 |
}
|
|
526 |
|
|
527 |
CleanupStack::Pop(array);
|
|
528 |
return array;
|
|
529 |
}
|
|
530 |
|
|
531 |
|
|
532 |
// ---------------------------------------------------------------------------
|
|
533 |
// From class MSwtTable
|
|
534 |
// ---------------------------------------------------------------------------
|
|
535 |
//
|
|
536 |
const RArray<TInt>& CSwtTable::GetColumnWidths() const
|
|
537 |
{
|
|
538 |
return iColumnWidths;
|
|
539 |
}
|
|
540 |
|
|
541 |
|
|
542 |
// ---------------------------------------------------------------------------
|
|
543 |
// From class MSwtTable
|
|
544 |
// ---------------------------------------------------------------------------
|
|
545 |
//
|
|
546 |
const RArray<TInt>& CSwtTable::GetColumnAlignments() const
|
|
547 |
{
|
|
548 |
return iColumnAlignments;
|
|
549 |
}
|
|
550 |
|
|
551 |
|
|
552 |
// ---------------------------------------------------------------------------
|
|
553 |
// From class MSwtTable
|
|
554 |
// ---------------------------------------------------------------------------
|
|
555 |
//
|
|
556 |
const RArray<TInt>& CSwtTable::GetColumnImageCounts() const
|
|
557 |
{
|
|
558 |
return iColumnImagesCounts;
|
|
559 |
}
|
|
560 |
|
|
561 |
|
|
562 |
// ---------------------------------------------------------------------------
|
|
563 |
// From class MSwtTable
|
|
564 |
// ---------------------------------------------------------------------------
|
|
565 |
//
|
|
566 |
MSwtComposite* CSwtTable::Composite()
|
|
567 |
{
|
|
568 |
return this;
|
|
569 |
}
|
|
570 |
|
|
571 |
|
|
572 |
// ---------------------------------------------------------------------------
|
|
573 |
// From class MSwtTable
|
|
574 |
// ---------------------------------------------------------------------------
|
|
575 |
//
|
|
576 |
void CSwtTable::AddTableItemL(MSwtTableItem& aChild, TInt aRowIndex)
|
|
577 |
{
|
|
578 |
// Store the selection state
|
|
579 |
iTableListBox->TableView()->GetSelectionIndexesL(iOldSelectionArray);
|
|
580 |
|
|
581 |
CDesCArray* itemTextArray = static_cast< CDesCArray* >(
|
|
582 |
iTableListBox->Model()->ItemTextArray());
|
|
583 |
TRAPD(error, itemTextArray->AppendL(KNullDesC));
|
|
584 |
if (error)
|
|
585 |
{
|
|
586 |
User::Leave(ESwtErrorItemNotAdded);
|
|
587 |
}
|
|
588 |
|
|
589 |
// Append the child to the list now.
|
|
590 |
error = iTableItems.Insert(&aChild, aRowIndex);
|
|
591 |
if (error != KErrNone)
|
|
592 |
{
|
|
593 |
itemTextArray->Delete(itemTextArray->Count() - 1);
|
|
594 |
User::Leave(ESwtErrorItemNotAdded);
|
|
595 |
}
|
|
596 |
|
|
597 |
error = iImageTextItems.Insert(
|
|
598 |
static_cast<CSwtTableItem&>(aChild).GetImageTextItem(), aRowIndex);
|
|
599 |
if (error != KErrNone)
|
|
600 |
{
|
|
601 |
iTableItems.Remove(aRowIndex);
|
|
602 |
itemTextArray->Delete(itemTextArray->Count() - 1);
|
|
603 |
User::Leave(ESwtErrorItemNotAdded);
|
|
604 |
}
|
|
605 |
// The focus is on the newly added item.
|
|
606 |
iTableListBox->SetCurrentItemIndex(aRowIndex);
|
|
607 |
|
|
608 |
iTableListBox->SetRequiredHeightInNumOfItems(GetItemCount());
|
|
609 |
iTableListBox->HandleItemAdditionL();
|
|
610 |
|
|
611 |
// The added item is shown as the first item in the view.
|
|
612 |
iTableListBox->SetTopItemIndex(aRowIndex);
|
|
613 |
|
|
614 |
// Restore the selection state updating the indexes.
|
|
615 |
UpdateSelectionIndexesL(aRowIndex, aRowIndex, iOldSelectionArray, ETrue);
|
|
616 |
|
|
617 |
if (ListMode())
|
|
618 |
{
|
|
619 |
TInt newItemWidth = iImageTextItems[ aRowIndex ]->GetPreferredListModeItemWidth();
|
|
620 |
if (newItemWidth > GetColumnWidth(0))
|
|
621 |
{
|
|
622 |
SetColumnWidth(0, newItemWidth);
|
|
623 |
}
|
|
624 |
}
|
|
625 |
|
|
626 |
UpdateMSKLabelL();
|
|
627 |
}
|
|
628 |
|
|
629 |
|
|
630 |
// ---------------------------------------------------------------------------
|
|
631 |
// From class MSwtTable
|
|
632 |
// ---------------------------------------------------------------------------
|
|
633 |
//
|
|
634 |
void CSwtTable::AddTableColumnL(MSwtTableColumn& aChild, TInt aColumnIndex)
|
|
635 |
{
|
|
636 |
ASSERT(aColumnIndex <= iTableColumns.Count());
|
|
637 |
|
|
638 |
TInt err(KErrNone);
|
|
639 |
TInt oldColumnCount(GetTableColumnCount());
|
|
640 |
TInt iUpdatedTableItem(0);
|
|
641 |
TBool headerUpdated(EFalse);
|
|
642 |
|
|
643 |
// If this is the first TableColumn added by the application then we are
|
|
644 |
// in List mode and we actually have these items for the List mode column
|
|
645 |
// already and we don't want to add new ones.
|
|
646 |
if (oldColumnCount > 0)
|
|
647 |
{
|
|
648 |
User::LeaveIfError(iColumnWidths.Insert(0, aColumnIndex));
|
|
649 |
err = iColumnAlignments.Insert(CGraphicsContext::ELeft, aColumnIndex);
|
|
650 |
if (err == KErrNone)
|
|
651 |
{
|
|
652 |
err = iColumnImagesCounts.Insert(0, aColumnIndex);
|
|
653 |
}
|
|
654 |
if (err == KErrNone)
|
|
655 |
{
|
|
656 |
TRAP(err, iHeader->InsertNewColumnL(aColumnIndex));
|
|
657 |
if (err == KErrNone)
|
|
658 |
{
|
|
659 |
MCoeControlObserver* observer = static_cast<CSwtTableColumn*>(&aChild);
|
|
660 |
iHeader->SetColumnHeaderObserver(observer, aColumnIndex);
|
|
661 |
headerUpdated = ETrue;
|
|
662 |
}
|
|
663 |
}
|
|
664 |
if (err == KErrNone)
|
|
665 |
{
|
|
666 |
// Add the column to each TableItem
|
|
667 |
TInt nAllItems(iTableItems.Count());
|
|
668 |
for (; iUpdatedTableItem < nAllItems; iUpdatedTableItem++)
|
|
669 |
{
|
|
670 |
TRAP(err, iTableItems[ iUpdatedTableItem ]->InsertNewColumnL(aColumnIndex));
|
|
671 |
if (err != KErrNone)
|
|
672 |
{
|
|
673 |
break;
|
|
674 |
}
|
|
675 |
}
|
|
676 |
}
|
|
677 |
}
|
|
678 |
// Add the TableColumn, this we don't have in List mode so it's added always
|
|
679 |
if (err == KErrNone)
|
|
680 |
{
|
|
681 |
err = iTableColumns.Insert(&aChild, aColumnIndex);
|
|
682 |
if (err == KErrNone)
|
|
683 |
{
|
|
684 |
MCoeControlObserver* observer = static_cast<CSwtTableColumn*>(&aChild);
|
|
685 |
iHeader->SetColumnHeaderObserver(observer, aColumnIndex);
|
|
686 |
}
|
|
687 |
}
|
|
688 |
|
|
689 |
// If something went wrong then restore the arrays and leave.
|
|
690 |
if (err != KErrNone)
|
|
691 |
{
|
|
692 |
for (TInt i = 0; i < iUpdatedTableItem; ++i)
|
|
693 |
{
|
|
694 |
iTableItems[ i ]->RemoveColumn(aColumnIndex);
|
|
695 |
}
|
|
696 |
if (headerUpdated)
|
|
697 |
{
|
|
698 |
iHeader->SetColumnHeaderObserver(NULL, aColumnIndex);
|
|
699 |
iHeader->RemoveColumn(aColumnIndex);
|
|
700 |
}
|
|
701 |
if (iColumnImagesCounts.Count() > oldColumnCount)
|
|
702 |
{
|
|
703 |
iColumnImagesCounts.Remove(aColumnIndex);
|
|
704 |
}
|
|
705 |
if (iColumnAlignments.Count() > oldColumnCount)
|
|
706 |
{
|
|
707 |
iColumnAlignments.Remove(aColumnIndex);
|
|
708 |
}
|
|
709 |
if (iColumnWidths.Count() > oldColumnCount)
|
|
710 |
{
|
|
711 |
iColumnWidths.Remove(aColumnIndex);
|
|
712 |
}
|
|
713 |
User::Leave(err);
|
|
714 |
}
|
|
715 |
|
|
716 |
iTableListBox->HandleDataSizeChangeL();
|
|
717 |
|
|
718 |
Redraw();
|
|
719 |
}
|
|
720 |
|
|
721 |
|
|
722 |
// ---------------------------------------------------------------------------
|
|
723 |
// From class MSwtTable
|
|
724 |
// ---------------------------------------------------------------------------
|
|
725 |
//
|
|
726 |
void CSwtTable::RemoveTableColumn(MSwtTableColumn& aChild)
|
|
727 |
{
|
|
728 |
TInt nbColumns = GetTableColumnCount();
|
|
729 |
TInt columnIndex = IndexOfTableColumn(&aChild);
|
|
730 |
ASSERT(columnIndex != KErrNotFound);
|
|
731 |
|
|
732 |
// Keep a column for the List-mode
|
|
733 |
if (nbColumns > 1)
|
|
734 |
{
|
|
735 |
iColumnWidths.Remove(columnIndex);
|
|
736 |
iColumnAlignments.Remove(columnIndex);
|
|
737 |
iColumnImagesCounts.Remove(columnIndex);
|
|
738 |
iHeader->SetColumnHeaderObserver(NULL, columnIndex);
|
|
739 |
iHeader->RemoveColumn(columnIndex);
|
|
740 |
TInt nbItems(iTableItems.Count());
|
|
741 |
for (TInt i = 0; i < nbItems; i++)
|
|
742 |
{
|
|
743 |
iTableItems[ i ]->RemoveColumn(columnIndex);
|
|
744 |
}
|
|
745 |
}
|
|
746 |
else
|
|
747 |
{
|
|
748 |
TRAP_IGNORE(iHeader->SetTextL(0, KNullDesC));
|
|
749 |
}
|
|
750 |
|
|
751 |
// remove the TableColumn
|
|
752 |
iTableColumns.Remove(columnIndex);
|
|
753 |
|
|
754 |
// The column alignment on first column is always Left
|
|
755 |
iColumnAlignments[0] = CGraphicsContext::ELeft;
|
|
756 |
|
|
757 |
if (ListMode())
|
|
758 |
{
|
|
759 |
PackColumn(0);
|
|
760 |
}
|
|
761 |
|
|
762 |
TRAP_IGNORE(iTableListBox->HandleDataSizeChangeL());
|
|
763 |
|
|
764 |
Redraw();
|
|
765 |
}
|
|
766 |
|
|
767 |
|
|
768 |
// ---------------------------------------------------------------------------
|
|
769 |
// From class MSwtTable
|
|
770 |
// ---------------------------------------------------------------------------
|
|
771 |
//
|
|
772 |
void CSwtTable::DeselectItems(const TInt* aIndices, TInt aCount)
|
|
773 |
{
|
|
774 |
if (!(Style() & KSwtStyleMulti))
|
|
775 |
{
|
|
776 |
return;
|
|
777 |
}
|
|
778 |
iTableListBox->DeselectItems(aIndices, aCount);
|
|
779 |
TRAP_IGNORE(UpdateMSKLabelL());
|
|
780 |
}
|
|
781 |
|
|
782 |
|
|
783 |
// ---------------------------------------------------------------------------
|
|
784 |
// From class MSwtTable
|
|
785 |
// ---------------------------------------------------------------------------
|
|
786 |
//
|
|
787 |
void CSwtTable::DeselectRange(TInt aStart, TInt aEnd)
|
|
788 |
{
|
|
789 |
if (!(Style() & KSwtStyleMulti))
|
|
790 |
{
|
|
791 |
return;
|
|
792 |
}
|
|
793 |
iTableListBox->DeselectRange(aStart, aEnd);
|
|
794 |
TRAP_IGNORE(UpdateMSKLabelL());
|
|
795 |
}
|
|
796 |
|
|
797 |
|
|
798 |
// ---------------------------------------------------------------------------
|
|
799 |
// From class MSwtTable
|
|
800 |
// ---------------------------------------------------------------------------
|
|
801 |
//
|
|
802 |
TInt CSwtTable::IndexOfTableColumn(const MSwtTableColumn *aColumn) const
|
|
803 |
{
|
|
804 |
// We return -1 if not found.
|
|
805 |
return iTableColumns.Find(aColumn);
|
|
806 |
}
|
|
807 |
|
|
808 |
|
|
809 |
// ---------------------------------------------------------------------------
|
|
810 |
// From class MSwtTable
|
|
811 |
// ---------------------------------------------------------------------------
|
|
812 |
//
|
|
813 |
TInt CSwtTable::IndexOfTableItemAt(const MSwtTableItem *aItem, TInt aStart) const
|
|
814 |
{
|
|
815 |
if (aStart < 0 || aStart >= GetItemCount())
|
|
816 |
{
|
|
817 |
return -1;
|
|
818 |
}
|
|
819 |
|
|
820 |
if (aStart == 0)
|
|
821 |
{
|
|
822 |
TInt pos = 0;
|
|
823 |
while (pos < iTableItems.Count())
|
|
824 |
{
|
|
825 |
if (iTableItems[pos] == aItem)
|
|
826 |
{
|
|
827 |
return pos;
|
|
828 |
}
|
|
829 |
else
|
|
830 |
{
|
|
831 |
pos++;
|
|
832 |
}
|
|
833 |
}
|
|
834 |
}
|
|
835 |
else
|
|
836 |
{
|
|
837 |
for (TInt i = aStart; i < iTableItems.Count(); ++i)
|
|
838 |
{
|
|
839 |
if (aItem == iTableItems[i])
|
|
840 |
{
|
|
841 |
return i;
|
|
842 |
}
|
|
843 |
}
|
|
844 |
}
|
|
845 |
return -1;
|
|
846 |
}
|
|
847 |
|
|
848 |
TInt CSwtTable::IndexOfTableItem(const MSwtTableItem *aItem) const
|
|
849 |
{
|
|
850 |
// We return -1 if not found.
|
|
851 |
return iTableItems.Find(aItem);
|
|
852 |
}
|
|
853 |
|
|
854 |
// ---------------------------------------------------------------------------
|
|
855 |
// From class MSwtTable
|
|
856 |
// ---------------------------------------------------------------------------
|
|
857 |
//
|
|
858 |
TInt CSwtTable::GetColumnCount() const
|
|
859 |
{
|
|
860 |
return iColumnWidths.Count();
|
|
861 |
}
|
|
862 |
|
|
863 |
|
|
864 |
// ---------------------------------------------------------------------------
|
|
865 |
// From class MSwtTable
|
|
866 |
// ---------------------------------------------------------------------------
|
|
867 |
//
|
|
868 |
TInt CSwtTable::GetTableColumnCount() const
|
|
869 |
{
|
|
870 |
return iTableColumns.Count();
|
|
871 |
}
|
|
872 |
|
|
873 |
|
|
874 |
// ---------------------------------------------------------------------------
|
|
875 |
// From class MSwtTable
|
|
876 |
// ---------------------------------------------------------------------------
|
|
877 |
//
|
|
878 |
TBool CSwtTable::GetHeaderVisible() const
|
|
879 |
{
|
|
880 |
return iHeaderVisible;
|
|
881 |
}
|
|
882 |
|
|
883 |
|
|
884 |
// ---------------------------------------------------------------------------
|
|
885 |
// From class MSwtTable
|
|
886 |
// ---------------------------------------------------------------------------
|
|
887 |
//
|
|
888 |
TSwtPeer CSwtTable::GetItemL(TInt aIndex) const
|
|
889 |
{
|
|
890 |
if (aIndex < 0 || aIndex >= iTableItems.Count())
|
|
891 |
{
|
|
892 |
User::Leave(ESwtErrorInvalidRange);
|
|
893 |
}
|
|
894 |
return iTableItems[ aIndex ]->JavaPeer();
|
|
895 |
}
|
|
896 |
|
|
897 |
|
|
898 |
// ---------------------------------------------------------------------------
|
|
899 |
// From class MSwtTable
|
|
900 |
// ---------------------------------------------------------------------------
|
|
901 |
//
|
|
902 |
TSwtPeer CSwtTable::GetColumnL(TInt aIndex) const
|
|
903 |
{
|
|
904 |
// Range is already checked in java side
|
|
905 |
if (aIndex < 0 || aIndex >= iTableColumns.Count())
|
|
906 |
{
|
|
907 |
User::Leave(ESwtErrorInvalidRange);
|
|
908 |
}
|
|
909 |
return iTableColumns[ aIndex ]->JavaPeer();
|
|
910 |
}
|
|
911 |
|
|
912 |
TInt CSwtTable::GetItemCount() const
|
|
913 |
{
|
|
914 |
return iTableItems.Count();
|
|
915 |
}
|
|
916 |
|
|
917 |
|
|
918 |
// ---------------------------------------------------------------------------
|
|
919 |
// From class MSwtTable
|
|
920 |
// ---------------------------------------------------------------------------
|
|
921 |
//
|
|
922 |
TRect CSwtTable::GetItemRect(TInt aRowIndex) const
|
|
923 |
{
|
|
924 |
TRect itemRect(iTableListBox->GetItemRect(aRowIndex));
|
|
925 |
|
|
926 |
TRect rect(BorderInnerRect());
|
|
927 |
if (iHeaderVisible)
|
|
928 |
{
|
|
929 |
rect.iTl.iY += GetHeaderHeight();
|
|
930 |
}
|
|
931 |
TPoint origin(SbInnerRect(rect).iTl);
|
|
932 |
itemRect.Move(-origin);
|
|
933 |
return itemRect;
|
|
934 |
}
|
|
935 |
|
|
936 |
|
|
937 |
// ---------------------------------------------------------------------------
|
|
938 |
// From class MSwtTable
|
|
939 |
// ---------------------------------------------------------------------------
|
|
940 |
//
|
|
941 |
TBool CSwtTable::GetLinesVisible() const
|
|
942 |
{
|
|
943 |
return iLinesVisible;
|
|
944 |
}
|
|
945 |
|
|
946 |
|
|
947 |
// ---------------------------------------------------------------------------
|
|
948 |
// From class MSwtTable
|
|
949 |
// ---------------------------------------------------------------------------
|
|
950 |
//
|
|
951 |
TInt CSwtTable::GetSelectionIndex() const
|
|
952 |
{
|
|
953 |
if (!(iStyle & KSwtStyleMulti))
|
|
954 |
{
|
|
955 |
return GetFocusIndex();
|
|
956 |
}
|
|
957 |
|
|
958 |
// Multi
|
|
959 |
|
|
960 |
const CArrayFix< TInt >* selectionIndices = iTableListBox->SelectionIndexes();
|
|
961 |
|
|
962 |
if (!selectionIndices)
|
|
963 |
{
|
|
964 |
return -1;
|
|
965 |
}
|
|
966 |
|
|
967 |
// We want the first index
|
|
968 |
TInt index = -1; // This is for no item selected.
|
|
969 |
for (TInt i = 0; i < selectionIndices->Count(); i++)
|
|
970 |
{
|
|
971 |
TInt currentIndex = selectionIndices->At(i);
|
|
972 |
if ((index == -1) || (currentIndex < index))
|
|
973 |
{
|
|
974 |
index = currentIndex;
|
|
975 |
}
|
|
976 |
}
|
|
977 |
return index;
|
|
978 |
}
|
|
979 |
|
|
980 |
|
|
981 |
// ---------------------------------------------------------------------------
|
|
982 |
// From class MSwtTable
|
|
983 |
// ---------------------------------------------------------------------------
|
|
984 |
//
|
|
985 |
TInt CSwtTable::GetSelectionCount() const
|
|
986 |
{
|
|
987 |
if (iStyle & KSwtStyleMulti)
|
|
988 |
{
|
|
989 |
return iTableListBox->GetSelectionCount();
|
|
990 |
}
|
|
991 |
else
|
|
992 |
{
|
|
993 |
if (GetItemCount() > 0)
|
|
994 |
{
|
|
995 |
return 1;
|
|
996 |
}
|
|
997 |
else
|
|
998 |
{
|
|
999 |
return 0;
|
|
1000 |
}
|
|
1001 |
}
|
|
1002 |
}
|
|
1003 |
|
|
1004 |
|
|
1005 |
// ---------------------------------------------------------------------------
|
|
1006 |
// From class MSwtTable
|
|
1007 |
// ---------------------------------------------------------------------------
|
|
1008 |
//
|
|
1009 |
const CArrayFix<TInt>* CSwtTable::GetSelectionIndicesL() const
|
|
1010 |
{
|
|
1011 |
CArrayFix<TInt>* array = NULL;
|
|
1012 |
if (iStyle & KSwtStyleMulti)
|
|
1013 |
{
|
|
1014 |
const CArrayFix<TInt>* selectionArray = iTableListBox->SelectionIndexes();
|
|
1015 |
array = new(ELeave) CArrayFixFlat<TInt>(selectionArray->Length());
|
|
1016 |
CleanupStack::PushL(array);
|
|
1017 |
for (TInt i = 0; i < selectionArray->Count(); ++i)
|
|
1018 |
{
|
|
1019 |
array->AppendL(selectionArray->At(i));
|
|
1020 |
}
|
|
1021 |
CleanupStack::Pop(array);
|
|
1022 |
}
|
|
1023 |
else
|
|
1024 |
{
|
|
1025 |
TInt selectedItems = GetItemCount() > 0 ? 1 : 0;
|
|
1026 |
array = new(ELeave) CArrayFixFlat<TInt>(1);
|
|
1027 |
if (selectedItems)
|
|
1028 |
{
|
|
1029 |
array->AppendL(GetFocusIndex());
|
|
1030 |
}
|
|
1031 |
}
|
|
1032 |
return array;
|
|
1033 |
}
|
|
1034 |
|
|
1035 |
|
|
1036 |
// ---------------------------------------------------------------------------
|
|
1037 |
// From class MSwtTable
|
|
1038 |
// ---------------------------------------------------------------------------
|
|
1039 |
//
|
|
1040 |
const TSize& CSwtTable::ImageSize() const
|
|
1041 |
{
|
|
1042 |
return iImageSize;
|
|
1043 |
}
|
|
1044 |
|
|
1045 |
|
|
1046 |
// ---------------------------------------------------------------------------
|
|
1047 |
// From class MSwtTable
|
|
1048 |
// ---------------------------------------------------------------------------
|
|
1049 |
//
|
|
1050 |
void CSwtTable::NotifyImageAdded(TInt aColumnIndex)
|
|
1051 |
{
|
|
1052 |
++iColumnImagesCounts[ aColumnIndex ];
|
|
1053 |
ASSERT(iColumnImagesCounts[ aColumnIndex ] <= GetItemCount());
|
|
1054 |
}
|
|
1055 |
|
|
1056 |
|
|
1057 |
// ---------------------------------------------------------------------------
|
|
1058 |
// From class MSwtTable
|
|
1059 |
// ---------------------------------------------------------------------------
|
|
1060 |
//
|
|
1061 |
void CSwtTable::NotifyImageRemoved(TInt aColumnIndex)
|
|
1062 |
{
|
|
1063 |
--iColumnImagesCounts[ aColumnIndex ];
|
|
1064 |
ASSERT(iColumnImagesCounts[ aColumnIndex ] >= 0);
|
|
1065 |
}
|
|
1066 |
|
|
1067 |
|
|
1068 |
// ---------------------------------------------------------------------------
|
|
1069 |
// From class MSwtTable
|
|
1070 |
// ---------------------------------------------------------------------------
|
|
1071 |
//
|
|
1072 |
void CSwtTable::PackColumn(TInt aColumnIndex)
|
|
1073 |
{
|
|
1074 |
TInt maxWidth = 0;
|
|
1075 |
TInt nbItems = iTableItems.Count();
|
|
1076 |
|
|
1077 |
for (TInt itemIndex = 0; itemIndex < nbItems; itemIndex++)
|
|
1078 |
{
|
|
1079 |
TInt currentWidth = iTableItems[ itemIndex ]->
|
|
1080 |
GetPreferredSize(aColumnIndex).iWidth;
|
|
1081 |
if (maxWidth < currentWidth)
|
|
1082 |
{
|
|
1083 |
maxWidth = currentWidth;
|
|
1084 |
}
|
|
1085 |
}
|
|
1086 |
|
|
1087 |
TInt headerWidth = iHeader->GetPreferredSize(aColumnIndex).iWidth;
|
|
1088 |
if (maxWidth < headerWidth)
|
|
1089 |
{
|
|
1090 |
maxWidth = headerWidth;
|
|
1091 |
}
|
|
1092 |
|
|
1093 |
SetColumnWidth(aColumnIndex, maxWidth);
|
|
1094 |
}
|
|
1095 |
|
|
1096 |
|
|
1097 |
// ---------------------------------------------------------------------------
|
|
1098 |
// From class MSwtTable
|
|
1099 |
// ---------------------------------------------------------------------------
|
|
1100 |
//
|
|
1101 |
void CSwtTable::RemoveItemL(TInt aIndex)
|
|
1102 |
{
|
|
1103 |
if (aIndex < 0 ||
|
|
1104 |
aIndex >= iTableItems.Count())
|
|
1105 |
{
|
|
1106 |
User::Leave(ESwtErrorInvalidRange);
|
|
1107 |
}
|
|
1108 |
RemoveRangeL(aIndex, aIndex);
|
|
1109 |
}
|
|
1110 |
|
|
1111 |
|
|
1112 |
// ---------------------------------------------------------------------------
|
|
1113 |
// From class MSwtTable
|
|
1114 |
// ---------------------------------------------------------------------------
|
|
1115 |
//
|
|
1116 |
void CSwtTable::RemoveRangeL(TInt aStart, TInt aEnd)
|
|
1117 |
{
|
|
1118 |
if (aStart < 0 ||
|
|
1119 |
aStart >= iTableItems.Count() ||
|
|
1120 |
aEnd < 0 ||
|
|
1121 |
aEnd >= iTableItems.Count())
|
|
1122 |
{
|
|
1123 |
User::Leave(ESwtErrorInvalidRange);
|
|
1124 |
}
|
|
1125 |
|
|
1126 |
iTableListBox->TableView()->SetDisableRedraw(ETrue);
|
|
1127 |
|
|
1128 |
// Store the selection state
|
|
1129 |
TInt oldFocusIndex = GetFocusIndex();
|
|
1130 |
iTableListBox->TableView()->GetSelectionIndexesL(iOldSelectionArray);
|
|
1131 |
|
|
1132 |
CDesCArray* itemTextArray = static_cast< CDesCArray* >(
|
|
1133 |
iTableListBox->Model()->ItemTextArray());
|
|
1134 |
itemTextArray->Delete(aStart, aEnd - aStart + 1); //lint !e834
|
|
1135 |
|
|
1136 |
iTableListBox->SetRequiredHeightInNumOfItems(GetItemCount());
|
|
1137 |
|
|
1138 |
for (TInt i = aStart; i <= aEnd; ++i)
|
|
1139 |
{
|
|
1140 |
iImageTextItems.Remove(aStart);
|
|
1141 |
iTableItems.Remove(aStart);
|
|
1142 |
}
|
|
1143 |
|
|
1144 |
iTableListBox->HandleItemRemovalL();
|
|
1145 |
|
|
1146 |
// Take care of updating the focus index if the focused item was removed
|
|
1147 |
TInt focusIndex = GetFocusIndex();
|
|
1148 |
if (oldFocusIndex != focusIndex)
|
|
1149 |
{
|
|
1150 |
// Focus moves to the next item
|
|
1151 |
focusIndex = aStart;
|
|
1152 |
}
|
|
1153 |
if (focusIndex > GetItemCount() - 1)
|
|
1154 |
{
|
|
1155 |
// Focus loops around to the first item
|
|
1156 |
focusIndex = 0;
|
|
1157 |
}
|
|
1158 |
iTableListBox->SetCurrentItemIndex(focusIndex);
|
|
1159 |
|
|
1160 |
if (focusIndex >= 0)
|
|
1161 |
{
|
|
1162 |
iTableListBox->ScrollToMakeItemVisible(focusIndex);
|
|
1163 |
}
|
|
1164 |
|
|
1165 |
// Restore the selection state updating the indexes.
|
|
1166 |
UpdateSelectionIndexesL(aStart, aEnd, iOldSelectionArray, EFalse);
|
|
1167 |
|
|
1168 |
iTableListBox->TableView()->SetDisableRedraw(EFalse);
|
|
1169 |
|
|
1170 |
if (ListMode())
|
|
1171 |
{
|
|
1172 |
PackColumn(0);
|
|
1173 |
}
|
|
1174 |
else
|
|
1175 |
{
|
|
1176 |
Redraw();
|
|
1177 |
}
|
|
1178 |
|
|
1179 |
UpdateMSKLabelL();
|
|
1180 |
}
|
|
1181 |
|
|
1182 |
|
|
1183 |
// ---------------------------------------------------------------------------
|
|
1184 |
// From class MSwtTable
|
|
1185 |
// ---------------------------------------------------------------------------
|
|
1186 |
//
|
|
1187 |
void CSwtTable::RemoveItemsL(const TInt* aIndices, TInt aCount)
|
|
1188 |
{
|
|
1189 |
if (aIndices[0] < 0 ||
|
|
1190 |
aIndices[0] >= iTableItems.Count() ||
|
|
1191 |
aIndices[aCount-1] < 0 ||
|
|
1192 |
aIndices[aCount-1] >= iTableItems.Count())
|
|
1193 |
{
|
|
1194 |
User::Leave(ESwtErrorInvalidRange);
|
|
1195 |
}
|
|
1196 |
|
|
1197 |
// Store the focus index
|
|
1198 |
TInt oldFocusIndex = GetFocusIndex();
|
|
1199 |
|
|
1200 |
TInt oldIndex = -1;
|
|
1201 |
CDesCArray* itemTextArray = static_cast< CDesCArray* >(
|
|
1202 |
iTableListBox->Model()->ItemTextArray());
|
|
1203 |
for (TInt i = 0; i < aCount; ++i)
|
|
1204 |
{
|
|
1205 |
// Indexes must be sorted in descending order.
|
|
1206 |
// This avoids removing the same index twice.
|
|
1207 |
ASSERT((oldIndex == -1) || (aIndices[ i ] <= oldIndex));
|
|
1208 |
|
|
1209 |
// Store the selection state
|
|
1210 |
iTableListBox->TableView()->GetSelectionIndexesL(iOldSelectionArray);
|
|
1211 |
|
|
1212 |
if (aIndices[i] != oldIndex)
|
|
1213 |
{
|
|
1214 |
TInt index = aIndices[ i ];
|
|
1215 |
itemTextArray->Delete(index);
|
|
1216 |
iImageTextItems.Remove(index);
|
|
1217 |
iTableItems.Remove(index);
|
|
1218 |
|
|
1219 |
oldIndex = index;
|
|
1220 |
|
|
1221 |
// Restore the selection state updating the indexes.
|
|
1222 |
UpdateSelectionIndexesL(index, index, iOldSelectionArray, EFalse);
|
|
1223 |
}
|
|
1224 |
}
|
|
1225 |
|
|
1226 |
iTableListBox->SetRequiredHeightInNumOfItems(GetItemCount());
|
|
1227 |
iTableListBox->HandleItemRemovalL();
|
|
1228 |
|
|
1229 |
// Take care of updating the focus index if the focused item was removed
|
|
1230 |
TInt focusIndex = GetFocusIndex();
|
|
1231 |
if (oldFocusIndex != focusIndex)
|
|
1232 |
{
|
|
1233 |
// Focus moves to the next item
|
|
1234 |
focusIndex = oldFocusIndex;
|
|
1235 |
}
|
|
1236 |
if (focusIndex > GetItemCount() - 1)
|
|
1237 |
{
|
|
1238 |
// Focus loops around to the first item
|
|
1239 |
focusIndex = 0;
|
|
1240 |
}
|
|
1241 |
iTableListBox->SetCurrentItemIndex(focusIndex);
|
|
1242 |
|
|
1243 |
if (focusIndex >= 0)
|
|
1244 |
{
|
|
1245 |
iTableListBox->ScrollToMakeItemVisible(focusIndex);
|
|
1246 |
}
|
|
1247 |
|
|
1248 |
if (ListMode())
|
|
1249 |
{
|
|
1250 |
PackColumn(0);
|
|
1251 |
}
|
|
1252 |
else
|
|
1253 |
{
|
|
1254 |
Redraw();
|
|
1255 |
}
|
|
1256 |
|
|
1257 |
UpdateMSKLabelL();
|
|
1258 |
}
|
|
1259 |
|
|
1260 |
|
|
1261 |
// ---------------------------------------------------------------------------
|
|
1262 |
// From class MSwtTable
|
|
1263 |
// ---------------------------------------------------------------------------
|
|
1264 |
//
|
|
1265 |
void CSwtTable::RemoveAll()
|
|
1266 |
{
|
|
1267 |
if (GetItemCount() == 0)
|
|
1268 |
{
|
|
1269 |
return;
|
|
1270 |
}
|
|
1271 |
|
|
1272 |
CDesCArray* itemTextArray = static_cast<CDesCArray*>(
|
|
1273 |
iTableListBox->Model()->ItemTextArray());
|
|
1274 |
itemTextArray->Reset();
|
|
1275 |
|
|
1276 |
iTableListBox->SetRequiredHeightInNumOfItems(0);
|
|
1277 |
|
|
1278 |
// As there are no more elements, we must reset the cell width to 0,
|
|
1279 |
// because MinimumSize is using this value to compute the max width
|
|
1280 |
// of the items, according to the longest string.
|
|
1281 |
iTableListBox->TableItemDrawer()->SetCellWidthInChars(0);
|
|
1282 |
|
|
1283 |
// We remove the children to the list now
|
|
1284 |
iImageTextItems.Reset();
|
|
1285 |
iTableItems.Reset();
|
|
1286 |
|
|
1287 |
iTableListBox->SetCurrentItemIndex(0);
|
|
1288 |
TRAP_IGNORE(iTableListBox->HandleItemRemovalL());
|
|
1289 |
|
|
1290 |
if (ListMode())
|
|
1291 |
{
|
|
1292 |
PackColumn(0);
|
|
1293 |
}
|
|
1294 |
else
|
|
1295 |
{
|
|
1296 |
Redraw();
|
|
1297 |
}
|
|
1298 |
TRAP_IGNORE(UpdateMSKLabelL());
|
|
1299 |
}
|
|
1300 |
|
|
1301 |
|
|
1302 |
// ---------------------------------------------------------------------------
|
|
1303 |
// From class MSwtTable
|
|
1304 |
// ---------------------------------------------------------------------------
|
|
1305 |
//
|
|
1306 |
void CSwtTable::SelectItemL(TInt aIndex, TBool aScroll)
|
|
1307 |
{
|
|
1308 |
ASSERT(aIndex >= 0); // Checked in Java side
|
|
1309 |
|
|
1310 |
if (aIndex > GetItemCount() -1)
|
|
1311 |
{
|
|
1312 |
return;
|
|
1313 |
}
|
|
1314 |
|
|
1315 |
iTableListBox->SelectItemL(aIndex, aScroll);
|
|
1316 |
|
|
1317 |
UpdateMSKLabelL();
|
|
1318 |
}
|
|
1319 |
|
|
1320 |
// ---------------------------------------------------------------------------
|
|
1321 |
// From class MSwtTable
|
|
1322 |
// ---------------------------------------------------------------------------
|
|
1323 |
//
|
|
1324 |
void CSwtTable::SelectAllL()
|
|
1325 |
{
|
|
1326 |
iTableListBox->SelectAllL();
|
|
1327 |
UpdateMSKLabelL();
|
|
1328 |
}
|
|
1329 |
|
|
1330 |
// ---------------------------------------------------------------------------
|
|
1331 |
// From class MSwtTable
|
|
1332 |
// ---------------------------------------------------------------------------
|
|
1333 |
//
|
|
1334 |
void CSwtTable::SetFocusIndex(TInt aIndex)
|
|
1335 |
{
|
|
1336 |
ASSERT(iTableListBox);
|
|
1337 |
if (aIndex < 0 || aIndex >= GetItemCount())
|
|
1338 |
{
|
|
1339 |
return;
|
|
1340 |
}
|
|
1341 |
|
|
1342 |
iTableListBox->SetFocusIndex(aIndex);
|
|
1343 |
|
|
1344 |
TRAP_IGNORE(UpdateMSKLabelL());
|
|
1345 |
}
|
|
1346 |
|
|
1347 |
// ---------------------------------------------------------------------------
|
|
1348 |
// From class MSwtTable
|
|
1349 |
// ---------------------------------------------------------------------------
|
|
1350 |
//
|
|
1351 |
void CSwtTable::SetHeaderVisible(TBool aShow)
|
|
1352 |
{
|
|
1353 |
TBool oldVisibility(iHeaderVisible);
|
|
1354 |
// Maybe a call to NotifyImageRemoved or NotifyImageAdded could be done here
|
|
1355 |
// for each column when the header visibility is modified.
|
|
1356 |
iHeaderVisible = aShow;
|
|
1357 |
// Recompute the size of the TableListBox, with or without the header.
|
|
1358 |
LayoutTable();
|
|
1359 |
|
|
1360 |
if (oldVisibility != iHeaderVisible)
|
|
1361 |
{
|
|
1362 |
TRAP_IGNORE(iTableListBox->HandleViewRectSizeChangeL());
|
|
1363 |
}
|
|
1364 |
|
|
1365 |
Redraw();
|
|
1366 |
}
|
|
1367 |
|
|
1368 |
|
|
1369 |
// ---------------------------------------------------------------------------
|
|
1370 |
// From class MSwtTable
|
|
1371 |
// ---------------------------------------------------------------------------
|
|
1372 |
//
|
|
1373 |
void CSwtTable::SetLinesVisible(TBool aShow)
|
|
1374 |
{
|
|
1375 |
iLinesVisible = aShow;
|
|
1376 |
Redraw();
|
|
1377 |
}
|
|
1378 |
|
|
1379 |
|
|
1380 |
// ---------------------------------------------------------------------------
|
|
1381 |
// From class MSwtTable
|
|
1382 |
// ---------------------------------------------------------------------------
|
|
1383 |
//
|
|
1384 |
void CSwtTable::SelectRangeL(TInt aStart, TInt aEnd)
|
|
1385 |
{
|
|
1386 |
// This function never gets called for single table due to Java side checks.
|
|
1387 |
iTableListBox->SelectRangeL(aStart, aEnd);
|
|
1388 |
UpdateMSKLabelL();
|
|
1389 |
}
|
|
1390 |
|
|
1391 |
|
|
1392 |
// ---------------------------------------------------------------------------
|
|
1393 |
// From class MSwtTable
|
|
1394 |
// ---------------------------------------------------------------------------
|
|
1395 |
//
|
|
1396 |
void CSwtTable::ShowSelection()
|
|
1397 |
{
|
|
1398 |
if (Style() & KSwtStyleMulti)
|
|
1399 |
{
|
|
1400 |
iTableListBox->ShowSelection();
|
|
1401 |
}
|
|
1402 |
else
|
|
1403 |
{
|
|
1404 |
TInt focusIndex = GetFocusIndex();
|
|
1405 |
if (focusIndex >= 0)
|
|
1406 |
{
|
|
1407 |
iTableListBox->ScrollToMakeItemVisible(focusIndex);
|
|
1408 |
}
|
|
1409 |
}
|
|
1410 |
}
|
|
1411 |
|
|
1412 |
|
|
1413 |
// ---------------------------------------------------------------------------
|
|
1414 |
// From class MSwtTable
|
|
1415 |
// ---------------------------------------------------------------------------
|
|
1416 |
//
|
|
1417 |
CSwtPeerArray* CSwtTable::GetSelectionL()
|
|
1418 |
{
|
|
1419 |
const TInt itemCount = iTableItems.Count();
|
|
1420 |
|
|
1421 |
if (itemCount == 0)
|
|
1422 |
{
|
|
1423 |
return NULL;
|
|
1424 |
}
|
|
1425 |
|
|
1426 |
if (Style() & KSwtStyleMulti)
|
|
1427 |
{
|
|
1428 |
const CArrayFix< TInt >* selectionArray = iTableListBox->SelectionIndexes();
|
|
1429 |
if (!selectionArray || selectionArray->Count() == 0)
|
|
1430 |
{
|
|
1431 |
return NULL;
|
|
1432 |
}
|
|
1433 |
|
|
1434 |
CSwtPeerArray* array = new(ELeave) CSwtPeerArray(selectionArray->Count());
|
|
1435 |
CleanupStack::PushL(array);
|
|
1436 |
|
|
1437 |
for (TInt i = 0; i < selectionArray->Count(); ++i)
|
|
1438 |
{
|
|
1439 |
MSwtTableItem* item = iTableItems[ selectionArray->At(i)]; //lint !e613
|
|
1440 |
array->AppendL(item->JavaPeer());
|
|
1441 |
}
|
|
1442 |
|
|
1443 |
CleanupStack::Pop(array);
|
|
1444 |
return array;
|
|
1445 |
}
|
|
1446 |
else
|
|
1447 |
{
|
|
1448 |
CSwtPeerArray* array = new(ELeave) CSwtPeerArray(1);
|
|
1449 |
CleanupStack::PushL(array);
|
|
1450 |
MSwtTableItem* item = iTableItems[ GetFocusIndex()]; //lint !e613
|
|
1451 |
array->AppendL(item->JavaPeer());
|
|
1452 |
CleanupStack::Pop(array);
|
|
1453 |
return array;
|
|
1454 |
}
|
|
1455 |
}
|
|
1456 |
|
|
1457 |
|
|
1458 |
// ---------------------------------------------------------------------------
|
|
1459 |
// From class MSwtTable
|
|
1460 |
// ---------------------------------------------------------------------------
|
|
1461 |
//
|
|
1462 |
TBool CSwtTable::IsSelected(TInt aIndex) const
|
|
1463 |
{
|
|
1464 |
if (Style() & KSwtStyleMulti)
|
|
1465 |
{
|
|
1466 |
if (aIndex < 0 || aIndex >= iTableItems.Count())
|
|
1467 |
{
|
|
1468 |
return EFalse;
|
|
1469 |
}
|
|
1470 |
return iTableListBox->View()->ItemIsSelected(aIndex);
|
|
1471 |
}
|
|
1472 |
else
|
|
1473 |
{
|
|
1474 |
return GetItemCount() > 0 ? (GetFocusIndex() == aIndex) : EFalse;
|
|
1475 |
}
|
|
1476 |
}
|
|
1477 |
|
|
1478 |
|
|
1479 |
// ---------------------------------------------------------------------------
|
|
1480 |
// From class MSwtTable
|
|
1481 |
// ---------------------------------------------------------------------------
|
|
1482 |
//
|
|
1483 |
TInt CSwtTable::GetTopIndex() const
|
|
1484 |
{
|
|
1485 |
return iTableListBox->TopItemIndex();
|
|
1486 |
}
|
|
1487 |
|
|
1488 |
|
|
1489 |
// ---------------------------------------------------------------------------
|
|
1490 |
// From class MSwtTable
|
|
1491 |
// ---------------------------------------------------------------------------
|
|
1492 |
//
|
|
1493 |
void CSwtTable::SetTopIndex(TInt aIndex)
|
|
1494 |
{
|
|
1495 |
|
|
1496 |
TInt count = GetItemCount();
|
|
1497 |
|
|
1498 |
if (count == 0)
|
|
1499 |
{
|
|
1500 |
return;
|
|
1501 |
}
|
|
1502 |
|
|
1503 |
aIndex = Min(Max(0, aIndex), count - 1);
|
|
1504 |
|
|
1505 |
iTableListBox->SetTopItemIndex(aIndex);
|
|
1506 |
|
|
1507 |
Redraw();
|
|
1508 |
}
|
|
1509 |
|
|
1510 |
|
|
1511 |
// ---------------------------------------------------------------------------
|
|
1512 |
// From class MSwtTable
|
|
1513 |
// ---------------------------------------------------------------------------
|
|
1514 |
//
|
|
1515 |
void CSwtTable::SetColumnTextL(MSwtTableColumn& aTableColumn, const TDesC& aText)
|
|
1516 |
{
|
|
1517 |
TInt indexColumn = IndexOfTableColumn(&aTableColumn);
|
|
1518 |
iHeader->SetTextL(indexColumn, aText);
|
|
1519 |
RedrawRegion(GetHeaderRect());
|
|
1520 |
}
|
|
1521 |
|
|
1522 |
|
|
1523 |
// ---------------------------------------------------------------------------
|
|
1524 |
// From class MSwtTable
|
|
1525 |
// ---------------------------------------------------------------------------
|
|
1526 |
//
|
|
1527 |
TInt CSwtTable::GetColumnWidth(TInt aColumnIndex) const
|
|
1528 |
{
|
|
1529 |
return iColumnWidths[ aColumnIndex ];
|
|
1530 |
}
|
|
1531 |
|
|
1532 |
|
|
1533 |
// ---------------------------------------------------------------------------
|
|
1534 |
// From class MSwtTable
|
|
1535 |
// ---------------------------------------------------------------------------
|
|
1536 |
//
|
|
1537 |
TInt CSwtTable::GetColumnAlignment(TInt aColumnIndex)
|
|
1538 |
{
|
|
1539 |
return iColumnAlignments[ aColumnIndex ];
|
|
1540 |
}
|
|
1541 |
|
|
1542 |
|
|
1543 |
// ---------------------------------------------------------------------------
|
|
1544 |
// From class MSwtTable
|
|
1545 |
// ---------------------------------------------------------------------------
|
|
1546 |
//
|
|
1547 |
void CSwtTable::SetColumnWidth(TInt aColumnIndex, TInt aWidth)
|
|
1548 |
{
|
|
1549 |
ASSERT(aColumnIndex >= 0);
|
|
1550 |
ASSERT(aColumnIndex < iColumnWidths.Count());
|
|
1551 |
|
|
1552 |
// Set only if positive, ignore otherwise
|
|
1553 |
if (aWidth >= 0)
|
|
1554 |
{
|
|
1555 |
iColumnWidths[ aColumnIndex ] = aWidth;
|
|
1556 |
iHeader->UpdateColumnWidth(aColumnIndex, aWidth);
|
|
1557 |
TRAP_IGNORE(iTableListBox->HandleDataSizeChangeL());
|
|
1558 |
|
|
1559 |
// Send column resize and move events
|
|
1560 |
TInt colCount(GetTableColumnCount());
|
|
1561 |
TRAP_IGNORE
|
|
1562 |
(
|
|
1563 |
for (TInt i = aColumnIndex; i < colCount; ++i)
|
|
1564 |
{
|
|
1565 |
if (i == aColumnIndex)
|
|
1566 |
{
|
|
1567 |
PostColumnResizeEventL(iTableColumns[ i ]->JavaPeer());
|
|
1568 |
}
|
|
1569 |
else
|
|
1570 |
{
|
|
1571 |
PostColumnMoveEventL(iTableColumns[ i ]->JavaPeer());
|
|
1572 |
}
|
|
1573 |
}
|
|
1574 |
);
|
|
1575 |
Redraw();
|
|
1576 |
}
|
|
1577 |
}
|
|
1578 |
|
|
1579 |
|
|
1580 |
// ---------------------------------------------------------------------------
|
|
1581 |
// From class MSwtTable
|
|
1582 |
// ---------------------------------------------------------------------------
|
|
1583 |
//
|
|
1584 |
void CSwtTable::SetColumnAlignment(TInt aColumnIndex, TInt aAlignment)
|
|
1585 |
{
|
|
1586 |
ASSERT(aColumnIndex>=0);
|
|
1587 |
ASSERT(aColumnIndex<iColumnAlignments.Count());
|
|
1588 |
iColumnAlignments[ aColumnIndex ] = aAlignment;
|
|
1589 |
iHeader->UpdateColumnAlignment(aColumnIndex, aAlignment);
|
|
1590 |
Redraw();
|
|
1591 |
}
|
|
1592 |
|
|
1593 |
|
|
1594 |
// ---------------------------------------------------------------------------
|
|
1595 |
// From class MSwtTable
|
|
1596 |
// ---------------------------------------------------------------------------
|
|
1597 |
//
|
|
1598 |
void CSwtTable::SetTableImageSizeIfNotDefined(const TSize& aSize,
|
|
1599 |
const TBool& aAddedToItem)
|
|
1600 |
{
|
|
1601 |
if (iImageSize == TSize(0, 0))
|
|
1602 |
{
|
|
1603 |
iImageSize = aSize;
|
|
1604 |
if (ListMode())
|
|
1605 |
{
|
|
1606 |
PackColumn(0);
|
|
1607 |
}
|
|
1608 |
}
|
|
1609 |
if (aAddedToItem)
|
|
1610 |
{
|
|
1611 |
UpdateItemHeight(iImageSize.iHeight);
|
|
1612 |
}
|
|
1613 |
}
|
|
1614 |
|
|
1615 |
|
|
1616 |
// ---------------------------------------------------------------------------
|
|
1617 |
// From class MSwtTable
|
|
1618 |
// Updates the table item (row) height. The items all have the same height.
|
|
1619 |
//
|
|
1620 |
// The height of the
|
|
1621 |
// - image
|
|
1622 |
// - checkbox
|
|
1623 |
// - margins
|
|
1624 |
// are the same for all items. The only item that has varying height between
|
|
1625 |
// different table items is the font.
|
|
1626 |
//
|
|
1627 |
// As a parameter the font height of the changed item may be passed. It is
|
|
1628 |
// used to check if the given height would require the common item height of
|
|
1629 |
// all items to be increased. In this case it is not necessary to loop through
|
|
1630 |
// all the items. If the given height is smaller than the current common item
|
|
1631 |
// height of all items then all the items have to be looped through to find
|
|
1632 |
// the one with the highest font that determines the minimum allowed common
|
|
1633 |
// item height for all the items.
|
|
1634 |
//
|
|
1635 |
// Also the image size may be passed as the parameter when it is first set
|
|
1636 |
// (done only once). Then if the image size would require to increase the
|
|
1637 |
// common item height it is just set without any investigation. If the image
|
|
1638 |
// size would require to decrease the common item height then all items are
|
|
1639 |
// looped through and the highest font determines the common item height
|
|
1640 |
// (actually this is useless because in this case the height is already
|
|
1641 |
// correct, but currently the logic doesn't know is the given height is
|
|
1642 |
// the image or the font).
|
|
1643 |
//
|
|
1644 |
// It is always checked if the checkbox or the image size requires more
|
|
1645 |
// height than the given font. In that case they determine the item height
|
|
1646 |
// and items don't need to be looped through.
|
|
1647 |
// ---------------------------------------------------------------------------
|
|
1648 |
//
|
|
1649 |
void CSwtTable::UpdateItemHeight(const TInt& aChangedFontHeight)
|
|
1650 |
{
|
|
1651 |
TInt columnCount(GetColumnCount());
|
|
1652 |
TInt itemCount(GetItemCount());
|
|
1653 |
TInt marginTop(GetMargins().iTop);
|
|
1654 |
TInt marginBottom(GetMargins().iBottom);
|
|
1655 |
|
|
1656 |
// Check if current is in the view before updating item height.
|
|
1657 |
// If it is then it will be kept in the view.
|
|
1658 |
TInt currentItemIndex = iTableListBox->CurrentItemIndex();
|
|
1659 |
TBool currentItemWasVisible = EFalse;
|
|
1660 |
if (currentItemIndex >= 0)
|
|
1661 |
{
|
|
1662 |
currentItemWasVisible =
|
|
1663 |
iTableListBox->TableView()->ItemIsVisible(currentItemIndex);
|
|
1664 |
}
|
|
1665 |
|
|
1666 |
// Initially the highest item found so far is the changed font height.
|
|
1667 |
TInt highestHeight(aChangedFontHeight);
|
|
1668 |
|
|
1669 |
// If there are images then check if images would require more height.
|
|
1670 |
TBool images = EFalse;
|
|
1671 |
for (TInt i = 0; i < columnCount; ++i)
|
|
1672 |
{
|
|
1673 |
if (iColumnImagesCounts[ i ] != 0)
|
|
1674 |
{
|
|
1675 |
images = ETrue;
|
|
1676 |
break;
|
|
1677 |
}
|
|
1678 |
}
|
|
1679 |
if (images)
|
|
1680 |
{
|
|
1681 |
highestHeight = Max(iImageSize.iHeight, highestHeight);
|
|
1682 |
}
|
|
1683 |
|
|
1684 |
// If there are checkbox graphics then check if they would require more
|
|
1685 |
// height.
|
|
1686 |
if (iStyle & KSwtStyleMulti || iStyle & KSwtStyleCheck)
|
|
1687 |
{
|
|
1688 |
highestHeight = Max(iCheckBoxSize.iHeight, highestHeight);
|
|
1689 |
}
|
|
1690 |
|
|
1691 |
// If it looks like the items are higher than required by the changed
|
|
1692 |
// font, images, or checkboxes, then we have loop them through to find
|
|
1693 |
// the one that has the highest font.
|
|
1694 |
TInt oldItemHeight(iTableListBox->ItemHeight());
|
|
1695 |
if (highestHeight + marginTop + marginBottom < oldItemHeight)
|
|
1696 |
{
|
|
1697 |
for (TInt item = 0; item < itemCount; ++item)
|
|
1698 |
{
|
|
1699 |
for (TInt column = 0; column < columnCount; ++column)
|
|
1700 |
{
|
|
1701 |
const MSwtFont* swtFont = (static_cast<CSwtImageTextItem*>(
|
|
1702 |
iImageTextItems[ item ]))->GetFont(column);
|
|
1703 |
if (swtFont)
|
|
1704 |
{
|
|
1705 |
TInt fontHeight = swtFont->Font().FontMaxHeight();
|
|
1706 |
if (fontHeight > highestHeight)
|
|
1707 |
{
|
|
1708 |
highestHeight = fontHeight;
|
|
1709 |
}
|
|
1710 |
}
|
|
1711 |
}
|
|
1712 |
}
|
|
1713 |
}
|
|
1714 |
// Now we know the highest item checkbox/image/font height.
|
|
1715 |
// Just add margins and set it.
|
|
1716 |
TInt newItemHeight(highestHeight + marginTop + marginBottom);
|
|
1717 |
|
|
1718 |
MSwtUiUtils& utils = iDisplay.UiUtils();
|
|
1719 |
TMargins8 padding = iDisplay.UiUtils().InlineReferencePadding();
|
|
1720 |
TInt height = utils.InlineReferenceFontHeight();
|
|
1721 |
height += padding.iTop + padding.iBottom;
|
|
1722 |
if (newItemHeight < height) newItemHeight = height;
|
|
1723 |
|
|
1724 |
if (oldItemHeight != newItemHeight)
|
|
1725 |
{
|
|
1726 |
TRAP_IGNORE(
|
|
1727 |
iTableListBox->SetItemHeightL(newItemHeight);
|
|
1728 |
iTableListBox->HandleDataSizeChangeL();
|
|
1729 |
);
|
|
1730 |
|
|
1731 |
// Make sure the focused item is still in the view.
|
|
1732 |
if (currentItemWasVisible)
|
|
1733 |
{
|
|
1734 |
TInt focusIndex = GetFocusIndex();
|
|
1735 |
if (focusIndex >= 0)
|
|
1736 |
{
|
|
1737 |
iTableListBox->ScrollToMakeItemVisible(focusIndex);
|
|
1738 |
}
|
|
1739 |
}
|
|
1740 |
|
|
1741 |
// Send column resize events
|
|
1742 |
TInt colCount(GetTableColumnCount());
|
|
1743 |
TRAP_IGNORE
|
|
1744 |
(
|
|
1745 |
for (TInt i = 0; i < colCount; ++i)
|
|
1746 |
{
|
|
1747 |
PostColumnResizeEventL(iTableColumns[ i ]->JavaPeer());
|
|
1748 |
}
|
|
1749 |
);
|
|
1750 |
Redraw();
|
|
1751 |
}
|
|
1752 |
}
|
|
1753 |
|
|
1754 |
|
|
1755 |
// ---------------------------------------------------------------------------
|
|
1756 |
// From class MSwtTable
|
|
1757 |
// ---------------------------------------------------------------------------
|
|
1758 |
//
|
|
1759 |
TInt CSwtTable::GetGridLineWidth() const
|
|
1760 |
{
|
|
1761 |
return iGridLineWidth;
|
|
1762 |
}
|
|
1763 |
|
|
1764 |
|
|
1765 |
// ---------------------------------------------------------------------------
|
|
1766 |
// From class MSwtTable
|
|
1767 |
// ---------------------------------------------------------------------------
|
|
1768 |
//
|
|
1769 |
TInt CSwtTable::GetHeaderHeight() const
|
|
1770 |
{
|
|
1771 |
if (!iHeaderVisible)
|
|
1772 |
{
|
|
1773 |
return 0;
|
|
1774 |
}
|
|
1775 |
return iHeader->GetPreferredSize().iHeight;
|
|
1776 |
}
|
|
1777 |
|
|
1778 |
|
|
1779 |
// ---------------------------------------------------------------------------
|
|
1780 |
// From class MSwtTable
|
|
1781 |
// ---------------------------------------------------------------------------
|
|
1782 |
//
|
|
1783 |
void CSwtTable::ShowTableColumn(MSwtTableColumn& aTableColumn)
|
|
1784 |
{
|
|
1785 |
// We have checked in java side that the TableColumn is not disposed,
|
|
1786 |
iTableListBox->TableView()->ScrollToMakeColumnVisible(IndexOfTableColumn(&aTableColumn));
|
|
1787 |
TRAP_IGNORE(iTableListBox->UpdateScrollBarsL());
|
|
1788 |
}
|
|
1789 |
|
|
1790 |
|
|
1791 |
// ---------------------------------------------------------------------------
|
|
1792 |
// From class MSwtTable
|
|
1793 |
// ---------------------------------------------------------------------------
|
|
1794 |
//
|
|
1795 |
void CSwtTable::ShowTableItem(MSwtTableItem& aTableItem)
|
|
1796 |
{
|
|
1797 |
TInt index = IndexOfTableItem(&aTableItem);
|
|
1798 |
if (index != KErrNotFound)
|
|
1799 |
{
|
|
1800 |
iTableListBox->ScrollToMakeItemVisible(index);
|
|
1801 |
}
|
|
1802 |
}
|
|
1803 |
|
|
1804 |
|
|
1805 |
// ---------------------------------------------------------------------------
|
|
1806 |
// From class MSwtTable
|
|
1807 |
// ---------------------------------------------------------------------------
|
|
1808 |
//
|
|
1809 |
TInt CSwtTable::GetItemHeight() const
|
|
1810 |
{
|
|
1811 |
return iTableListBox->ItemHeight();
|
|
1812 |
}
|
|
1813 |
|
|
1814 |
|
|
1815 |
// ---------------------------------------------------------------------------
|
|
1816 |
// From class MSwtTable
|
|
1817 |
// ---------------------------------------------------------------------------
|
|
1818 |
//
|
|
1819 |
TSwtPeer CSwtTable::GetItemFromPoint(TPoint &aPoint) const
|
|
1820 |
{
|
|
1821 |
TInt index = 0;
|
|
1822 |
TBool found = iTableListBox->View()->XYPosToItemIndex(aPoint, index);
|
|
1823 |
if (found && index >= 0 && index < iTableItems.Count())
|
|
1824 |
{
|
|
1825 |
return iTableItems[ index ]->JavaPeer();
|
|
1826 |
}
|
|
1827 |
else
|
|
1828 |
{
|
|
1829 |
return NULL;
|
|
1830 |
}
|
|
1831 |
}
|
|
1832 |
|
|
1833 |
|
|
1834 |
// ---------------------------------------------------------------------------
|
|
1835 |
// From class MSwtTable
|
|
1836 |
// ---------------------------------------------------------------------------
|
|
1837 |
//
|
|
1838 |
const TRgb& CSwtTable::GetDefaultForeground() const
|
|
1839 |
{
|
|
1840 |
return iTableDefaultForeground;
|
|
1841 |
}
|
|
1842 |
|
|
1843 |
|
|
1844 |
// ---------------------------------------------------------------------------
|
|
1845 |
// From class MSwtTable
|
|
1846 |
// ---------------------------------------------------------------------------
|
|
1847 |
//
|
|
1848 |
const TDesC& CSwtTable::GetColumnText(TInt aColumnIndex) const
|
|
1849 |
{
|
|
1850 |
return iHeader->GetText(aColumnIndex);
|
|
1851 |
}
|
|
1852 |
|
|
1853 |
|
|
1854 |
// ---------------------------------------------------------------------------
|
|
1855 |
// From class MSwtTable
|
|
1856 |
// ---------------------------------------------------------------------------
|
|
1857 |
//
|
|
1858 |
void CSwtTable::SetColumnImage(TInt aColumnIndex, const MSwtImage* aImage)
|
|
1859 |
{
|
|
1860 |
if (aImage)
|
|
1861 |
{
|
|
1862 |
SetTableImageSizeIfNotDefined(aImage->GetBounds().Size(),
|
|
1863 |
EFalse);
|
|
1864 |
}
|
|
1865 |
iHeader->SetImageByIndex(aColumnIndex, aImage);
|
|
1866 |
LayoutTable();
|
|
1867 |
Redraw();
|
|
1868 |
}
|
|
1869 |
|
|
1870 |
|
|
1871 |
// ---------------------------------------------------------------------------
|
|
1872 |
// From MSwtControl
|
|
1873 |
// ---------------------------------------------------------------------------
|
|
1874 |
//
|
|
1875 |
CCoeControl& CSwtTable::CoeControl()
|
|
1876 |
{
|
|
1877 |
return *this;
|
|
1878 |
}
|
|
1879 |
|
|
1880 |
|
|
1881 |
// ---------------------------------------------------------------------------
|
|
1882 |
// From MSwtControl
|
|
1883 |
// ---------------------------------------------------------------------------
|
|
1884 |
//
|
|
1885 |
const CCoeControl& CSwtTable::CoeControl() const
|
|
1886 |
{
|
|
1887 |
return *this;
|
|
1888 |
}
|
|
1889 |
|
|
1890 |
|
|
1891 |
// ---------------------------------------------------------------------------
|
|
1892 |
// From MSwtControl
|
|
1893 |
// ---------------------------------------------------------------------------
|
|
1894 |
//
|
|
1895 |
TBool CSwtTable::IsFocusable(TInt aReason /*=KSwtFocusByApi*/) const
|
|
1896 |
{
|
|
1897 |
// Don't want CSwtComposite's focusability behavior
|
|
1898 |
return ASwtScrollableBase::IsFocusable(aReason);
|
|
1899 |
}
|
|
1900 |
|
|
1901 |
// ---------------------------------------------------------------------------
|
|
1902 |
// From MSwtControl
|
|
1903 |
// ---------------------------------------------------------------------------
|
|
1904 |
//
|
|
1905 |
TInt CSwtTable::FocusBackgroundPolicy() const
|
|
1906 |
{
|
|
1907 |
#ifdef RD_JAVA_S60_RELEASE_9_2
|
|
1908 |
return ENoFocusBackgroundInCaptionedControl;
|
|
1909 |
#else
|
|
1910 |
return ASwtControlBase::FocusBackgroundPolicy();
|
|
1911 |
#endif // RD_JAVA_S60_RELEASE_9_2
|
|
1912 |
}
|
|
1913 |
// ---------------------------------------------------------------------------
|
|
1914 |
// From MSwtControl
|
|
1915 |
// ---------------------------------------------------------------------------
|
|
1916 |
//
|
|
1917 |
TSize CSwtTable::ComputeSizeL(TInt aWHint, TInt aHHint)
|
|
1918 |
{
|
|
1919 |
TInt borderWidth = GetBorderWidth();
|
|
1920 |
if (aHHint != KSwtDefault)
|
|
1921 |
{
|
|
1922 |
TInt minimumHeight = borderWidth + GetHeaderHeight() + SbOuterRect(TRect()).Height();
|
|
1923 |
if (aHHint < minimumHeight)
|
|
1924 |
{
|
|
1925 |
aHHint = minimumHeight;
|
|
1926 |
}
|
|
1927 |
}
|
|
1928 |
if (aWHint != KSwtDefault)
|
|
1929 |
{
|
|
1930 |
TInt minimumWidth = borderWidth + SbOuterRect(TRect()).Width();
|
|
1931 |
if (aWHint < minimumWidth)
|
|
1932 |
{
|
|
1933 |
aWHint = minimumWidth;
|
|
1934 |
}
|
|
1935 |
}
|
|
1936 |
|
|
1937 |
TSize preferredSize(aWHint, aHHint);
|
|
1938 |
preferredSize -= TSize(borderWidth * 2, borderWidth * 2);
|
|
1939 |
preferredSize = SbInnerRect(TRect(TPoint(), preferredSize)).Size();
|
|
1940 |
if (aHHint == KSwtDefault)
|
|
1941 |
{
|
|
1942 |
preferredSize.iHeight = GetHeaderHeight();
|
|
1943 |
TInt itemCount = GetItemCount();
|
|
1944 |
if (itemCount < 1)
|
|
1945 |
{
|
|
1946 |
itemCount = 1;
|
|
1947 |
}
|
|
1948 |
preferredSize.iHeight += iTableListBox->ItemHeight() * itemCount;
|
|
1949 |
}
|
|
1950 |
if (aWHint == KSwtDefault)
|
|
1951 |
{
|
|
1952 |
preferredSize.iWidth = iTableListBox->TableView()->DataWidth();
|
|
1953 |
}
|
|
1954 |
preferredSize = SbOuterRect(TRect(TPoint(), preferredSize)).Size();
|
|
1955 |
preferredSize = BorderOuterRect(TRect(TPoint(), preferredSize)).Size();
|
|
1956 |
return preferredSize;
|
|
1957 |
}
|
|
1958 |
|
|
1959 |
|
|
1960 |
// ---------------------------------------------------------------------------
|
|
1961 |
// From MSwtControl
|
|
1962 |
// ---------------------------------------------------------------------------
|
|
1963 |
//
|
|
1964 |
TInt CSwtTable::GetBorderWidth() const
|
|
1965 |
{
|
|
1966 |
return ASwtControlBase::GetBorderWidth();
|
|
1967 |
}
|
|
1968 |
|
|
1969 |
|
|
1970 |
// ---------------------------------------------------------------------------
|
|
1971 |
// From MSwtControl
|
|
1972 |
// ---------------------------------------------------------------------------
|
|
1973 |
//
|
|
1974 |
TRect CSwtTable::ClientRect() const
|
|
1975 |
{
|
|
1976 |
return SbInnerRect(BorderInnerRect());
|
|
1977 |
}
|
|
1978 |
|
|
1979 |
|
|
1980 |
// ---------------------------------------------------------------------------
|
|
1981 |
// From MSwtControl
|
|
1982 |
// ---------------------------------------------------------------------------
|
|
1983 |
//
|
|
1984 |
void CSwtTable::ProcessKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
|
|
1985 |
{
|
|
1986 |
#ifdef RD_JAVA_S60_RELEASE_9_2
|
|
1987 |
if (aType == EEventKeyDown)
|
|
1988 |
{
|
|
1989 |
// After panning focus highlight was disabled, so enabling again
|
|
1990 |
EnableFocusHighlight(ETrue);
|
|
1991 |
}
|
|
1992 |
#endif //RD_JAVA_S60_RELEASE_9_2
|
|
1993 |
iTableListBox->ProcessKeyEventL(aKeyEvent, aType);
|
|
1994 |
}
|
|
1995 |
|
|
1996 |
|
|
1997 |
// ---------------------------------------------------------------------------
|
|
1998 |
// From MSwtControl
|
|
1999 |
// ---------------------------------------------------------------------------
|
|
2000 |
//
|
|
2001 |
TRgb CSwtTable::GetBackground() const
|
|
2002 |
{
|
|
2003 |
if (iTableBackgroundSet)
|
|
2004 |
{
|
|
2005 |
return iTableBackground;
|
|
2006 |
}
|
|
2007 |
else
|
|
2008 |
{
|
|
2009 |
// Multi color backgrounds are used. The color returned
|
|
2010 |
// here is not actually used.
|
|
2011 |
return ASwtControlBase::GetBackground();
|
|
2012 |
}
|
|
2013 |
}
|
|
2014 |
|
|
2015 |
|
|
2016 |
// ---------------------------------------------------------------------------
|
|
2017 |
// From MSwtControl
|
|
2018 |
// ---------------------------------------------------------------------------
|
|
2019 |
//
|
|
2020 |
TRgb CSwtTable::GetForeground() const
|
|
2021 |
{
|
|
2022 |
if (iTableForegroundSet)
|
|
2023 |
{
|
|
2024 |
return iTableForeground;
|
|
2025 |
}
|
|
2026 |
else
|
|
2027 |
{
|
|
2028 |
return iTableDefaultForeground;
|
|
2029 |
}
|
|
2030 |
}
|
|
2031 |
|
|
2032 |
|
|
2033 |
// ---------------------------------------------------------------------------
|
|
2034 |
// From MSwtControl
|
|
2035 |
// ---------------------------------------------------------------------------
|
|
2036 |
//
|
|
2037 |
void CSwtTable::SetBackgroundL(const MSwtColor* aColor)
|
|
2038 |
{
|
|
2039 |
if (aColor)
|
|
2040 |
{
|
|
2041 |
iTableBackgroundSet = ETrue;
|
|
2042 |
iTableBackground = aColor->RgbValue();
|
|
2043 |
}
|
|
2044 |
else
|
|
2045 |
{
|
|
2046 |
iTableBackgroundSet = EFalse;
|
|
2047 |
}
|
|
2048 |
Redraw();
|
|
2049 |
}
|
|
2050 |
|
|
2051 |
|
|
2052 |
// ---------------------------------------------------------------------------
|
|
2053 |
// From MSwtControl
|
|
2054 |
// ---------------------------------------------------------------------------
|
|
2055 |
//
|
|
2056 |
void CSwtTable::SetForegroundL(const MSwtColor* aColor)
|
|
2057 |
{
|
|
2058 |
if (aColor)
|
|
2059 |
{
|
|
2060 |
iTableForegroundSet = ETrue;
|
|
2061 |
iTableForeground = aColor->RgbValue();
|
|
2062 |
}
|
|
2063 |
else
|
|
2064 |
{
|
|
2065 |
iTableForegroundSet = EFalse;
|
|
2066 |
}
|
|
2067 |
iHeader->SetForegroundL(aColor);
|
|
2068 |
Redraw();
|
|
2069 |
}
|
|
2070 |
|
|
2071 |
|
|
2072 |
// ---------------------------------------------------------------------------
|
|
2073 |
// From MSwtControl
|
|
2074 |
// Sets the font for the table. This font is used for everything unless
|
|
2075 |
// it is overridden by setting a specific font to an item or cell of the
|
|
2076 |
// table. Null sets the default font.
|
|
2077 |
// ---------------------------------------------------------------------------
|
|
2078 |
//
|
|
2079 |
void CSwtTable::SetFontL(const MSwtFont* aFont)
|
|
2080 |
{
|
|
2081 |
ASwtControlBase::DoSetFontL(aFont);
|
|
2082 |
|
|
2083 |
if (aFont)
|
|
2084 |
{
|
|
2085 |
iHeader->SetFont(&(aFont->Font()));
|
|
2086 |
}
|
|
2087 |
else
|
|
2088 |
{
|
|
2089 |
iHeader->SetFont(&DefaultFont().Font());
|
|
2090 |
}
|
|
2091 |
|
|
2092 |
TInt fontHeight(0);
|
|
2093 |
if (aFont)
|
|
2094 |
{
|
|
2095 |
fontHeight = aFont->Font().FontMaxHeight();
|
|
2096 |
}
|
|
2097 |
else
|
|
2098 |
{
|
|
2099 |
fontHeight = DefaultFont().Font().FontMaxHeight();
|
|
2100 |
}
|
|
2101 |
UpdateItemHeight(fontHeight);
|
|
2102 |
|
|
2103 |
// In case the header height changed
|
|
2104 |
if (GetHeaderVisible())
|
|
2105 |
{
|
|
2106 |
LayoutTable();
|
|
2107 |
}
|
|
2108 |
|
|
2109 |
if (ListMode())
|
|
2110 |
{
|
|
2111 |
PackColumn(0);
|
|
2112 |
}
|
|
2113 |
|
|
2114 |
Redraw();
|
|
2115 |
}
|
|
2116 |
|
|
2117 |
// ---------------------------------------------------------------------------
|
|
2118 |
// From MSwtControl
|
|
2119 |
// ---------------------------------------------------------------------------
|
|
2120 |
//
|
|
2121 |
TBool CSwtTable::IsKeyUsed(TUint aKeyCode) const
|
|
2122 |
{
|
|
2123 |
// Table doesn't use the Backspace but uses the OK key
|
|
2124 |
if (aKeyCode == EKeyBackspace)
|
|
2125 |
{
|
|
2126 |
return EFalse;
|
|
2127 |
}
|
|
2128 |
else if (aKeyCode == EKeyOK)
|
|
2129 |
{
|
|
2130 |
if (iStyle & KSwtStyleSingle && !(iStyle & KSwtStyleMulti || iStyle & KSwtStyleCheck))
|
|
2131 |
{
|
|
2132 |
MSwtCommandArranger* commandArranger = iDisplay.CommandArranger();
|
|
2133 |
if (commandArranger) // From MobileExtensions
|
|
2134 |
{
|
|
2135 |
if (commandArranger->IsContextSensitiveOperationSet())
|
|
2136 |
{
|
|
2137 |
return EFalse;
|
|
2138 |
}
|
|
2139 |
}
|
|
2140 |
return ETrue;
|
|
2141 |
}
|
|
2142 |
else
|
|
2143 |
{
|
|
2144 |
return ETrue;
|
|
2145 |
}
|
|
2146 |
}
|
|
2147 |
return ETrue;
|
|
2148 |
}
|
|
2149 |
|
|
2150 |
|
|
2151 |
TBool CSwtTable::MSKSelCmdEnabled() const
|
|
2152 |
{
|
|
2153 |
return ETrue;
|
|
2154 |
}
|
|
2155 |
|
|
2156 |
|
|
2157 |
// ---------------------------------------------------------------------------
|
|
2158 |
// From MSwtControl
|
|
2159 |
// ---------------------------------------------------------------------------
|
|
2160 |
//
|
|
2161 |
void CSwtTable::UpdateDoNotDrawFlag()
|
|
2162 |
{
|
|
2163 |
ASwtControlBase::UpdateDoNotDrawFlag();
|
|
2164 |
|
|
2165 |
// Scrollbar/MSK update might have been skipped during the time the draw
|
|
2166 |
// flag has been set so it has to be done here.
|
|
2167 |
TRAP_IGNORE
|
|
2168 |
(
|
|
2169 |
iTableListBox->UpdateScrollBarsL();
|
|
2170 |
UpdateMSKLabelL();
|
|
2171 |
);
|
|
2172 |
}
|
|
2173 |
|
|
2174 |
#ifdef RD_JAVA_S60_RELEASE_9_2
|
|
2175 |
// ---------------------------------------------------------------------------
|
|
2176 |
// CSwtTable::EnableFocusHighlight
|
|
2177 |
// From MSwtControl
|
|
2178 |
// ---------------------------------------------------------------------------
|
|
2179 |
//
|
|
2180 |
void CSwtTable::EnableFocusHighlight(TBool aEnable)
|
|
2181 |
{
|
|
2182 |
ASSERT(iTableListBox);
|
|
2183 |
ASSERT(iTableListBox->View());
|
|
2184 |
|
|
2185 |
CListItemDrawer* itemDrawer = iTableListBox->View()->ItemDrawer();
|
|
2186 |
if (itemDrawer)
|
|
2187 |
{
|
|
2188 |
TInt disabledHighlight =
|
|
2189 |
itemDrawer->Flags() & CListItemDrawer::EDisableHighlight;
|
|
2190 |
|
|
2191 |
if (aEnable && disabledHighlight)
|
|
2192 |
{
|
|
2193 |
itemDrawer->ClearFlags(CListItemDrawer::EDisableHighlight);
|
|
2194 |
}
|
|
2195 |
else if (!aEnable && !disabledHighlight)
|
|
2196 |
{
|
|
2197 |
itemDrawer->SetFlags(CListItemDrawer::EDisableHighlight);
|
|
2198 |
}
|
|
2199 |
}
|
|
2200 |
}
|
|
2201 |
#endif //RD_JAVA_S60_RELEASE_9_2
|
|
2202 |
|
|
2203 |
|
|
2204 |
// ---------------------------------------------------------------------------
|
|
2205 |
// From ASwtScrollableBase
|
|
2206 |
// Scrollbar frame is created and owned by the listbox component.
|
|
2207 |
// ---------------------------------------------------------------------------
|
|
2208 |
//
|
|
2209 |
CEikScrollBarFrame* CSwtTable::SbFrame() const
|
|
2210 |
{
|
|
2211 |
return iTableListBox->ScrollBarFrame();
|
|
2212 |
}
|
|
2213 |
|
|
2214 |
|
|
2215 |
// ---------------------------------------------------------------------------
|
|
2216 |
// From ASwtScrollableBase
|
|
2217 |
// ---------------------------------------------------------------------------
|
|
2218 |
//
|
|
2219 |
TRect CSwtTable::SbInnerRect(const TRect& aRect) const
|
|
2220 |
{
|
|
2221 |
return ASwtScrollableBase::SbInnerRect(aRect);
|
|
2222 |
}
|
|
2223 |
|
|
2224 |
|
|
2225 |
// ---------------------------------------------------------------------------
|
|
2226 |
// From ASwtScrollableBase
|
|
2227 |
// ---------------------------------------------------------------------------
|
|
2228 |
//
|
|
2229 |
TRect CSwtTable::SbOuterRect(const TRect& aRect) const
|
|
2230 |
{
|
|
2231 |
return ASwtScrollableBase::SbOuterRect(aRect);
|
|
2232 |
}
|
|
2233 |
|
|
2234 |
|
|
2235 |
// ---------------------------------------------------------------------------
|
|
2236 |
// From ASwtScrollableBase
|
|
2237 |
// ---------------------------------------------------------------------------
|
|
2238 |
//
|
|
2239 |
void CSwtTable::ComputeTrim(TRect& aRect) const
|
|
2240 |
{
|
|
2241 |
aRect = SbOuterRect(aRect);
|
|
2242 |
aRect.iTl.iY -= GetHeaderHeight();
|
|
2243 |
TInt borderWidth = GetBorderWidth();
|
|
2244 |
aRect.Grow(borderWidth, borderWidth);
|
|
2245 |
}
|
|
2246 |
|
|
2247 |
|
|
2248 |
// ---------------------------------------------------------------------------
|
|
2249 |
// From ASwtScrollableBase (MEikScrollBarObserver)
|
|
2250 |
// Listbox needs to react to scrolling events. Listbox's view will always
|
|
2251 |
// inform also the column header component of changes in the horizontal
|
|
2252 |
// scrolling offset. Base class implementation takes care of the scrollbar
|
|
2253 |
// selection events.
|
|
2254 |
// ---------------------------------------------------------------------------
|
|
2255 |
//
|
|
2256 |
void CSwtTable::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType)
|
|
2257 |
{
|
|
2258 |
// On 5.0, drawing trough Java gives simply a better fps.
|
|
2259 |
#ifdef RD_JAVA_S60_RELEASE_9_2
|
|
2260 |
switch (aEventType)
|
|
2261 |
{
|
|
2262 |
case EEikScrollThumbDragHoriz:
|
|
2263 |
case EEikScrollThumbDragVert:
|
|
2264 |
GetShell().SetUrgentPaintControl(this);
|
|
2265 |
break;
|
|
2266 |
case EEikScrollThumbReleaseHoriz:
|
|
2267 |
case EEikScrollThumbReleaseVert:
|
|
2268 |
GetShell().SetUrgentPaintControl(NULL);
|
|
2269 |
break;
|
|
2270 |
default:
|
|
2271 |
break;
|
|
2272 |
}
|
|
2273 |
#endif // RD_JAVA_S60_RELEASE_9_2
|
|
2274 |
|
|
2275 |
iTableListBox->HandleScrollEventL(aScrollBar, aEventType);
|
|
2276 |
ASwtScrollableBase::HandleScrollEventL(aScrollBar, aEventType);
|
|
2277 |
}
|
|
2278 |
|
|
2279 |
|
|
2280 |
// ---------------------------------------------------------------------------
|
|
2281 |
// From CSwtComposite
|
|
2282 |
// ---------------------------------------------------------------------------
|
|
2283 |
//
|
|
2284 |
void CSwtTable::RegisterChildL(MSwtControl& aChild)
|
|
2285 |
{
|
|
2286 |
TBool oldFocusability(IsNonFocusing());
|
|
2287 |
|
|
2288 |
CSwtComposite::RegisterChildL(aChild);
|
|
2289 |
|
|
2290 |
// If it was focusable but is not anymore after adding the child
|
|
2291 |
if (IsNonFocusing() != oldFocusability && !oldFocusability)
|
|
2292 |
{
|
|
2293 |
// Table is different from normal Composite in that it remains
|
|
2294 |
// focusable even when it has children. Note that it briefly loses
|
|
2295 |
// focus when children are being added and then takes it back here.
|
|
2296 |
// Thus, the focus may move to the newly added child. This is the
|
|
2297 |
// desired behavior.
|
|
2298 |
SetFocusing(ETrue);
|
|
2299 |
FocusabilityChanged();
|
|
2300 |
}
|
|
2301 |
}
|
|
2302 |
|
|
2303 |
// ---------------------------------------------------------------------------
|
|
2304 |
// From MCoeControlObserver
|
|
2305 |
// ---------------------------------------------------------------------------
|
|
2306 |
//
|
|
2307 |
void CSwtTable::HandleControlEventL(CCoeControl* /*aControl*/, TCoeEvent aEventType)
|
|
2308 |
{
|
|
2309 |
// This handles MSK label updates when any input device was used
|
|
2310 |
// to change the state.
|
|
2311 |
if (aEventType == EEventStateChanged)
|
|
2312 |
{
|
|
2313 |
UpdateMSKLabelL();
|
|
2314 |
}
|
|
2315 |
}
|
|
2316 |
|
|
2317 |
// ---------------------------------------------------------------------------
|
|
2318 |
// From ASwtControlBase
|
|
2319 |
// ---------------------------------------------------------------------------
|
|
2320 |
//
|
|
2321 |
const MSwtFont& CSwtTable::DefaultFont() const
|
|
2322 |
{
|
|
2323 |
return iTableListBox->GetDefaultFont();
|
|
2324 |
}
|
|
2325 |
|
|
2326 |
|
|
2327 |
// ---------------------------------------------------------------------------
|
|
2328 |
// From ASwtControlbase
|
|
2329 |
// ---------------------------------------------------------------------------
|
|
2330 |
//
|
|
2331 |
HBufC* CSwtTable::MSKLabelL() const
|
|
2332 |
{
|
|
2333 |
if (!(GetItemCount() > 0))
|
|
2334 |
{
|
|
2335 |
return ASwtControlBase::MSKLabelL();
|
|
2336 |
}
|
|
2337 |
|
|
2338 |
if (!(iStyle & KSwtStyleMulti || iStyle & KSwtStyleCheck))
|
|
2339 |
{
|
|
2340 |
HBufC* label = iEikonEnv->AllocReadResourceL(R_QTN_MSK_SELECT);
|
|
2341 |
return label;
|
|
2342 |
}
|
|
2343 |
|
|
2344 |
TBool marked = EFalse;
|
|
2345 |
if (iStyle & KSwtStyleMulti)
|
|
2346 |
{
|
|
2347 |
marked = IsSelected(iTableListBox->View()->CurrentItemIndex());
|
|
2348 |
}
|
|
2349 |
else // KSwtStyleCheck
|
|
2350 |
{
|
|
2351 |
marked = IsChecked(iTableListBox->View()->CurrentItemIndex());
|
|
2352 |
}
|
|
2353 |
|
|
2354 |
if (iStyle & KSwtStyleMulti || iStyle & KSwtStyleCheck)
|
|
2355 |
{
|
|
2356 |
HBufC* label = NULL;
|
|
2357 |
if (marked)
|
|
2358 |
{
|
|
2359 |
label = iEikonEnv->AllocReadResourceL(R_QTN_MSK_UNMARK);
|
|
2360 |
}
|
|
2361 |
else
|
|
2362 |
{
|
|
2363 |
label = iEikonEnv->AllocReadResourceL(R_QTN_MSK_MARK);
|
|
2364 |
}
|
|
2365 |
return label;
|
|
2366 |
}
|
|
2367 |
return ASwtControlBase::MSKLabelL();
|
|
2368 |
}
|
|
2369 |
|
|
2370 |
|
|
2371 |
// ---------------------------------------------------------------------------
|
|
2372 |
// The constructor.
|
|
2373 |
// ---------------------------------------------------------------------------
|
|
2374 |
//
|
|
2375 |
CSwtTable::CSwtTable(MSwtDisplay& aDisplay, TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle)
|
|
2376 |
: CSwtComposite(aDisplay, aPeer, &aParent, aStyle,
|
|
2377 |
aParent.Control()->CoeControl().IsVisible(),
|
|
2378 |
aParent.Control()->CoeControl().IsDimmed()),
|
|
2379 |
iHeaderVisible(EFalse),
|
|
2380 |
iLinesVisible(EFalse)
|
|
2381 |
{
|
|
2382 |
}
|
|
2383 |
|
|
2384 |
|
|
2385 |
// ---------------------------------------------------------------------------
|
|
2386 |
// 2nd phase constructor.
|
|
2387 |
// ---------------------------------------------------------------------------
|
|
2388 |
//
|
|
2389 |
void CSwtTable::ConstructL()
|
|
2390 |
{
|
|
2391 |
CCoeControl& coeParent = iParent->Control()->CoeControl();
|
|
2392 |
|
|
2393 |
SetContainerWindowL(coeParent);
|
|
2394 |
|
|
2395 |
CCoeControl::MakeVisible(coeParent.IsVisible());
|
|
2396 |
CCoeControl::SetDimmed(coeParent.IsDimmed());
|
|
2397 |
SetComponentsToInheritVisibility(ETrue);
|
|
2398 |
|
|
2399 |
LoadLayouts();
|
|
2400 |
LoadGraphicsL();
|
|
2401 |
|
|
2402 |
// Create component controls
|
|
2403 |
iTableListBox = CSwtTableListBox::NewL(iDisplay, *this);
|
|
2404 |
iTableListBox->SetObserver(this);
|
|
2405 |
iHeader = CSwtTableHeader::NewL(*this);
|
|
2406 |
|
|
2407 |
iHeader->SetFont(&DefaultFont().Font());
|
|
2408 |
|
|
2409 |
const MSwtDevice& device = iDisplay.Device();
|
|
2410 |
|
|
2411 |
// Create a dummy column
|
|
2412 |
User::LeaveIfError(iColumnWidths.Insert(0, 0));
|
|
2413 |
User::LeaveIfError(iColumnAlignments.Insert(CGraphicsContext::ELeft, 0));
|
|
2414 |
User::LeaveIfError(iColumnImagesCounts.Insert(0, 0));
|
|
2415 |
iHeader->InsertNewColumnL(0);
|
|
2416 |
|
|
2417 |
UpdateItemHeight(GetFont()->Font().FontMaxHeight());
|
|
2418 |
|
|
2419 |
iOldSelectionArray = new(ELeave) CArrayFixFlat<TInt>(2);
|
|
2420 |
|
|
2421 |
ActivateL();
|
|
2422 |
}
|
|
2423 |
|
|
2424 |
|
|
2425 |
TInt CSwtTable::GetFocusIndex() const
|
|
2426 |
{
|
|
2427 |
if (iTableListBox->Model()->NumberOfItems() == 0)
|
|
2428 |
{
|
|
2429 |
return -1;
|
|
2430 |
}
|
|
2431 |
return iTableListBox->CurrentItemIndex();
|
|
2432 |
}
|
|
2433 |
|
|
2434 |
|
|
2435 |
void CSwtTable::LayoutTable()
|
|
2436 |
{
|
|
2437 |
const TRect tableRect(BorderInnerRect());
|
|
2438 |
const TPoint tableLocation(tableRect.iTl);
|
|
2439 |
|
|
2440 |
TSize headerSize(tableRect.Width(), GetHeaderHeight());
|
|
2441 |
iHeader->SetRect(GetHeaderRect());
|
|
2442 |
|
|
2443 |
iTableListBox->SetPosition(
|
|
2444 |
TPoint(tableLocation.iX, tableLocation.iY + headerSize.iHeight));
|
|
2445 |
iTableListBox->SetSize(
|
|
2446 |
TSize(tableRect.Width(), tableRect.Height() - headerSize.iHeight));
|
|
2447 |
|
|
2448 |
if (ListMode())
|
|
2449 |
{
|
|
2450 |
PackColumn(0);
|
|
2451 |
}
|
|
2452 |
}
|
|
2453 |
|
|
2454 |
|
|
2455 |
// ---------------------------------------------------------------------------
|
|
2456 |
// Leaving version of HandleResourceChange.
|
|
2457 |
// ---------------------------------------------------------------------------
|
|
2458 |
//
|
|
2459 |
void CSwtTable::HandleResourceChangeL(TInt aType)
|
|
2460 |
{
|
|
2461 |
if (aType == KEikDynamicLayoutVariantSwitch || aType == KAknsMessageSkinChange)
|
|
2462 |
{
|
|
2463 |
LoadLayouts();
|
|
2464 |
LoadGraphicsL();
|
|
2465 |
if (iHeader)
|
|
2466 |
{
|
|
2467 |
// Column locations might have changed because the checkbox graphic
|
|
2468 |
// size might have changed. There might be a need to make the header
|
|
2469 |
// of the leading column at index 0 wider/narrower.
|
|
2470 |
iHeader->UpdateColumnWidth(0, GetColumnWidth(0));
|
|
2471 |
}
|
|
2472 |
}
|
|
2473 |
CCoeControl::HandleResourceChange(aType);
|
|
2474 |
}
|
|
2475 |
|
|
2476 |
|
|
2477 |
// ---------------------------------------------------------------------------
|
|
2478 |
// Loading of the scaled layout data.
|
|
2479 |
// ---------------------------------------------------------------------------
|
|
2480 |
//
|
|
2481 |
void CSwtTable::LoadLayouts()
|
|
2482 |
{
|
|
2483 |
// The margins for the current item highlight frame graphic
|
|
2484 |
TRect dummyRect(0, 0, 100, 100); // values here are insignificant
|
|
2485 |
|
|
2486 |
TAknLayoutRect topLeft = CSwtLafFacade::GetLayoutRect(
|
|
2487 |
CSwtLafFacade::EListHighlightSkinPlacingGeneralLine2, dummyRect);
|
|
2488 |
|
|
2489 |
TAknLayoutRect bottomRight = CSwtLafFacade::GetLayoutRect(
|
|
2490 |
CSwtLafFacade::EListHighlightSkinPlacingGeneralLine5, dummyRect);
|
|
2491 |
|
|
2492 |
TRect outerRect(topLeft.Rect().iTl, bottomRight.Rect().iBr);
|
|
2493 |
TRect innerRect(topLeft.Rect().iBr, bottomRight.Rect().iTl);
|
|
2494 |
|
|
2495 |
iHighlightTopBottomMargin = innerRect.iTl.iX - outerRect.iTl.iX;
|
|
2496 |
iHighlightLeftRightMargin = outerRect.iBr.iY - innerRect.iBr.iY;
|
|
2497 |
|
|
2498 |
// The frame area is very wide so we draw vertically 50% over
|
|
2499 |
// the frame to make the table more compact.
|
|
2500 |
iHighlightTopBottomMargin /= 2;
|
|
2501 |
|
|
2502 |
// The check box size
|
|
2503 |
iCheckBoxSize = CSwtLafFacade::GetLayoutRect(
|
|
2504 |
CSwtLafFacade::EListSingleGraphicPaneG1, dummyRect, 0).Rect().Size();
|
|
2505 |
|
|
2506 |
// Grid line width
|
|
2507 |
iGridLineWidth = CSwtLafFacade::GetLayoutRect(
|
|
2508 |
CSwtLafFacade::EEswtControlPaneG1, dummyRect, 0).Rect().Height();
|
|
2509 |
}
|
|
2510 |
|
|
2511 |
|
|
2512 |
// ---------------------------------------------------------------------------
|
|
2513 |
// Loading of the scaled & skinned graphic data.
|
|
2514 |
// ---------------------------------------------------------------------------
|
|
2515 |
//
|
|
2516 |
void CSwtTable::LoadGraphicsL()
|
|
2517 |
{
|
|
2518 |
// The checkbox graphics
|
|
2519 |
delete iCheckBoxOnBitmap;
|
|
2520 |
delete iCheckBoxOnMask;
|
|
2521 |
delete iCheckBoxOffBitmap;
|
|
2522 |
delete iCheckBoxOffMask;
|
|
2523 |
iCheckBoxOnBitmap = NULL;
|
|
2524 |
iCheckBoxOnMask = NULL;
|
|
2525 |
iCheckBoxOffBitmap = NULL;
|
|
2526 |
iCheckBoxOffMask = NULL;
|
|
2527 |
|
|
2528 |
CFbsBitmap* bmp = NULL;
|
|
2529 |
CFbsBitmap* mask = NULL;
|
|
2530 |
AknsUtils::CreateIconLC(AknsUtils::SkinInstance(),
|
|
2531 |
KAknsIIDQgnPropCheckboxOn, bmp, mask,
|
|
2532 |
AknIconUtils::AvkonIconFileName(),
|
|
2533 |
EMbmAvkonQgn_prop_checkbox_on,
|
|
2534 |
EMbmAvkonQgn_prop_checkbox_on_mask);
|
|
2535 |
AknIconUtils::SetSize(bmp,
|
|
2536 |
iCheckBoxSize,
|
|
2537 |
EAspectRatioPreservedAndUnusedSpaceRemoved);
|
|
2538 |
AknIconUtils::SetSize(mask,
|
|
2539 |
iCheckBoxSize,
|
|
2540 |
EAspectRatioPreservedAndUnusedSpaceRemoved);
|
|
2541 |
CleanupStack::Pop(2); // bmp, mask
|
|
2542 |
iCheckBoxOnBitmap = bmp;
|
|
2543 |
iCheckBoxOnMask = mask;
|
|
2544 |
|
|
2545 |
bmp = NULL;
|
|
2546 |
mask = NULL;
|
|
2547 |
AknsUtils::CreateIconLC(AknsUtils::SkinInstance(),
|
|
2548 |
KAknsIIDQgnPropCheckboxOff, bmp, mask,
|
|
2549 |
AknIconUtils::AvkonIconFileName(),
|
|
2550 |
EMbmAvkonQgn_prop_checkbox_off,
|
|
2551 |
EMbmAvkonQgn_prop_checkbox_off_mask);
|
|
2552 |
AknIconUtils::SetSize(bmp,
|
|
2553 |
iCheckBoxSize,
|
|
2554 |
EAspectRatioPreservedAndUnusedSpaceRemoved);
|
|
2555 |
AknIconUtils::SetSize(mask,
|
|
2556 |
iCheckBoxSize,
|
|
2557 |
EAspectRatioPreservedAndUnusedSpaceRemoved);
|
|
2558 |
CleanupStack::Pop(2); // bmp, mask
|
|
2559 |
|
|
2560 |
iCheckBoxOffBitmap = bmp;
|
|
2561 |
iCheckBoxOffMask = mask;
|
|
2562 |
|
|
2563 |
// The colors
|
|
2564 |
TRgb skinTextColor(KRgbBlack);
|
|
2565 |
AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
|
|
2566 |
skinTextColor,
|
|
2567 |
KAknsIIDQsnTextColors,
|
|
2568 |
EAknsCIQsnTextColorsCG9);
|
|
2569 |
iTableDefaultForeground = skinTextColor;
|
|
2570 |
TRgb highlightTextColor(KRgbBlack);
|
|
2571 |
AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
|
|
2572 |
highlightTextColor,
|
|
2573 |
KAknsIIDQsnTextColors,
|
|
2574 |
EAknsCIQsnTextColorsCG10);
|
|
2575 |
iTableDefaultHighlightText = highlightTextColor;
|
|
2576 |
}
|
|
2577 |
|
|
2578 |
|
|
2579 |
// ---------------------------------------------------------------------------
|
|
2580 |
// Updates the selection indexes of items starting from the given index.
|
|
2581 |
// Selected item indexes after the given index are decremented or incremented
|
|
2582 |
// depending on if items have been added or removed.
|
|
2583 |
// ---------------------------------------------------------------------------
|
|
2584 |
//
|
|
2585 |
void CSwtTable::UpdateSelectionIndexesL(const TInt& aStart,
|
|
2586 |
const TInt& aEnd,
|
|
2587 |
CArrayFix<TInt>* aSelectionArray,
|
|
2588 |
const TBool& aItemsAdded)
|
|
2589 |
{
|
|
2590 |
TInt numberOfItemsInRange = aEnd - aStart + 1;
|
|
2591 |
if (!(numberOfItemsInRange > 0) || !aSelectionArray || aSelectionArray->Count() == 0)
|
|
2592 |
{
|
|
2593 |
return;
|
|
2594 |
}
|
|
2595 |
|
|
2596 |
// Update the selection indexes
|
|
2597 |
TInt selectionCount = aSelectionArray->Count();
|
|
2598 |
for (TInt iOld = selectionCount - 1; iOld >= 0; --iOld)
|
|
2599 |
{
|
|
2600 |
// First delete the selection indexes for items that have been removed
|
|
2601 |
if (aItemsAdded == EFalse &&
|
|
2602 |
((*aSelectionArray)[iOld] >= aStart && (*aSelectionArray)[iOld] <= aEnd))
|
|
2603 |
{
|
|
2604 |
aSelectionArray->Delete(iOld);
|
|
2605 |
continue;
|
|
2606 |
}
|
|
2607 |
// Then update the affected selection indexes
|
|
2608 |
if ((*aSelectionArray)[iOld] >= aStart)
|
|
2609 |
{
|
|
2610 |
if (aItemsAdded)
|
|
2611 |
{
|
|
2612 |
((*aSelectionArray)[iOld]) += numberOfItemsInRange;
|
|
2613 |
}
|
|
2614 |
else // items were removed
|
|
2615 |
{
|
|
2616 |
((*aSelectionArray)[iOld]) -= numberOfItemsInRange;
|
|
2617 |
}
|
|
2618 |
}
|
|
2619 |
}
|
|
2620 |
// New updated selections to the control
|
|
2621 |
iTableListBox->TableView()->SetSelectionIndexesL(aSelectionArray);
|
|
2622 |
aSelectionArray->Reset();
|
|
2623 |
}
|
|
2624 |
|
|
2625 |
|
|
2626 |
void CSwtTable::UpdateMSKLabelL()
|
|
2627 |
{
|
|
2628 |
if (AknLayoutUtils::MSKEnabled() && !HasDoNotDrawFlag())
|
|
2629 |
{
|
|
2630 |
MSwtCommandArranger* commandArranger = iDisplay.CommandArranger();
|
|
2631 |
if (commandArranger)
|
|
2632 |
{
|
|
2633 |
commandArranger->UpdateMSKLabelL();
|
|
2634 |
}
|
|
2635 |
}
|
|
2636 |
}
|