×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    May 2009
    Posts
    89

    UI Designer problem

    Hi!

    I'm still very new to carbide. I'm trying to make a small test application and I can't get my head around how to customize the behavior of the softkeys in a nice way using the UI Designer. I edit the properties of the control pane to define the labels and commands of each softkey, but then I don't know where to insert the code that is supposed to be executed when these commands are issued.

    I believe that the code should be in the switch-statement in the HandleCommandL of the view, but it looks like this:
    Code:
    void CTestContainerView::HandleCommandL( TInt aCommand )
    	{
    	// [[[ begin generated region: do not modify [Generated Code]
    	TBool commandHandled = EFalse;
    	switch ( aCommand )
    		{	// code to dispatch to the AknView's menu and CBA commands is generated here
    		default:
    			break;
    		}
    	
    		
    	if ( !commandHandled ) 
    		{
    	
    		if ( aCommand == EAknSoftkeyExit )
    			{
    			AppUi()->HandleCommandL( EEikCmdExit );
    			}
    	
    		}
    	// ]]] end generated region [Generated Code]
    	
    	}
    and it gets reset each time I save the uidesign-file. I could write it outside the generated code block, but that can't be the right/only way to do it? That has to be why that switch is there in the first place. So how do I get the uidesigner to leave my command handling code alone?

    EDIT: I just want simple commands to be executed when pressing the button, no menus.

    Thx
    //T
    Last edited by ojve; 2009-06-11 at 14:43.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: UI Designer problem

    Since you are using the UI designer, you should get it to generate the handler method for you. Check the various settings/properties of the buttons.

  3. #3
    Regular Contributor
    Join Date
    May 2009
    Posts
    89

    Re: UI Designer problem

    Yes, I know, that's what I've been trying to, but I can't find where to do it. The only place I can find is the properties of the control pane. There I can define the labels and command ids of the softkeys, but that does not cause any handlers to be generated (except for the exit button).

    //T

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: UI Designer problem

    Well, I have tried it without success...
    A workaround could be implementing ProcessCommandL - that is the first method which gets the commands, and apparently the UI designer does not tamper with it. So something like
    Code:
    void CTestContainerView::ProcessCommandL (TInt aCommand)
    {
        if(aCommand==ETestContainerViewControlPaneLeftId)
        {
            do something here
        }
        CAknView::ProcessCommandL(aCommand);
    }
    You should check the actual command id in the .rssi (and #include the .hrh), just this "ETestContainerViewControlPaneLeftId" was generated for me when selected "Generated command" in the dropdown list.

  5. #5
    Regular Contributor
    Join Date
    May 2009
    Posts
    89

    Re: UI Designer problem

    Ok, thanks. I'll try that!

    //T

Similar Threads

  1. Chat example + UI designer
    By jurekr in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2009-12-08, 17:18
  2. Carbide.c++ UI Designer deffect when using s60 2nd edition sdk
    By nyamgasoft in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 10
    Last Post: 2008-08-21, 12:15
  3. regarding multiple views using carbide UI designer
    By chirumar in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-04-13, 07:55
  4. Carbide.c++ UI Designer vs Game API
    By arachidyl in forum Symbian User Interface
    Replies: 4
    Last Post: 2006-10-25, 10:10
  5. Problem application UI!!!
    By rubicita in forum Mobile Java General
    Replies: 3
    Last Post: 2005-09-21, 19:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×