×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    47

    Symbian C++ equivalent of J2ME form.append("text")?

    Hi,

    I want to quickly output some text to the screen. I know the existence of the SetTextL function for iAppView (which is hard to discover), but is there also an "AppendTextL" function?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Symbian C++ equivalent of J2ME form.append("text")?

    It also depends on the given "text" control. A label (CEikLabel) does not support append, while editor controls/their document object do.
    iAppView is a common name for a CCoeControl-inherited variable in generated application skeletons, thus it can be anything.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Symbian C++ equivalent of J2ME form.append("text")?

    For the CEikLabel-case (say "iLabel") you can use get-extend-set approach:
    Code:
    "CEikLabel *iLabel;"
    HBufC *text=iLabel->Text()->AllocLC();
    text=text->ReAllocL(text->Length()+append.Length());
    CleanupStack::Pop(); // text
    CleanupStack::PushL(text);
    text->Des().Append(append);
    iLabel->SetTextL(*text);
    CleanupStack::PopAndDestroy(); // text
    DrawDeferred();
    where "append" is the descriptor containing the text to be appended.

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    47

    Re: Symbian C++ equivalent of J2ME form.append("text")?

    Yeah sorry, I meant the generated CCoeControl when you start a new project

    Thanks for your answers

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Symbian C++ equivalent of J2ME form.append("text")?

    CCoeControl itself does not draw anything. However it probably contains a CEikLabel.

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    47

    Re: Symbian C++ equivalent of J2ME form.append("text")?

    Hey check this code out (from my web service project):

    Code:
    void CWSAppView::ConstructL( const TRect& aRect )
    	{
    	// Create a window for this application view
    	CreateWindowL();
    	
    	iEikEdwin = new ( ELeave ) CEikEdwin();
    	iEikEdwin->ConstructL( CEikEdwin::EReadOnly | CEikEdwin::ENoAutoSelection );
    	iEikEdwin->SetContainerWindowL( *this );
    	iEikEdwin->SetAknEditorFlags( EAknEditorFlagEnableScrollBars );
    
    	// Creates scroll bar.
    	CEikScrollBarFrame* scrollBarFrame = iEikEdwin->CreateScrollBarFrameL();
    	scrollBarFrame->SetScrollBarVisibilityL(
    		CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
    	iEikEdwin->SetCursorPosL(0, EFalse);
        iEikEdwin->UpdateScrollBarsL();
    
        // Display opening message to the screen.
        /*HBufC* openingMessage = CEikonEnv::Static()->AllocReadResourceLC(
            R_OPENING_MESSAGE );
        iEikEdwin->SetTextL( openingMessage );
        CleanupStack::PopAndDestroy(); // openingMessage*/
    
    	// Set the windows size
    	SetRect( aRect );
    
    	// Activate the window, which makes it ready to be drawn
    	ActivateL();
    	}
    
    void CWSAppView::SetTextL( const TDesC& aText )
        {
        iEikEdwin->SetTextL( &aText );
        DrawNow();
        }
    This is how you can output some text to the screen

Similar Threads

  1. Symbian C++ vs J2ME
    By pinkfloydhomer in forum Symbian
    Replies: 1
    Last Post: 2009-06-20, 21:57
  2. j2me or symbian c++
    By s-factor in forum Symbian
    Replies: 2
    Last Post: 2007-11-11, 10:38
  3. start-up j2me app in symbian app
    By IsGoldenFinger in forum Symbian
    Replies: 5
    Last Post: 2007-05-05, 12:56
  4. Moving from Symbian C++ to J2Me
    By arachidyl in forum Mobile Java General
    Replies: 5
    Last Post: 2006-06-10, 22:37
  5. Replies: 1
    Last Post: 2003-03-25, 11:06

Posting Permissions

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