×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    12

    Display Text to User on Display

    I was wondering of somebody could provide me some direction.

    I want to display text to the user as the user presses keys. I don't want an information note. I want the text to remain until another key is pressed. For example, if the User presses the '3' key, I would want to display "3 pressed".

    As I said before, I don't what an 'information note' style display. I can't seem to find any examples like this. If anyone has any suggestions, or can point me in the right direction, it would be much appreciated.

    Cheers,
    Grant

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143
    You could make your own CCoecontrol based class that you draw on top of your container.

    yucca

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    12
    Thanks,

    Can you point me to an example that does this?

    Cheers,
    Grant

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    12
    I found an example in HelloWorldPlus that may be some use ... although I am still unsure. The view's draw function looks like this:

    // Get the standard graphics context
    CWindowGc& gc = SystemGc();

    // Gets the control's extent
    TRect rect = Rect();

    // Clears the screen
    gc.Clear(rect);

    TTime currentTime;
    currentTime.HomeTime();

    // format the time into a descriptor, and handle any errors
    TBuf<32> timeAsText;
    // if (nKey.GetKey() == 1) {

    // query what the current time is

    _LIT (KTimeFormat, "%H : %T : %S");
    _LIT (KTimeError, "Error formatting the time!");
    TRAPD (err,
    currentTime.FormatL(timeAsText, KTimeFormat););
    if (err != KErrNone)
    {
    timeAsText = KTimeError;
    }
    gc.UseFont(iCoeEnv->NormalFont());
    gc.DrawText(timeAsText, TPoint(30,30));


    The UI calls the Draw function when a menu event is triggered, which inturn updates the date.

    I'm not interested in the date. I'd like to pass a literal to the draw function after a key has been hit, but so far I've been unsuccessful. Any ideas of how I could pass information to the draw function based on what key has been hit?

Posting Permissions

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