00001
00002
00003 #include <avkon.hrh>
00004 #include <aknnotewrappers.h>
00005 #include <stringloader.h>
00006 #include <AOLabBubbleSort.rsg>
00007 #include <f32file.h>
00008 #include <s32file.h>
00009 #include "AOLabBubbleSortAppUi.h"
00010 #include "AOLabBubbleSortContainer.h"
00011 #include "AOLabBubbleSort.hrh"
00012
00013
00014
00015 void CAOLabBubbleSortAppUi::ConstructL()
00016 {
00017 BaseConstructL();
00018 iAppContainer = CAOLabBubbleSortContainer::NewL(ClientRect());
00019 }
00020
00021
00022
00023 CAOLabBubbleSortAppUi::CAOLabBubbleSortAppUi()
00024 {
00025
00026 }
00027
00028
00029
00030 CAOLabBubbleSortAppUi::~CAOLabBubbleSortAppUi()
00031 {
00032 delete iAppContainer;
00033 }
00034
00035
00036
00037
00038
00039
00040 void CAOLabBubbleSortAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
00041 {
00042 if (aResourceId == R_MENU)
00043 {
00044 if (iAppContainer->IsSorting())
00045 {
00046 aMenuPane->SetItemTextL(ECommandSort, R_COMMAND_CANCELSORTING);
00047 }
00048 else
00049 {
00050 aMenuPane->SetItemTextL(ECommandSort,R_COMMAND_STARTSORTING);
00051 }
00052 }
00053 }
00054
00055
00056
00057 void CAOLabBubbleSortAppUi::HandleCommandL( TInt aCommand )
00058 {
00059 switch( aCommand )
00060 {
00061 case EEikCmdExit:
00062 case EAknSoftkeyExit:
00063 {
00064 Exit();
00065 break;
00066 }
00067
00068 case ECommandSort:
00069 {
00070 if (iAppContainer->IsSorting())
00071 {
00072 iAppContainer->CancelSortL();
00073 }
00074 else
00075 {
00076 iAppContainer->SortL();
00077 }
00078 break;
00079 }
00080
00081 default:
00082 break;
00083 }
00084 }
00085
00086
00087
00088 void CAOLabBubbleSortAppUi::HandleStatusPaneSizeChange()
00089 {
00090 iAppContainer->SetRect( ClientRect() );
00091 }
00092
00093