You Are Here:

Community: Blogs

Open Source Bluetooth PAN's Forum Nokia Blog

Switching Avkon Views

Carbider | 31 October, 2007 13:20

All of the views in my application which is shown here are represented as “Setting Item List” components (classes). Even main screen does. Here I reported vagueness about how to switch from one view (screen) to another. For example as I pick a “PAN” setting from main option menu I should be redirected to new PAN settings screen.

                   

Now I can tell you how it can be done.

                 

The way to this was laid through “MultiViews” S60 SDK example. It is found at “S60_3rd_FP1 / S60Ex / MultiViews” folder. I was solving the rebuses and found out that the final switching comes through AppUi()->ActivateLocalViewL() call. This function takes TUid parameter which is a View’s Identifier.

The accordance between the View and it’s ID is defined as Enumeration at [projectName].hrh file like this:

Listing 1:

enum TguiSetBluspanViewUids

{

               EGuiSetBluspanSettingItemListViewId = 1,

               EGuiSetBluspanSettingItemList2SettingsPanViewId,

               EGuiSetBluspanSettingItemList2SettingsZeroconfViewId,

               EGuiSetBluspanSettingItemList2SettingsUserViewId

            

};

So I assigned the Handler function to PAN menu-item click and implemented code:

AppUi()->ActivateLocalViewL(TUid::Uid(EGuiSetBluspanSettingItemList2SettingsPanViewId ) );

Yeah, this name is true long but was generated automatically.

    

 

Diagram 01 – Switch from main screen to PAN settings screen.

As I implemented analogous code for the rest Views at Settings submenu (diagram 2)

I discovered that the new child view has Exit soft button which will exit the application if was clicked. But I need it to return back to the main screen not exit.

Diagram 02 – Settings submenu

 

At properties menu I picked OPTIONS_BACK instead of OPTIONS_EXIT (diagram 3).

                 

 

Diagram 03 – Options menu properties

 

But it did not cause the required effect. The button’s name was changed but it still executed Exit function. The reason is the following block of code, situated at HandleCommandL( TInt aCommand ) function:

Listing 2:

// [[[ begin generated region: do not modify [Generated Code]

if ( aCommand == EAknSoftkeyBack )

{

AppUi()->HandleCommandL( EEikCmdExit );

}

// ]]] end generated region [Generated Code]

 

I changed the code above to this one:

 

Listing 3:

if ( aCommand == EAknSoftkeyBack )

{

AppUi()->ActivateLocalViewL( TUid::Uid( EGuiSetBluspanSettingItemListViewId ) );

// The ID is in the [projectName].hrh file too

}

So, I’ve activated the Main screen (view) by this call. It works well but there is a problem: the code is situated in the middle of following framework:

// [[[ begin generated region: do not modify [Generated Code]

// ]]] end generated region [Generated Code]

It means that after any change to given View (with help of UI designer) my code would be rewritten with those one that’s shown at listing 2. That are not good news and I didn’t find more appropriate decision yet.

The last version of BluSPAN GUI source code can be found over this Zip Archive here.

 

Extract files from it, than create new workspace and import Bld.inf file as was shown at previous posts here.

 

 

Konstantine Voytenko

 

 
 

Rate This

 
 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZrelationQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX qdcZtitleQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qdcZtitleQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qdcZtypeQUqfnZE44istributionQ qdcZtypeQUqfnZSiteQ qdcZtypeQUqvocZTermQ qdcZtypeQUqvocZVocabularyConstructQ qdcZtypeQUqwebZSiteQ qdcZtypeQUqrdfsZE52esourceQ qswZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX quriE71aZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX qvocZpartOfQUqfnZPublicationQ qwebZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX qrdfZtypeQUqfnZE44istributionQ qrdfZtypeQUqfnZSiteQ qrdfZtypeQUqvocZTermQ qrdfZtypeQUqvocZVocabularyConstructQ qrdfZtypeQUqwebZSiteQ qrdfZtypeQUqrdfsZE52esourceQ qrdfsZisE44efinedByQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX qrdfsZlabelQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qrdfsZlabelQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qrdfsZseeAlsoQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX