Join Now

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?

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

 

Get project from CVS to Carbide C++

Carbider | 02 November, 2007 12:16

It recently for me to describe how to Checkout the project’s source codes directly to Carbide C++.  So I decided to carry such an explanation to a single post and refer to it.

Contents:
  1. How to get sources from CVS
  2. How to get sources from Zip archive.

To get sources from CVS to Carbide workspace.

  • Open new workspace in Carbide.
  • Choose “Window->Open perspective->Other->CVS Repository Exporting”
  • At the left side of window (on CVS Repositories tab) click Right mouse button and choose: “New->repository Location”.

 Fill in following data:

  • Host: bluspan.cvs.sourceforge.net
  • Repository path: /cvsroot/bluspan
  • User: anonymous
  • Connection type: pserver

 

 

  • After Location is created, click “Head”, then right-button click at the project you want to get and pick “Check out”.
  • You may need then to import project: File->Import->Simbian OS Bld.inf. The Bld.inf file is usually situated at “group” folder.

  2. To get sources from Zip archive.

  • Extract files from archive
  • Create new Carbide workspace
  • Import project by: File->Import->Simbian OS Bld.inf.

    The Bld.inf file is usually situated at “group” folder.

    
«Previous   1 2 3 4 5 6 7  Next»
 
 
Powered by LifeType