×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    30

    How to get focus on a rectangle drawn through CWindowGc

    I am working on 3rd edition. My class is deriving from CCoeControl and i am not using any of the controls.

    I have drawn 4 rectangles. How can i use up and down key to navigate through these rectangles and
    detect click event.

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

    Re: How to get focus on a rectangle drawn through CWindowGc

    Implement OfferKeyEventL and your internal mechanism for tracking which rectangle is "focused".

  3. #3
    Nokia Developer Moderator
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: How to get focus on a rectangle drawn through CWindowGc

    You can check this article in Wiki - Custom control: Focusing

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    30

    Re: How to get focus on a rectangle drawn through CWindowGc

    Quote Originally Posted by A.A.M. View Post
    You can check this article in Wiki - Custom control: Focusing
    The example uses CEikLabel so the function void UpdateControls(); works.

    how can i set focus on rectangle drawn using Cwindowsgc.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,566

    Re: How to get focus on a rectangle drawn through CWindowGc

    Draw it using an other color...

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    30

    Re: How to get focus on a rectangle drawn through CWindowGc

    I am implementing "OfferKeyEventL" in my class derived from CCoeControl but its not getting called on up or down key press.

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,566

    Re: How to get focus on a rectangle drawn through CWindowGc

    Do not forget adding your control to the Control Stack: call AddToStackL in the AppUi (preferably in ConstructL - and removing the control is also a good idea in the destructor).

  8. #8
    Registered User
    Join Date
    May 2009
    Posts
    30

    Re: How to get focus on a rectangle drawn through CWindowGc

    yeah i'm adding the AppView to Control Stack: calling AddToStackL in the AppUi.

Similar Threads

  1. WRTkit focus highlight style problems
    By hp3 in forum Symbian Web Runtime
    Replies: 1
    Last Post: 2010-02-16, 08:21
  2. Set focus to a control
    By logan04x in forum Symbian C++
    Replies: 7
    Last Post: 2009-01-28, 04:57
  3. Replies: 0
    Last Post: 2008-03-25, 11:33
  4. Replies: 0
    Last Post: 2006-07-24, 10:43
  5. change focus
    By f_alonso_1 in forum Symbian C++
    Replies: 0
    Last Post: 2003-07-17, 13:34

Posting Permissions

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