343 |
343 |
344 linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_3p_pane_g3(0).LayoutLine(); |
344 linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_3p_pane_g3(0).LayoutLine(); |
345 layoutrect.LayoutRect( pic3paneRect.Rect(), linelayout ); |
345 layoutrect.LayoutRect( pic3paneRect.Rect(), linelayout ); |
346 pic3pRightWidth = layoutrect.Rect().Width(); |
346 pic3pRightWidth = layoutrect.Rect().Width(); |
347 |
347 |
348 linelayout = AknLayoutScalable_Avkon::aid_vkbss_key_offset(v1).LayoutLine(); |
|
349 layoutrect.LayoutRect( keypadRect.Rect(), linelayout ); |
|
350 TInt rowIndentWidth = layoutrect.Rect().Width(); |
|
351 |
|
352 base = rectMainWin.iTl; |
348 base = rectMainWin.iTl; |
353 |
349 |
354 data->iClientRect = RelativeRect( rectMainWin, base ); |
350 data->iClientRect = RelativeRect( rectMainWin, base ); |
355 data->iQwtRect = rectMainWin; //screen coord-sys ? |
351 data->iQwtRect = rectMainWin; //screen coord-sys ? |
356 |
352 |
357 TRect rectOfKeypad = RelativeRect( keypadRect.Rect(), base ); |
353 TRect rectOfKeypad = RelativeRect( keypadRect.Rect(), base ); |
358 TRect rectOfButtons = rectOfKeypad; |
354 TRect rectOfButtons = rectOfKeypad; |
359 rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); |
355 |
360 rectOfButtons.iTl.iY += rectOfKeypad.Height(); |
356 TInt rowNumberOfKeyboard; |
|
357 TInt gapValue; |
|
358 switch ( aLayoutType ) |
|
359 { |
|
360 case ELayout10x3: |
|
361 { |
|
362 rowNumberOfKeyboard = 3; |
|
363 break; |
|
364 } |
|
365 case ELayout11x3: |
|
366 { |
|
367 rowNumberOfKeyboard = 3; |
|
368 break; |
|
369 } |
|
370 case ELayout11x4: |
|
371 { |
|
372 rowNumberOfKeyboard = 4; |
|
373 break; |
|
374 } |
|
375 default: |
|
376 { |
|
377 rowNumberOfKeyboard = 3; |
|
378 break; |
|
379 } |
|
380 } |
|
381 |
|
382 // Compute the gap between first row key's top line and keyboard's top line |
|
383 gapValue = keypaneRect.Rect().iTl.iY - keypadRect.Rect().iTl.iY; |
|
384 // Compute function button's top left Y coordinate |
|
385 rectOfButtons.iTl.iY = rectOfButtons.iTl.iY + |
|
386 keypaneRect.Rect().Height() * rowNumberOfKeyboard + gapValue; |
|
387 |
|
388 // Compute keyboard position |
|
389 rectOfKeypad.iBr.iY = rectOfKeypad.iTl.iY + |
|
390 keypaneRect.Rect().Height() * rowNumberOfKeyboard + gapValue; |
|
391 rectOfKeypad.iTl.iY += gapValue; |
361 |
392 |
362 //keypad |
393 //keypad |
363 data->iKeypad.iKaypadRect = rectOfKeypad; |
394 data->iKeypad.iKaypadRect = rectOfKeypad; |
364 data->iKeypad.iTextLayout = keyText; |
395 data->iKeypad.iTextLayout = keyText; |
365 data->iKeypad.iFont = AknLayoutUtils::FontFromId( keyText.iFont, NULL ); |
396 data->iKeypad.iFont = AknLayoutUtils::FontFromId( keyText.iFont, NULL ); |
373 rectXBorder.Move( - rectOfKeypad.iTl ); |
404 rectXBorder.Move( - rectOfKeypad.iTl ); |
374 rectXInner.Move( - rectOfKeypad.iTl ); |
405 rectXInner.Move( - rectOfKeypad.iTl ); |
375 |
406 |
376 for ( TInt i = 0; i < aRows; i++ ) |
407 for ( TInt i = 0; i < aRows; i++ ) |
377 { |
408 { |
378 TInt indent = ( i % 2 == 1 ) ? rowIndentWidth : 0; |
|
379 for ( TInt j = 0; j < aCols; j++ ) |
409 for ( TInt j = 0; j < aCols; j++ ) |
380 { |
410 { |
381 TRect bound = rectXPane; |
411 TRect bound = rectXPane; |
382 bound.Move( j * rectXPane.Width(), i * rectXPane.Height() ); |
412 bound.Move( j * rectXPane.Width(), i * rectXPane.Height() ); |
383 bound.Move( indent, 0 ); |
|
384 |
413 |
385 data->iKeypad.iRects.AppendL( bound ); |
414 data->iKeypad.iRects.AppendL( bound ); |
386 |
415 |
387 TRect inner = rectXPane; |
416 TRect inner = rectXPane; |
388 inner.Move( j * rectXPane.Width(), i * rectXPane.Height() ); |
417 inner.Move( j * rectXPane.Width(), i * rectXPane.Height() ); |
389 inner.Move( indent, 0 ); |
|
390 |
418 |
391 TAknLayoutText keyTextLayout; |
419 TAknLayoutText keyTextLayout; |
392 keyTextLayout.LayoutText( inner, keyText ); |
420 keyTextLayout.LayoutText( inner, keyText ); |
393 data->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() ); |
421 data->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() ); |
394 } |
422 } |
396 |
424 |
397 //buttons |
425 //buttons |
398 |
426 |
399 //all template rects are relative to TL of buttons row |
427 //all template rects are relative to TL of buttons row |
400 rectXPane = keypaneRect.Rect(); |
428 rectXPane = keypaneRect.Rect(); |
401 rectXBorder = RelativeRect( keycellRect.Rect(), rectXPane.iTl ); |
429 |
|
430 // The key rect without gap |
|
431 rectXBorder = RelativeRect( keypaneRect.Rect(), rectXPane.iTl ); |
|
432 |
402 rectXInner = RelativeRect( keylabelRect.Rect(), rectXPane.iTl ); |
433 rectXInner = RelativeRect( keylabelRect.Rect(), rectXPane.iTl ); |
403 TRect rect3PicPane = RelativeRect( pic3paneRect.Rect(), rectXPane.iTl ); |
434 TRect rect3PicPane = RelativeRect( pic3paneRect.Rect(), rectXPane.iTl ); |
404 rectXPane.Move( - rectXPane.iTl ); |
435 rectXPane.Move( - rectXPane.iTl ); |
405 |
436 |
406 TInt spaceBtnWidth = rectOfButtons.Width() - rectXPane.Width() * 8; |
437 TInt spaceBtnWidth = rectOfButtons.Width() - rectXPane.Width() * 8; |