applicationinterworkingfw/ServiceHandler/src/AiwMenu.cpp
branchRCL_3
changeset 18 0aa5fbdfbc30
parent 0 2f259fa3e83a
child 55 aecbbf00d063
equal deleted inserted replaced
16:71dd06cfe933 18:0aa5fbdfbc30
    24 #include "AiwMenu.h"
    24 #include "AiwMenu.h"
    25 #include "AiwCommon.hrh"
    25 #include "AiwCommon.hrh"
    26 
    26 
    27 // This is needed for resource reading.
    27 // This is needed for resource reading.
    28 const TInt KCCMask(0x00000fff);
    28 const TInt KCCMask(0x00000fff);
    29 
    29 const TInt KNominalTextLength = 40;
    30 
    30 
    31 EXPORT_C CAiwMenuPane::CAiwMenuPane(CEikMenuPane& aMenuPane, TInt aBaseCmdId) 
    31 EXPORT_C CAiwMenuPane::CAiwMenuPane(CEikMenuPane& aMenuPane, TInt aBaseCmdId) 
    32 : iMenuPane(&aMenuPane), iBaseCmdId(aBaseCmdId)
    32 : iMenuPane(&aMenuPane), iBaseCmdId(aBaseCmdId)
    33     {
    33     {
    34     iNextCmdId = aBaseCmdId;
    34     iNextCmdId = aBaseCmdId;
    96     for (TInt i = 0; i < count; i++)
    96     for (TInt i = 0; i < count; i++)
    97         {
    97         {
    98         data.iCommandId = aReader.ReadInt32();
    98         data.iCommandId = aReader.ReadInt32();
    99         data.iCascadeId = aReader.ReadInt32();  
    99         data.iCascadeId = aReader.ReadInt32();  
   100         data.iFlags = aReader.ReadInt32();
   100         data.iFlags = aReader.ReadInt32();
   101         data.iText.Copy(aReader.ReadTPtrC());
   101         TPtrC text( aReader.ReadTPtrC() );
       
   102         data.iText.Copy( text.Ptr(), Min( KNominalTextLength, text.Length() ) );
   102         
   103         
   103         // Extra text (additional submenu text) must be handled separately
   104         // Extra text (additional submenu text) must be handled separately
   104         // because SData doesn't offer space for it.
   105         // because SData doesn't offer space for it.
   105         TPtrC extraText = aReader.ReadTPtrC();
   106         TPtrC extraText = aReader.ReadTPtrC();
   106         
   107         
   222     CEikMenuPaneItem::SData data;
   223     CEikMenuPaneItem::SData data;
   223     
   224     
   224     data.iCommandId = AIW_SUBMENU_TITLE;
   225     data.iCommandId = AIW_SUBMENU_TITLE;
   225     data.iCascadeId = 0;  
   226     data.iCascadeId = 0;  
   226     data.iFlags = 0;
   227     data.iFlags = 0;
   227     data.iText.Copy(aTitle);
   228     data.iText.Copy(aTitle.Ptr(),Min(KNominalTextLength,aTitle.Length()));
   228 
   229 
   229     iMenuPane->InsertMenuItemL(data, aIndex);       
   230     iMenuPane->InsertMenuItemL(data, aIndex);       
   230     }
   231     }
   231 
   232 
   232 
   233