Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User chandrasekharan's Avatar
    Join Date
    Jul 2007
    Posts
    47
    i have done a small modification on the existing editor program available with the softwre. here i have added a new menu and 2 submenus. this menu is to change the color of the screen. . i have just added the submenu, to check whether its goin go the loop i habe added some prointf's. it is working, but not done anything to change the color.

    i have given 2 colors. what i want to do is when i click on the blue color submenu the screen should change to blue color. now its the default(white)color. i am currenlty trying the program in emulator. can anybody help me to proceed.

  2. #2
    Registered User nuker85's Avatar
    Join Date
    May 2007
    Location
    Poland
    Posts
    606
    Hello
    Everything depends on how do you change background color. Could you give more details?

    If you change pen color and draw rectangle on the screen to change color, don t forget to call drawNow() function which will redraw your screen.

    good luck

  3. #3
    Registered User chandrasekharan's Avatar
    Join Date
    Jul 2007
    Posts
    47
    alrite.. i am new to symbian what i am doing is trial and error. will u be able to tell me where i should call this Draw function. is it the below mentioned function that i have to call?
    Draw( const TRect& aRect ) const

    more detials...
    what ever i am doing,i have mentioned in the first query. there is another example which comes with the software named multiviews. i am trying to implement the same thing. is it possible?

  4. #4
    Registered User nuker85's Avatar
    Join Date
    May 2007
    Location
    Poland
    Posts
    606
    hey,

    Yes i m talking about that Draw function

    In Draw function write:
    const CFont *ourFont3=CEikonEnv::Static()->TitleFont();
    gc.UseFont(ourFont3);
    gc.SetPenStyle(CGraphicsContext::ESolidPen);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.SetBrushColor(KRgbBlack);
    gc.DrawRect(TRect(TPoint(0,0),TPoint(176,208)));

    It draws black Rectangle on the screen. If you set different color and call drawNow() function it will redraw your screen

    Good luck

  5. #5
    Regular Contributor bnvaikos's Avatar
    Join Date
    Nov 2006
    Location
    India
    Posts
    170
    Hello,

    FYI-- from sdk documentation
    DrawNow() is implemented by CCoeControl and MAY NOT be overridden. It calls Draw() on the control itself, and also on all its component controls, if it is a compound control.(To do this it uses CountComponentControls() and ComponentControl(), which should be implemented by the derived control class.) If the control is a window-owning control, it also calls Draw() for its child windows (if any).

    regards
    bnvaikos

  6. #6
    Registered User chandrasekharan's Avatar
    Join Date
    Jul 2007
    Posts
    47
    i am getting an WSERV 9 error. what can be the reason for it???

  7. #7
    Super Contributor peter_k_john's Avatar
    Join Date
    Oct 2005
    Posts
    739
    Quote Originally Posted by chandrasekharan
    i am getting an WSERV 9 error. what can be the reason for it???
    You will get the details of such erros from SDK help.

    Here is the description for WSERV 9
    HTML Code:
    Attempted to use a non-active graphics context. 
    
    A drawing request was sent to a graphics context when the context was not active. 
    
    On the server side, this panic is raised by CWsGc::CommandL() on all requests received when the context isn’t active except EWsGcOpActivate, EWsGcOpDeactivate, EWsGcOpFree, and EWsGcOpTestInvariant.
    reagrds,
    Peter

  8. #8
    Registered User chandrasekharan's Avatar
    Join Date
    Jul 2007
    Posts
    47
    how do i get out of this WSERV 9 problem?

  9. #9
    Super Contributor peter_k_john's Avatar
    Join Date
    Oct 2005
    Posts
    739
    Quote Originally Posted by chandrasekharan
    how do i get out of this WSERV 9 problem?
    Hi,
    I don't know how to solve this. But there is a point from SDK documentation for WSERV panic
    HTML Code:
    Note that some panics are raised in debug builds only.
    so try with device, sometimes it may work in device without this error.

    Regards,
    Peter

  10. #10
    Registered User chandrasekharan's Avatar
    Join Date
    Jul 2007
    Posts
    47
    i will certainly try that...

  11. #11
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Can it happen that you are invoking Draw for yourself?
    In that case invoke DrawNow instead, which is something like
    Code:
    CWindowGc& gc = SystemGc();
    gc.Activate(*DrawableWindow());
    Draw();
    gc.Deactivate();
    in fact.

Similar Threads

  1. Replies: 5
    Last Post: 2009-10-26, 06:58
  2. How to change the bg color of sms text? S40 2nd Edition
    By kukata in forum Themes/Carbide.ui
    Replies: 1
    Last Post: 2007-05-13, 14:11
  3. How to change CEikTextButton backgroung color
    By bashirpk in forum Symbian C++
    Replies: 0
    Last Post: 2006-10-04, 07:40
  4. Dynamically change the color of a PNG?
    By ericprat in forum Mobile Java Media (Graphics & Sounds)
    Replies: 13
    Last Post: 2006-04-28, 19:36
  5. Dynamic change background color
    By s2005 in forum Symbian C++
    Replies: 0
    Last Post: 2005-11-03, 21:37

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