How to draw string without using Draw()
| Tue, 2006-09-26 08:44 | |
|
Hi Experts,
Can anybody tell me that how to draw string, image etc apart from Draw() function. Actually in my application i am requesting to server for data and i want to show message to user when server has finished work. So user can continue. For this i want to show some message to user but dont want to use DrawNow() because it call Draw() and i dont want to call Draw(). I heard about some functon BeginDraw() and EndDraw() but how to use them? Please help me. ![]() Thanks in advance Kuldeep |
|







Forum posts: 64
Try this:
CWindowGc &gc = SystemGc();
gc.Activate( Window() );
gc.UseFont( iCoeEnv->NormalFont() );
gc.DrawText( ptext, TPoint( 10, 20 ) );
gc.Deactivate();
...
Regards,
Damian
Confusion will be my epitaph..
Forum posts: 34
U wanna inform the user na.. then use information note after server finishes the work.
_LIT(KMessage,"The Message");
CAknInformationNote* informationNote = new (ELeave)Â Â
                              CAknInformationNote;
informationNote->ExecuteLD(KMessage);
Hope this helps uÂ
Regards,
Shilpa K
Forum posts: 11
I m drawing some text in draw function , working fine, but I want to draw my text in my own custom function i.e. want to redraw the text. that is giving error WSERV 9.
TRied ur idea -
gc.Activate( Window() );
....
gc.Deactivate();
Not giving any error but not drawing any contentes alos...
can u plz advise?
Forum posts: 64
Are you calling your own function from Draw()? If not, you have to call ActivateGc() before and DeactivateGc() after calling your own function, cause the standard graphics context needs to be activated and deactivated manually (in case of Draw() function these methods are called by the framework).
If this is not the case, please provide some more information or source code.
Hope this helps,
Damian
Confusion will be my epitaph..
Forum posts: 11
Thanks very much for your reply. It helped me alot but my problem is not solved yet.
I am calling my function from CMyAppUi as -
{
switch ( aCommand )
{
case EAknSoftkeyBack:
{
iAppContainer->DrawMyText(_L("Hello My Text"));
break;
}
case EEikCmdExit:
{
Exit();
break;
}
and the problem is this is working only with case EAknSoftkeyBack, on other menu items it is not showing any thing.
my Draw function is -
{
ActivateGc();
m_BufDrawText.Zero();
m_BufDrawText.Copy(aText);
CWindowGc &gc = SystemGc();
gc.Activate( Window() );
gc.UseFont( iCoeEnv->NormalFont() );
gc.DrawText( m_BufDrawText, TPoint( 30, 30 ) );
gc.Deactivate();
DeactivateGc();
}
for gc.Activate( Window() ); ....gc.Deactivate(); It is giving WSERV 10.
I want to work my DrawMyText() with any menu commmand...
hope u can help
thanks
Forum posts: 62
here is the description for WSERV 10 panic
On the server side, this is raised by CWsGc::Activate() as a response to a EWsGcOpActivate request.
The request is sent by the client-side method CWindowGc::Activate().
I think you can comment the codes
gc.Activate( Window() ); and
gc.Deactivate();
and try....
hope this helps..
regards
Badshah
Forum posts: 11
Actully that gc.Activate( Window() ); and gc.Deactivate(); is commented only, I just forgot to put the comment before putting in to forum.
ActivateGc();
DeactivateGc();
is working well but on system keys only like EAknSoftkeyBack not on my menu command
Forum posts: 64
I suggest you should take a look at helloworldplus example from Series60Ex. There is a custom draw method:
Regards,
Damian
Confusion will be my epitaph..