×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    290

    SetItemDimmed gives me a "EIKCOCTL 8" Panic

    Hi,

    i think this panic means "There is no such menu item". So something goes wrong but i don't know how to fix it.

    I have one view this view calls another view...

    Code:
    case EOpenTasksViewDetailMenuItemCommand:
    				{																					    								
    				HBufC8* Message = reinterpret_cast<HBufC8*>( iOpenTasks->GetTaskIdFromSelectedItemLC() );
    				//Sending package buffer between views
    				TViewParameter ViewParam;
    				ViewParam.ViewId = Id();
    				ViewParam.Task_Id.Copy( *Message );
    				//create package buffer
    				TPckgBuf<TViewParameter> package( ViewParam );
    				//Now put to view!
    				AppUi()->ActivateLocalViewL( TUid::Uid( EDetailViewId ), 
    										     TUid::Uid( ECustomMessageSwitchViews ),
    										    package );				
    				CleanupStack::PopAndDestroy( Message );
    				}
    				break;

    I pass some values to the other view( What kind of menu item is displayed depends on the parameter passed to this view) .


    Here the passed values are evaluated....


    Code:
    void CDetailView::DoActivateL( 
    		const TVwsViewId& aPrevViewId,
    		TUid aCustomMessageId,
    		const TDesC8& aCustomMessage )
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	SetupStatusPaneL();
    	
    				
    	if ( iDetail == NULL )
    		{
    		iDetail = CreateContainerL();
    		iDetail->SetMopParent( this );
    		AppUi()->AddToStackL( *this, iDetail );
    		} 
    	// ]]] end generated region [Generated Contents]
    	
    	if ( aCustomMessageId == TUid::Uid(ECustomMessageSwitchViews) )
    		{
    		iPrevViewId = aPrevViewId;
    														
    		TPckgBuf<TViewParameter> package;
    		package.Copy( aCustomMessage );
    		TViewParameter ViewParam;
    		ViewParam = package();	
    	
    		
    		
    		if( ViewParam.ViewId == TUid::Uid( EOpenTasksViewId ) )
    			{
    			//Set Menu	
    			MenuBar()->MenuPane()->SetItemDimmed( EDetailViewOeffnenMenuItemCommand, ETrue );								
    			}
    		if( ViewParam.ViewId == TUid::Uid( EClosedTasksViewId ) )
    			{
    			//Set Menu						
    			MenuBar()->MenuPane()->SetItemDimmed( EDetailViewSchliessenMenuItemCommand, ETrue );		
    			}
    but if the emulator reaches the red lines it crashes!

    Here is my resource file


    Code:
    RESOURCE AVKON_VIEW r_detail_detail_view
    	{
    	cba = r_detail_control_pane;
    	menubar = r_detail_options_menu;
    	toolbar = 0;
    	}
    RESOURCE MENU_BAR r_detail_options_menu
    	{titles =
    			{
    			MENU_TITLE
    				{
    				menu_pane = r_detail_menu_pane1_menu_pane;
    				}
    			};
    
    	}
    
    RESOURCE STATUS_PANE_APP_MODEL r_detail_status_pane
    	{
    	panes =
    		{
    		SPANE_PANE
    			{
    			id = EEikStatusPaneUidTitle;
    			type = EAknCtTitlePane;
    			resource = r_detail_title_resource;
    			}
    		};
    	}
    RESOURCE TITLE_PANE r_detail_title_resource
    	{
    	txt = STR_DetailView_3;
    	}
    RESOURCE LISTBOX r_detail_list_box
    	{
    	flags = EAknListBoxSelectionList;
    	}
    
    RESOURCE CBA r_detail_control_pane
    	{
    	buttons =
    		{
    		CBA_BUTTON
    			{
    			id = EAknSoftkeyOptions;
    			txt = STR_DetailView_1;
    			},
    		CBA_BUTTON
    			{
    			id = EAknSoftkeyBack;
    			txt = STR_DetailView_2;
    			}
    		};
    	}
    RESOURCE MENU_PANE r_detail_menu_pane1_menu_pane
    	{
    	items =
    		{
    		MENU_ITEM
    			{
    			command = EDetailViewErgaenzungMenuItemCommand;
    			txt = STR_DetailView_7;
    			},
    		MENU_ITEM
    			{
    			command = EDetailViewSchliessenMenuItemCommand;
    			txt = STR_DetailView_10;
    			},
    		MENU_ITEM
    			{
    			command = EDetailViewOeffnenMenuItemCommand;
    			txt = STR_DetailView_11;
    			}	
    		};
    }

    Greetz
    Franky

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

    Re: SetItemDimmed gives me a "EIKCOCTL 8" Panic

    Menus work in a totally different way: you get the chance for initializing them every time when the menu is going to be displayed. Search for SetItemDimmed in the Wiki.

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    290

    Re: SetItemDimmed gives me a "EIKCOCTL 8" Panic

    Ok i have to implement...
    Code:
    DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane)
    ... this is the place where a have to dimm my menu entries.
    This will be called from the framework. But how do i force the framework to call this?
    Will this be done when executing "DoActivateL"?


    Greetz
    Franky

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    119

    Re: SetItemDimmed gives me a "EIKCOCTL 8" Panic

    No, it is called everytime the menu is about to be displayed. In your case, just after the user presses Options, but just before drawing the menu.

  5. #5
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    290

    Thumbs up Re: SetItemDimmed gives me a "EIKCOCTL 8" Panic

    Hi,

    yes thanks for your replies. The rest is quite simple!

    first put this in your xxxView.h file

    Code:
    public:
    ...
    void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
    DynInitMenuPaneL will be called every time you click at your menu and force it to display.

    now put this in your xxxView.cpp
    Code:
    void CDetailView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
    	{
    	CAknView::DynInitMenuPaneL( aResourceId, aMenuPane );
    	if( aResourceId == YOUR_RESOURCE_ID )
    		{
    		//do what you want to do e.g:  SetDimmed
    		}
    	}
    and your menu items are hidden (just if you want them to be hidden).


    Greetz
    Franky

Similar Threads

  1. Panic "Cone 8" during Exit()
    By sid_diu in forum Symbian
    Replies: 7
    Last Post: 2009-07-31, 08:02
  2. SetItemDimmed() is executed, User panic (when option is chosen)
    By prometheus75 in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-08-22, 21:57
  3. Using Bluetooth serial port in MIDlets (nokia 9500 issue)
    By orsteglasy in forum Mobile Java Networking & Messaging & Security
    Replies: 11
    Last Post: 2007-10-07, 21:49
  4. Panic dialog - ERRRD
    By greatape in forum Symbian
    Replies: 7
    Last Post: 2007-09-16, 19:32
  5. Replies: 0
    Last Post: 2004-09-24, 22:01

Posting Permissions

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