×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jan 2005
    Location
    Helsinki, Finland
    Posts
    257

    How to make text editor exactly like S60 default sms editor?

    Hello,

    I am making an application where I need a text editor to edit a sms message. I want to make my sms editor exactly like default sms editor of S60. Especially I would like to know how could I have blue lines under my text normally we could see in default sms editor? Any hit or related link will be appreciated.

  2. #2
    Registered User
    Join Date
    Jul 2005
    Posts
    190

    Exclamation Re: How to make text editor exactly like S60 default sms editor?

    Can anyone put light on this!!

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    6

    Re: How to make text editor exactly like S60 default sms editor?

    Very difficult..
    You should study and investigate further.
    I am also studying this topic. We can have a contact if you have found a way to resolve this problem.

  4. #4
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    416

    Re: How to make text editor exactly like S60 default sms editor?

    Can be the solution based on tweaking CEikEdwin in a container?

    Thank you.

    UPDATE:

    There is a CSendUi api where some functions require DRM capabilities. Here is an example:

    http://wiki.forum.nokia.com/index.ph..._or_MMS_Editor
    Last edited by elviin; 2009-06-23 at 17:33.

  5. #5
    Registered User
    Join Date
    Feb 2007
    Posts
    27

    Re: How to make text editor exactly like S60 default sms editor?

    It's simple and easy with the help of htmlcontrol.

    Code:
    _LIT(KStyle, "input[type=text]:focus {border:0}\
       textarea:focus {border:0}");
    iControl->AddStyleSheetL(KStyle);
    
    _LIT(KHtml, "<body style='background-image:skin#1000;'>\
       <div style='width:100%; padding-left:10; padding-right:5'>\
       To: <input type='text' direct-focus='true' style='width:auto; border:0; border-bottom:1; background-color:none'>\
       </div>\
       <textarea direct-focus='true' style='width:auto; height:auto; border:0; background-color:none'
          draw-lines='true'></textarea>");
    iControl->AppendContentL(KHtml);
    iControl->RefreshAndDraw();
    http://htmlcontrol-for-symbian.googl...-20_121534.jpg
    HtmlControl for Symbian
    http://code.google.com/p/htmlcontrol-for-symbian/

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: How to make text editor exactly like S60 default sms editor?

    Those under line are image. You need to draw these image in your control according to Font size.

  7. #7
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    416

    Re: How to make text editor exactly like S60 default sms editor?

    Hello,

    to create message editor I have used Carbide Design UI editor. Added form, and nested two "Text editors" controls inside the form. From the behavior point of view it is fine. Except layout and menu issues. Before I stuck with this solution I would like to know some details.

    Menu issue - ignored custom Options
    I have added my custom menu MenuBar1.
    See the picture. The problem is that when I want to select these options from "Options", there is a Save option (instead my own options) displayed. See the picture.

    Layout issue - lines added one by one even I have set 7 lines
    When typing I would like to have the whole editor displayed. But the lines are added according to the size of the text inside. Second problem is the prompt (prompt is the text similar to "To:", but in the second text editor it is missing). I would like to remove the prompt. See the picture.

    I think that this is promising way to create custom message editor, if I can remove the unwanted "Save" option, prompt and make the editor to fill the form. If I used Global Text editor component in the Container, the label colors are green and the background is white - I know that is possible to tune it up. But Text editor in the Form view looks quite good from default - with just two issue mentioned above.

    Another approach I tested was based on container view including three Edit's. I used the following code in ConstructL method to set up the background for these controls. But the background is still white with green font. To reach the transparent background as it is common layout I passed the iScViewBackground instance with empty Draw method to Setbackground

    Code:
        iScViewBackground = CScViewBackground::NewL();
        SetBackground(iScViewBackground); 
        
        InitializeControlsL();
        
        iEdit1->SetParent(this); iEdit1->SetMopParent(this);
        iEdit2->SetParent(this); iEdit2->SetMopParent(this);
        iEdit3->SetParent(this); iEdit3->SetMopParent(this);
        
        SetRect( aRect );
        ActivateL();
    Attached Images Attached Images
    Last edited by elviin; 2009-06-26 at 14:41.

  8. #8
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    416

    Re: How to make text editor exactly like S60 default sms editor?

    So I decided not to use the Form but Container view template. Here is the result. Still not satisfying. Using three nested CEikEdwin's I managed to display them as I wanted except the background. The bg is transparent only under the controls not under the container itself. Here is the picture.

    Using MCoeControlBackground and its implementation does not help. The container from some reason ignores my background quite effectively. So setting the custom background has practically no effect:

    Code:
        iScViewBackground = CScViewBackground::NewL(); //empty Draw method.
        
        SetBackground(iScViewBackground );
    Attached Images Attached Images

  9. #9
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    416

    Unhappy Re: How to make text editor exactly like S60 default sms editor?

    UPDATE:
    UI editor has overwritten this impementation in the container's Draw method. After I put it back, the background is transparent:

    Code:
        // Get the standard graphics context
        CWindowGc& gc = SystemGc();
          
        // Redraw the background using the default skin
        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
        MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
        AknsDrawUtils::Background( skin, cc, this, gc, aRect );
    How do I replace the white background with the default one? I mean where i can get the default bg. I tried this:


    Code:
    void CMessageEditorContainer::Draw( const TRect& aRect ) const
        {
        // [[[ begin generated region: do not modify [Generated Contents]
    //    CWindowGc& gc = SystemGc();
    //    gc.SetPenStyle( CGraphicsContext::ENullPen );
    //    TRgb backColor = iEikonEnv->Color( ( TLogicalColor ) EEikColorControlDimmedBackground );
    //    gc.SetBrushColor( backColor );
    //    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
    //    gc.DrawRect( aRect );    
        
        // ]]] end generated region [Generated Contents]
        
        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
        CFbsBitmap* defaultBackground = NULL;
        
        if( skin )
         {
            defaultBackground = AknsUtils::CreateBitmapL( skin, KAknsIIDQsnBgAreaMain); //system error -1 -> WSERV 10
    
         }
        
        CWindowGc& gc = SystemGc();
        gc.BitBlt(TPoint(0,0), defaultBackground);
        
        }
    But calling cached bitmap is ok but with the dimmed controls below.

    defaultBackground = AknsUtils::GetCachedBitmap( skin, KAknsIIDQsnBgAreaMain );

    So as it is written in the post below I can set up the background context using KAknsIIDQsnBgAreaMain but in this case it crashes..:( I just want to replace the white color with the default background. The problem is illustrated here. http://discussion.forum.nokia.com/fo...3&d=1246025650
    Last edited by elviin; 2009-06-26 at 16:51.

  10. #10
    Registered User
    Join Date
    Jun 2008
    Posts
    283

    Smile Re: How to make text editor exactly like S60 default sms editor?

    can u attach your sms modifiable editor and share us with your information to reuse your editor without CSendUi(non modifiable)?
    Ahmed Mahfouz
    Researcher
    Handset

Similar Threads

  1. Replies: 2
    Last Post: 2007-11-10, 14:19
  2. SMS with S60 emulator
    By rajuk_2004 in forum General Messaging
    Replies: 0
    Last Post: 2005-11-14, 12:52
  3. SMS PDU in text format
    By olivier_randria in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-10-27, 17:03
  4. linked SMS with text messages
    By timwai in forum Smart Messaging
    Replies: 1
    Last Post: 2002-10-23, 06:51

Posting Permissions

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