This page was last modified 11:19, 16 April 2008.
TSS000880 - Setting an image for a softkey
From Forum Nokia Wiki
| ID | TSS000880 | Creation date | April 4, 2008 |
| Platform | S60 3rd Edition, FP2 | Devices | Nokia N96, Nokia N78 |
| Category | Symbian C++ | Subcategory | UI |
Description
The Command Button Array (CBA) is located at the bottom of the screen in S60 devices (in portrait mode). The following code snippet demonstrates how to set an image for the left and right softkeys.
#include <eikbtgpc.h> #include <eikcba.h> // link against avkon.lib, eikcoctl.lib void SetCbaImage( CEikButtonGroupContainer* aBtGrC, CEikImage& aImage, TBool aLSK ) { TInt cmdPos = aLSK ? 0 : 2; TInt cmdId = aBtGrC->ButtonGroup()->CommandId( cmdPos ); CEikCbaButton* button = (CEikCbaButton*)aBtGrC->ControlOrNull( cmdId ); if( button ) { button->SetImage(aImage); aBtGrC->SetRect( aBtGrC->Rect() ); aBtGrC->DrawNow(); } }
Using SetCbaImage():
_LIT(KCBAImageMBMFilename, "c:\\data\\images\\testimage.mbm"); TFileName mbmFile(KCBAImageMBMFilename); cba = CEikButtonGroupContainer::Current(); if(cba) { image = new (ELeave) CEikImage; CleanupStack::PushL( image ); image->CreatePictureFromFileL( mbmFile, EMbmEnumLSKImage ); image->SetBrushStyle(CGraphicsContext::ESolidBrush); CleanupStack::Pop( image ); // Set image for LSK (ETrue as 3rd parameter) // Transfers ownership of image - do not delete yourself SetCbaImage( cba, *image, ETrue ); image->DrawNow(); }
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| J2ME: Series 60: Selection Lists | alexterzis | Mobile Java General | 1 | 2002-05-31 16:21 |
| Hide Softkey Labels | valentin_da_itiv | Symbian User Interface | 6 | 2004-02-13 15:08 |
| How to change/view/delete OMA settings in Nokia 6220 handset?? | man12345 | OMA DM/DS/CP | 4 | 2003-09-22 04:45 |
| Pausing a thread when the user leaves the MIDlet | Woody_FX | Mobile Java General | 15 | 2003-11-18 23:36 |
| Setting page. Resource question | VEIKKO99 | Symbian User Interface | 0 | 2002-09-04 09:15 |

