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

 

Code implementation for GUI

Carbider | 25 October, 2007 09:28

At post: Assembling GUI set reflecting future BluSPAN functionality I have shown the GUI that will take place at BluSPAN application. Now I will tell you about some difficulties I’ve faced during this.
Since the Status” menu-item in Options menu was created, I wanted it to perform Query List popup for user can select his status. This was done with “List Single Query Dialog” component.
After lots of research, and looking at examples, I knew that after this component is placed onto designer, the “RunListQuery1L();” is generated.
So I’ve implemented the “selected” event with call to it:
… ::HandleStatusMenuItemSelectedL( TInt aCommand )
{
            // Run the Single Query list Of Status
            int resultIndex = RunListQuery1L();
           
            return ETrue;
}

And it worked.

 
Picture 1 – Event tab in Carbide ะก++
Creating new UI design in current application
To allow user customize the “USER”, “PAN” and other settings I had to create new designs with Settings Lists.
To do that, just right click on a project, and select:
New->Other->Symbian OS->S60 UI Design
Select “Setting Item List” type of interface. Write appropriate name. For example: “SettingsPAN” and click Finish. After that you can start customizing new UI design by arranging the components.
Once a User Settings design, was created, I’ve put “Text Editor” component there for user’s nickname . After Build the error occurred: 
object 'KEdit1MaxLength' redefined”. 
But that was not so definitely, because I’ve made a lot of Designs to that time, and I’ve got a lot of similar errors. After examination it was clear that UI Designer generated the same code for newer “Text Editor” as it was for main application’s design (there was “Text Editor” too). Is it so clear?
But I’ve changed Component’s name from “edit1” to “User_edit1”. The errors stepped back.
At current stage I have a lot of Design screens with BluSPAN settings. But I don’t know how to switch between them. When new Design is created, the remark is shown: “Use View Switching: Avkon View-Switching architecture uses the View Server to activate your designs”. But I did find how to use it. 

Picture 2 – The questions is: How to switch UI designs in application?
Did anybody face this challenge?

Assembling GUI set reflecting future BluSPAN functionality

Carbider | 24 October, 2007 16:31

Hello. Recent days I was busy on assembling the GUI set which should reflect the functionality of future BluSPAN application.
I used Carbide’s C++ UI Designer tool. It’s pretty handy to drag-and-drop elements at design’s workspace while the appropriate code is generated.  But I’m still confused with that code, which is too complicated to novice’s sight.
Documentation
I tried to approach this task reading a lot of material.
» I observed the possibilities of UI with help of 
“Introduction_to_S60_UI_Components” 
and I’ve got good notion about it.
       » Very basic information about UI Designer
UI Designer White Papers
» The manual for developers is: Avkon UI Resources
» Downloaded and executed some examples:
Current results
So I started creating my GUIs. Here is a picture of those, I’ve created:

Picture 1 – Screen of Main app’s window
 
Picture 2 – Options menu



Picture 3 – Settings screens of all parameters BluSPAN will care
At next posts I’ll tell you what difficulties I’ve faced, the troubles I could overcome and those ones which are still barrier for project progress.
 
1 2 3  Next»
 

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 qdcZrelationQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e59E2eowlX qdcZtitleQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qdcZtitleQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qdcZtypeQUqfnZE44istributionQ qdcZtypeQUqfnZSiteQ qdcZtypeQUqvocZTermQ qdcZtypeQUqvocZVocabularyConstructQ qdcZtypeQUqwebZSiteQ qdcZtypeQUqrdfsZE52esourceQ qswZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX quriE71aZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX qvocZpartOfQUqfnZPublicationQ qwebZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX qrdfZtypeQUqfnZE44istributionQ qrdfZtypeQUqfnZSiteQ qrdfZtypeQUqvocZTermQ qrdfZtypeQUqvocZVocabularyConstructQ qrdfZtypeQUqwebZSiteQ qrdfZtypeQUqrdfsZE52esourceQ qrdfsZisE44efinedByQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX qrdfsZisE44efinedByQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e59E2eowlX qrdfsZlabelQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qrdfsZlabelQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qrdfsZseeAlsoQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX qrdfsZseeAlsoQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e59E2eowlX