×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    5

    problems in displaying "text" on the screen after application has started

    We are developing a calculator on S60 and we having problems in displaying "text" on the screen after application has started. How to do it?
    I have pasted my Appview.cpp file below


    Code:
    File: myCalculatorAppView.cpp
    #include <barsread.h>  // for resource reader
    #include <eiklabel.h>  // for label controls
    #include <eikedwin.h>  // for CEikEdwin
    #include <coemain.h>
    #include <myCalculator.rsg>
    #include <gulcolor.h>
    #include "myCalculatorAppView.h"
    
    _LIT(KLabelTextA,"hello, this is it.");
    
    // Standard construction sequence
    CmyCalculatorAppView* CmyCalculatorAppView::NewL(const TRect& aRect)
        {
        CmyCalculatorAppView* self = CmyCalculatorAppView::NewLC(aRect);
        CleanupStack::Pop(self);
        return self;
        }
    
    CmyCalculatorAppView* CmyCalculatorAppView::NewLC(const TRect& aRect)
        {
        CmyCalculatorAppView* self = new (ELeave) CmyCalculatorAppView;
        CleanupStack::PushL(self);
        self->ConstructL(aRect);
        return self;
        }
    
    CmyCalculatorAppView::CmyCalculatorAppView()
    					:iLabelAA(NULL)
        {
    	// no implementation required
        }
    
    CmyCalculatorAppView::~CmyCalculatorAppView()
        {
            delete iLabelAA;
        }
    
    void CmyCalculatorAppView::ConstructL(const TRect& aRect)
        {
        // Create a window for this application view
        CreateWindowL();
        CEikLabel* iLabelAA;
        iLabelAA = new (ELeave) CEikLabel;
        iLabelAA->SetContainerWindowL(*this);
        iLabelAA->SetTextL(KLabelTextA);
        iLabelAA->OverrideColorL( EColorLabelTextEmphasis, KRgbRed );
    iLabelAA->SetEmphasis( CEikLabel::EPartialEmphasis );  
        iLabelAA->SetExtent( TPoint(10,10), iLabelAA->MinimumSize() );
        // Set the windows size
        SetRect(aRect);
    
        // Activate the window, which makes it ready to be drawn
        ActivateL();
        }
    
    // Draw this application's view to the screen
    void CmyCalculatorAppView::Draw(const TRect& aRect) const
        {
        // Get the standard graphics context 
        CWindowGc& gc = SystemGc();
        
        // Gets the control's extent
        TRect rect = Rect();
        
        // Clears the screen
        gc.Clear(rect);
        gc.DrawRect(aRect);
        }

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: problems in displaying "text" on the screen after application has started

    you should also implement CountComponentControls() & ComponentControl() functions so the system would know to draw your label.

    yucca

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    1

    Re: problems in displaying "text" on the screen after application has started

    Quote Originally Posted by symbianyucca
    you should also implement CountComponentControls() & ComponentControl() functions so the system would know to draw your label.

    yucca
    Thanks.

    Is there somthing like a tutorial that we may follow. just like this problem, sometimes we just don't know which things should be defined in order to make the whole application work, as for our beginners.

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: problems in displaying "text" on the screen after application has started

    You could maybe check the helloworld example fshipped with the SDK, If I remember right it is using Labels in container, thus would show all required stuff in it.

    yucca

Similar Threads

  1. ProcessCommandParametersL problems application
    By netlogins in forum Symbian
    Replies: 4
    Last Post: 2007-02-22, 09:57
  2. direct screen access from a console application
    By ravinder007 in forum Symbian
    Replies: 0
    Last Post: 2007-01-25, 14:14
  3. Replies: 1
    Last Post: 2006-03-24, 08:25
  4. How to create application icon on the menu screen of the handset.
    By aminuddin09 in forum Mobile Java General
    Replies: 4
    Last Post: 2006-03-21, 09:51
  5. How to override the help button so help application not started
    By cl_jp in forum Symbian User Interface
    Replies: 1
    Last Post: 2001-12-03, 20:09

Posting Permissions

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