examples/ForumNokia/TZLocalizer/src/TZLocalizerDialog.cpp

00001 /*
00002  * Copyright © 2008 Nokia Corporation.
00003  */
00004 
00005 // INCLUDE FILES
00006 #include    "TZLocalizerDialog.h"
00007 
00008 #include <avkon.hrh>
00009 #include <aknappui.h>
00010 
00011 #include "TZLocalizer.hrh"
00012 
00013 // ================= MEMBER FUNCTIONS =======================
00014 
00015 
00016 // Destructor
00017 CTZLocalizerDialog::~CTZLocalizerDialog()
00018     {
00019     }
00020 
00021 // ---------------------------------------------------------
00022 // CTZLocalizerDialog::OkToExitL(TInt aButtonId)
00023 // called by framework when the OK button is pressed
00024 // ---------------------------------------------------------
00025 TBool CTZLocalizerDialog::OkToExitL(TInt aButtonId)
00026 {
00027     if ( aButtonId == EAknSoftkeyOptions )
00028         {
00029         iAvkonAppUi->ProcessCommandL( EAknSoftkeyOptions );
00030         }
00031     else if ( aButtonId == EAknSoftkeyExit )
00032         {
00033         iAvkonAppUi->ProcessCommandL( EEikCmdExit );
00034         }
00035     
00036     return EFalse;
00037 }
00038 
00039 // ---------------------------------------------------------
00040 // CTZLocalizerDialog::PreLayoutDynInitL();
00041 // called by framework before dialog is shown 
00042 // ---------------------------------------------------------
00043 void CTZLocalizerDialog::PreLayoutDynInitL()
00044     {
00045     CEikDialog::PreLayoutDynInitL();
00046     SetEditableL(ETrue);    
00047     }
00048 
00049 void CTZLocalizerDialog::SetSizeAndPosition(const TSize& /*aSize*/)
00050     {
00051     TRect rect;
00052     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane,rect);
00053     CEikDialog::SetSizeAndPosition(rect.Size());
00054     SetRect(rect);
00055     }
00056 
00057 // ---------------------------------------------------------
00058 // CTZLocalizerDialog::SetListBoxText();
00059 // Set the main dialog listbox texts to aArray 
00060 // ---------------------------------------------------------
00061 void CTZLocalizerDialog::SetListBoxTextL( CDesC16ArrayFlat* aArray )
00062     {
00063     CEikTextListBox* listBox = 
00064         static_cast <CEikTextListBox*>(ControlOrNull(ETZLocalizerDlgList));
00065 
00066     CDesCArray* listArray = 
00067         static_cast<CDesCArray*>(listBox->Model()->ItemTextArray());
00068     
00069     listBox->CreateScrollBarFrameL(ETrue);
00070     listBox->ScrollBarFrame()->SetScrollBarVisibilityL(
00071         CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );
00072     
00073     listArray->Reset();
00074 
00075     for( TInt c = 0; c < aArray->Count(); c++ )
00076         {
00077         listArray->AppendL( (*aArray)[c] );
00078         }
00079 
00080     listBox->HandleItemAdditionL();
00081     listBox->SetCurrentItemIndexAndDraw( 0 );
00082     }
00083 
00084 // End of File
00085 

Generated by  doxygen 1.6.2