×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    38

    Exclamation problem with function decleration

    hi friends h r u i am facing a problem with function
    void Caug27AppView::FirstScreenL(const TRect& aRect)
    {
    CWindowGc& gc = SystemGc();
    TRect drawRect(Rect());
    gc.SetBrush(TRgd(255,255,0));


    if(iBitmap)
    gc.BitBlt(TPoint(0,0),iBitmap);



    gc.BitBlt(TPoint(0, 270),iBitmap1);
    gc.BitBlt(TPoint(70,55),iBitmap2);
    gc.BitBlt(TPoint(70,105),iBitmap5);






    if(iKeyState & KControllerDown)
    {
    //gc.BitBlt(TPoint(70,105),iBitmap3);
    i=1;
    }

    if(i==1)

    {
    gc.BitBlt(TPoint(70,105),iBitmap4);
    gc.BitBlt(TPoint(70,55),iBitmap3);
    }


    if (iKeyState & KControllerUp)
    {
    // gc.BitBlt(TPoint(70,55),iBitmap2);

    i=2;
    }
    if(i==2)
    {
    gc.BitBlt(TPoint(70,55),iBitmap2);

    gc.BitBlt(TPoint(70,105),iBitmap5);
    }

    if(iKeyState & KControllerCentre)
    {
    z++;
    }
    if(z!=0)
    {
    if(i==1)
    {

    if(k==0)
    {
    gc.Clear(aRect);
    Caug27AppView* self2 = new (ELeave) Caug27AppView;

    self2->SecondScreenL(aRect);
    }
    if(k==1)
    {
    k--;
    Caug27AppView* self1 = new (ELeave) Caug27AppView;
    self1->FirstScreenL(aRect);

    }
    }
    }


    }
    void Caug27AppView::SecondScreenL(const TRect& aRect)
    {
    CWindowGc& gc = SystemGc();
    TRect drawRect(Rect());
    gc.BitBlt(TPoint(0,0),iBitmap);



    gc.BitBlt(TPoint(0, 270),iBitmap1);
    k++;

    }

    in the draw i declare as
    Caug27AppView* self1 = new (ELeave) Caug27AppView;
    self1->FirstScreenL(aRect);
    calling the firstscreen but what happing is it is going to function and setbrushcolour but not drwaing the image on screen what is problem with that .
    pls help me............ its urgent..................
    M.Narendra
    narendra.ajel@gmail.com

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

    Re: problem with function decleration

    This is not the way how Symbian applications draw to the screen.
    Normally you should put your drawer code into the Draw method of a CCoeControl, and it is going to be invoked when the OS determines that your screen should be redrawn - including explicit requests for that (DrawNow/Deferred).
    There is a hacky way too, its minimal set is invoking ActivateGc, then you can use it, then invoke DeactivateGc - however these methods are also part of CCoeControl. One step forward is using CWindowGc::Activate/Deactivate, which requires you to supply a window object.
    Note that it might seem attracting to be able to draw any time on the screen, but the Application Framework and the OS itself also does that sometimes, then your random drawings will disappear - unless you provide a way of restoring them. And following the conventional CCoeControl-oriented pattern is far the most easiest way.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    38

    Re: problem with function decleration

    Quote Originally Posted by wizard_hu_ View Post
    This is not the way how Symbian applications draw to the screen.
    Normally you should put your drawer code into the Draw method of a CCoeControl, and it is going to be invoked when the OS determines that your screen should be redrawn - including explicit requests for that (DrawNow/Deferred).
    There is a hacky way too, its minimal set is invoking ActivateGc, then you can use it, then invoke DeactivateGc - however these methods are also part of CCoeControl. One step forward is using CWindowGc::Activate/Deactivate, which requires you to supply a window object.
    Note that it might seem attracting to be able to draw any time on the screen, but the Application Framework and the OS itself also does that sometimes, then your random drawings will disappear - unless you provide a way of restoring them. And following the conventional CCoeControl-oriented pattern is far the most easiest way.
    thankyou for replying please give me some example code to do it ....................
    M.Narendra
    narendra.ajel@gmail.com

  4. #4
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: problem with function decleration

    Hi,

    You can find helloworldplus example in 2nd sdk s60ex folder it draws date and time on the screen. I hope if you start with the example will be helpful to you.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  5. #5
    Registered User
    Join Date
    Aug 2009
    Posts
    38

    Exclamation Re: problem with function decleration

    [QUOTE=kkrish;640015]Hi,

    sorry ididnt find that example thax for your reply
    M.Narendra
    narendra.ajel@gmail.com

Similar Threads

  1. Problem with exporting a class function
    By swapnil_mahajan in forum Symbian
    Replies: 5
    Last Post: 2009-07-10, 13:44
  2. Problem in view() function please help me
    By thilsen_06 in forum Symbian
    Replies: 3
    Last Post: 2007-04-09, 16:20
  3. Problem in View function Please help
    By thilsen_06 in forum Symbian
    Replies: 1
    Last Post: 2007-01-23, 08:32
  4. Newbie Here - Function Problem
    By EtsiEtsi in forum Symbian
    Replies: 6
    Last Post: 2005-10-11, 18:42
  5. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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