Void cfirstfuckappui: constructl ()
{
// Initialise app UI
Standard value.
Baseconstructl (caknappui: eaknenableskin );
Ceikstatuspane * sp = statuspane ();
Ititlepane =
Static_cast <cakntitlepane *> (SP-> controll (
Tuid: UID (eeikstatuspaneuidtitle )));
Inavipane =
Static_cast <caknnavigationcontrolcontainer *>
(SP-> controll (tuid: UID (eeikstatuspaneuidnavi )));
If (inavipane)
{
Caknnavigationdecorator * navidecorator =
Inavipane-> top ();
If (navidecorator)
{
Itabgroup = (cakntabgroup *) navidecorator-> decoratedcontrol ();
}
}
Iactive = itabgroup-> activetabindex ();
Itabcount = itabgroup-> tabcount ();
Iview = new
(Eleave) cfirstfuckappview;
Cleanupstack: pushl (iview );
Iview-> constructl ();
Cleanupstack: Pop ();
Addviewl (iview
);
Iview1 = new (eleave) cfirstfuckappview1;
Cleanupstack: pushl (iview1 );
Iview1-> constructl ();
Cleanupstack: Pop ();
Addviewl (iview1 );
This-> setdefaviewviewl (* iview); // sets the default value to the first view.
}
Void
Cfirstfuckappui: handlecommandl (tint acommand)
{
Switch
(Acommand)
{
Case eeikcmdexit:
Case
Eaknsoftkeyexit:
Exit ();
Break;
Case ecommandalarm:
Case ecommandabout:
Case ehelp:
Case eclose:
Iview-> handlecommandl (acommand );
// Events passed to the first view
Break;
Case ecommandstart:
Case ecommandstop:
Iview1-> handlecommandl (acommand );
// Events passed to the second view
Break;
Default:
Panic (efirstfuckui );
Break;
}
}
Tkeyresponse cfirstfuckappui: handlekeyeventl (// capture the left and right keys and activate the view
Const tkeyevent & akeyevent, teventcode Atype)
{
Switch (akeyevent. icode)
{
Case ekeyleftarrow:
If (iactive> 0)
{
Iactive --;
Itabgroup-> setactivetabbyindex (iactive
);
This-> activatelocalviewl (kviewid );
}
Break;
Case ekeyrightarrow:
If (
(Iactive + 1) <itabcount)
{
Iactive ++;
Itabgroup-> setactivetabbyindex (iactive
);
This-> activatelocalviewl (kviewid1 );
}
Break;
Default:
Return
Ekeywasnotconsumed;
Break;
}
Return
Ekeywasnotconsumed;
}
Resource eik_app_info
{
Status_pane = r_aknfirstfuck_status_pane;
}
Resource
Status_pane_app_model r_aknfirstfuck_status_pane
{
Panes =
{
Spane_pane
{
Id =
Eeikstatuspaneuidnavi;
Type = eaknctnavipane;
Resource = r_aknfirstfuck_navi_decorator; // navigation
}
};
}
Resource navi_decorator r_aknfirstfuck_navi_decorator
{
Type = enavidecoratorcontroltabgroup;
Control = tab_group
{
Tab_width = eakntabwidthwithtwotabs;
Active =
0;
Tabs =
{
Tab
{
Id = eaknfirstfuckviewtab1;
TXT =
R_string_firstfuck_tab_label1;
},
Tab
{
Id = eaknfirstfuckviewtab2;
TXT = r_string_firstfuck_tab_label2;
}
};
};
}