×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Nov 2004
    Posts
    52

    pointer movement on the screen

    I'd like to implement movement of the rectangle (pointer):

    draw function:
    g.SetDrawMode(CGraphicsContext::TDrawMode::EDrawModeXOR);
    g.SetPenColor(AKN_LAF_COLOR(0));
    g.DrawRect(TRect(TPoint(20,20), TPoint(80,80) )) ; // draw

    OfferKeyEventL: if (aKeyEvent.iScanCode == EStdKeyRightArrow) ...
    and again in draw function:
    g.DrawRect(TRect(TPoint(20,20), TPoint(80,80) )) ; // erase old
    g.DrawRect(TRect(TPoint(25,20), TPoint(85,80) )) ; // draw new

    For it I need have public member
    CWindowGc& gc;
    But I can't set gc = SystemGc() inside the
    void CCoeControl:raw(const TRect& aRect) const

    What can I do with it ???? How usually pointer movement implemented?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    basically you should do all of the drawing inside your Draw function, and in there you can get the gc and use it safely.

    Basically to make it work you just define the point variables as member variables of your drawing class. Then in offer key you just chnage the values for them and call DrawNow(), then when the Draw function is executed, you just use the poit variables to determine the places to draw on your screen.

    yucca

Posting Permissions

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