×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jan 2005
    Posts
    154

    [moved] Invisible textbox with CEikEdwin

    Hello,

    i have been fighting with this problem for the last couple of hours and cant find a solution. I lost my battle and here i am now asking you the experts help to revenge :) :p

    i am adding 2 CEikEdwin to my control. However, the textboxes are not visible but i can see the cursor blinking. I can even insert text into the field. I am not sure what is wrong. I am having the following implemented:

    1- I have both valls below in my AppUi class
    iAppView->SetMopParent( this );
    AddToStackL(iAppView);

    2- I have the following funcs overriden:
    HandleControlEventL()
    OfferKeyEventL();
    CountComponentControls() const
    ComponentControl(TInt aIndex) const

    3- I have the following function to construct the Edwins. Note that this function i called some time later after the construction of the control (i.e. not in ConstructL() ):

    Code:
    void CMyAppView::ConstructActivationScreen()
    	{
        TResourceReader reader;
        iCoeEnv->CreateResourceReaderLC(reader, R_COUNTRY_CODE_EDITOR);
    	iCountryEd = new (ELeave) CEikEdwin();
    	iCountryEd->SetContainerWindowL(*this);
    	iCountryEd->ConstructFromResourceL(reader);
    	iCountryEd->SetExtent( TPoint(X_OFFSET, Y_OFFSET), TSize(80,30) );
    	CleanupStack::PopAndDestroy();
        iCountryEd->SetFocus( ETrue, EDrawNow );
        iCountryEd->ActivateL();     // tried with and without this
        
        iCoeEnv->CreateResourceReaderLC(reader, R_TEL_EDITOR);
    	iTelEd = new (ELeave) CEikEdwin();
    	iTelEd->SetContainerWindowL(*this);
    	iTelEd->ConstructFromResourceL(reader);
    	iTelEd->SetExtent( TPoint(X_OFFSET+60, Y_OFFSET), TSize(140,30) );
    	CleanupStack::PopAndDestroy();
        iTelEd->SetFocus( EFalse, EDrawNow );
        iTelEd->ActivateL();   // tried with and without this
    	}
    If you require more code please let me know.

    Many thanks in advance.... and i hope i will win my battle with ur help :)

    AF

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

    Re: [moved] Invisible textbox with CEikEdwin

    Compound controls work in an other way: you should not invoke ActivateL on the individual components, instead you should simply invoke ActivateL on yourself at the end of your ConstructL. The contained controls will be activated implicitly (you should report and return them in CountComponentControls and ComponentControl, of course - but you already do that I think).

  3. #3
    Regular Contributor
    Join Date
    Jan 2005
    Posts
    154

    Re: [moved] Invisible textbox with CEikEdwin

    Thanx wizard_hu for ur reply.
    What do u mean exactly by "Compound controls work in an other way"? I am attaching below my implementation fro the different APIs required to have textboxes viewed. Let me know if there is anything that is differnet in my case from normal controls.

    regs
    AF

    Code:
    // in rss
    RESOURCE EDWIN r_country_code_editor
    	{
    	flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    	width = 4;
    	lines = 1;
    	maxlength = 4;
    	default_input_mode = EAknEditorNumericInputMode;
    	} 
    
    RESOURCE EDWIN r_tel_editor
    	{
    	flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    	width = 18;
    	lines = 1;
    	maxlength = 25;
    	default_input_mode = EAknEditorNumericInputMode;
    	} 
    
    
    // in AppUi
    void CMyAppUi::ConstructL()
    	{
    	// Initialise app UI with standard value.
    	BaseConstructL(CAknAppUi::EAknEnableSkin);
    	
    	// Create view object
    	iAppView = CMyAppView::NewL( ClientRect() );
    	iAppView->SetMopParent( this );
    	AddToStackL(iAppView);
    	SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);	
            }
    
    
    // in CCoeControl class
    void CMyAppView::ConstructL( const TRect& )
        {
        CreateWindowL();
        SetExtentToWholeScreen();  
        ActivateL();
        .....
        }
    
    void CMyAppView::SizeChanged()
        {  
        if(iAppState==EActivationScreen)
        	{
        	iCountryEd->SetExtent( TPoint(X_OFFSET, Y_OFFSET), TSize(80,30) );
    	    iTelEd->SetExtent( TPoint(X_OFFSET+60, Y_OFFSET), TSize(140,30) );
    	    DrawNow();
        	}
        }
    
    oid CMyAppView::HandleControlEventL(
        CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
        {
        }
    
    
    TKeyResponse CMyAppView::OfferKeyEventL(const TKeyEvent& aKey, TEventCode aType)
    	{
    	TKeyResponse ret(EKeyWasNotConsumed);
    	if( iCountryEd )
    		{
    		if(iCountryEd->IsFocused())
    			{
    			ret = iCountryEd->OfferKeyEventL(aKey, aType);
    			}
    		}
    	if( iTelEd )
    		{
    		if(iTelEd->IsFocused())
    			{
    			ret = iTelEd->OfferKeyEventL(aKey, aType);								
    			}
    		}
    	else
    		{
    		ret = CCoeControl::OfferKeyEventL(aKey, aType);
    		}
    
    	return ret;
    	}
    
    TInt CMyAppView::CountComponentControls() const
    	{
    	if( iAppState == EActivationScreen )
    		{
    		return 2;
    		}
    	return 0;
    	}
    
    CCoeControl* CMyAppView::ComponentControl(TInt aIndex) const
    	{
    	switch ( aIndex )
    	    {
    	    case 0:
    	        return iCountryEd;
    	    case 1:
    	        return iTelEd;
    	    default:
    	        return NULL;
    	    };
    	}
    
    void CMyAppView::ConstructActivationScreen()
    	{
        TResourceReader reader;
        iCoeEnv->CreateResourceReaderLC(reader, R_COUNTRY_CODE_EDITOR);
    	iCountryEd = new (ELeave) CEikEdwin();
    	iCountryEd->SetContainerWindowL(*this);
    	iCountryEd->ConstructFromResourceL(reader);
    	iCountryEd->SetExtent( TPoint(X_OFFSET, Y_OFFSET), TSize(80,30) );
    	CleanupStack::PopAndDestroy();
        iCountryEd->SetFocus( ETrue, EDrawNow );
    //    iCountryEd->ActivateL();
        
        iCoeEnv->CreateResourceReaderLC(reader, R_TEL_EDITOR);
    	iTelEd = new (ELeave) CEikEdwin();
    	iTelEd->SetContainerWindowL(*this);
    	iTelEd->ConstructFromResourceL(reader);
    	iTelEd->SetExtent( TPoint(X_OFFSET+60, Y_OFFSET), TSize(140,30) );
    	CleanupStack::PopAndDestroy();
        iTelEd->SetFocus( EFalse, EDrawNow );
    //    iTelEd->ActivateL();
    	}
    
    // and in some keyevent handling state i call ConstructActivationScreen() then DrawNow();

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

    Re: [moved] Invisible textbox with CEikEdwin

    Hmm. Based on your complete code, those controls should rather be ActivateL-d. In your initial post it was not that trivial that you do not instantiate these controls on startup.
    When you invoke ActivateL, the environment will check your contained controls, and invoke ActivateL on them. However in your case when you call ActivateL on your main control, it will return 0 contained controls apparently.

  5. #5
    Regular Contributor
    Join Date
    Jan 2005
    Posts
    154

    Re: [moved] Invisible textbox with CEikEdwin

    what do u mean by ActivateL-d?

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: [moved] Invisible textbox with CEikEdwin

    ActivateL is a method of CCoeControl. Basically this is the method which sets the control renderable. You are already using this method if you have not noticed that...

  7. #7
    Regular Contributor
    Join Date
    Jan 2005
    Posts
    154

    Re: [moved] Invisible textbox with CEikEdwin

    I know what ActivateL is :) i was just wondering what you meant by ActivateL-d which u refered to.
    Any ways, i tried this funcs in my code. and i tried with out it (in the code above it is commented for the CEikEdwin controls). It did not solve the issue :(

Similar Threads

  1. Predictive Text using a CEikEdwin
    By juliand77 in forum Symbian User Interface
    Replies: 4
    Last Post: 2009-10-14, 15:44
  2. CEikEdwin problem
    By Mart1986 in forum Symbian
    Replies: 3
    Last Post: 2008-05-16, 08:38
  3. how to display log on TextBox...?
    By smart_aju2007 in forum Mobile Java General
    Replies: 1
    Last Post: 2007-01-31, 05:41
  4. Command Button on TextBox Issue in 6230i/3510i
    By manasmchex in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 3
    Last Post: 2006-02-03, 17:13
  5. 6600 - line break in TextBox
    By wiertek in forum Mobile Java General
    Replies: 0
    Last Post: 2004-12-23, 09:39

Posting Permissions

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