Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Regular Contributor juliaf's Avatar
    Join Date
    Nov 2004
    Posts
    52
    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 Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,664
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved