×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    17

    Displaying Numbers, strings and dialog

    Hi,

    I am newbie and need help.
    I need to display numbers and texts to screen and at the same time show a query dialog requesting user input.
    I know how to display seperately but not together.

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

    Re: Displaying Numbers, strings and dialog

    you could maybe try multiline query dialogs, something like this one: http://wiki.forum.nokia.com/index.ph...secret_editors

    just change teh control and modify the resource to fit your purpose.

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    17

    Re: Displaying Numbers, strings and dialog

    Thanks, but I need to display the text and number on same line without using dialogs.
    And the number is a variable (random) not fixed.
    Quote Originally Posted by symbianyucca View Post
    you could maybe try multiline query dialogs, something like this one: http://wiki.forum.nokia.com/index.ph...secret_editors

    just change teh control and modify the resource to fit your purpose.

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Displaying Numbers, strings and dialog

    Thanks, but I need to display the text and number on same line without using dialogs.
    Why don't you simply use CGraphicsContext:rawText() . With the help of this function, you can show your text and number in a single line and that too without showing any dialog (as per your requirement).

    If I am understanding rightly then this is what you want?

  5. #5
    Registered User
    Join Date
    Mar 2011
    Posts
    17

    Re: Displaying Numbers, strings and dialog

    I have 3 buffers containing 2 numbers and 1 string e.g. numbers 1, 2 and string "over".
    I would love to display to screen "1 over 2". so i could also display "3 over 4" without changing my codes but just d input.
    Note: 1 and 2 are not constants but variables that change with time or user input so I cannot make them static
    Quote Originally Posted by not_dying View Post
    Why don't you simply use CGraphicsContext:rawText() . With the help of this function, you can show your text and number in a single line and that too without showing any dialog (as per your requirement).

    If I am understanding rightly then this is what you want?

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

    Re: Displaying Numbers, strings and dialog

    What excatly are those variables having ? and how excatly should they be shown ?

    just wodering that you should know that you can indeed put numbers other character in descriptor and show together, and thus show together.

  7. #7
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: Displaying Numbers, strings and dialog

    Are you trying to display strings like "1 over 2" on the screen where 1 and 2 are dynamic? one way to achieve this to use following

    Code:
    void CMyAppView::DisplayString(TInt aNumOne, TInt aNumTwo)
    	{	
    	_LIT(KFormat,"%d over %d");
    	iDisplayString.Format(KFormat(), aNumOne, aNumTwo);
    	DrawNow();
    	}
    and in draw method

    Code:
    void CMyAppView::Draw(const TRect& /*aRect*/) const
    	{
    	CWindowGc& gc = SystemGc();
    	TRect drawRect(Rect());
    	gc.Clear(drawRect);
    	gc.UseFont(iCoeEnv->NormalFont());
    	gc.DrawText(iDisplayString, TPoint(0, Rect().Height()/2));
    	gc.DiscardFont();
    	}

  8. #8
    Registered User
    Join Date
    Mar 2011
    Posts
    17

    Re: Displaying Numbers, strings and dialog

    The variables are integers that are generated based in time.
    I'm stuck because the number should always change and "other characters" are fixed.
    Quote Originally Posted by symbianyucca View Post
    What excatly are those variables having ? and how excatly should they be shown ?

    just wodering that you should know that you can indeed put numbers other character in descriptor and show together, and thus show together.

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Displaying Numbers, strings and dialog

    Slinx's code does exactly that.

Similar Threads

  1. Chinese strings are not displaying properly
    By jinuthomas in forum Symbian
    Replies: 4
    Last Post: 2009-03-17, 11:08
  2. Text Direction issue with displaying strings
    By iyuen in forum Mobile Java General
    Replies: 4
    Last Post: 2007-04-01, 00:55
  3. Replies: 0
    Last Post: 2005-11-02, 18:33
  4. Displaying list box and dialog within same view without overlapping
    By varshajohn in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-02-03, 07:57
  5. receiving and displaying numbers
    By don_tom in forum Bluetooth Technology
    Replies: 0
    Last Post: 2002-12-10, 20:58

Posting Permissions

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