×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    37

    Expanding text field in form

    Hi,

    I simply want an expanding text field in form. What I mean is a small text field that expands to covering the whole screen when start typing in it. Is this possible?

    I've tried to construct one myself by using on ordinary EEikCtEdwin as dialog line in the form and then when editing open a CEikEdwin control. The control seems to be shown behind the dialog (form), and I don't want to close the dialog.

  2. #2
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Expanding text field in form

    Hi,

    I guess it is possible
    Code:
    	iEdwin = static_cast<CEikEdwin*>(control);
    	iEdwin->ConstructL( EEikEdwinNoHorizScrolling | EEikEdwinNoAutoSelection | EEikEdwinResizable, 20, 100, 10 );

    This is the documentation for the constructL
    /**
    * Handles Symbian 2nd phase construction.
    * Completes construction of a new @c Edwin, initialising its heap-stored
    * members from the supplied arguments.
    *
    * @param aEdwinFlags Bitwise ORed combination of flags from @c TFlags.
    Default value is 0.
    * @param aWidthInChars Specifies the width for the Edwin, in characters or
    pixels: see the @c EWidthInPixels flag. Default value is 0.
    * @param aTextLimit Maximum length for the text to present as editable.
    Default value is 0.
    * @param aNumberOfLines Height for the Edwin, in lines. Default value
    is 0.
    */
    IMPORT_C void ConstructL(TInt aEdwinFlags=0,
    TInt aWidthInChars=0,
    TInt aTextLimit=0,
    TInt aNumberOfLines=0);
    Regards,
    Sriky

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    37

    Re: Expanding text field in form

    What do you mean? Using CEikEdwin inside of a CAknForm?
    EEikEdwinResizable wouldn't work when specifying a form in the rss file, would it?

    I only get one line when using an Edwin inside a form, like this:

    Code:
    RESOURCE FORM r_upload_info_form
    {
      flags = EEikFormUseDoubleSpacedFormat | EEikFormEditModeOnly;
      items =
      {
      DLG_LINE
      {
        type = EEikCtEdwin;
        prompt = "Ingress";
        id = EDlgLineIngress;
        itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys | EEikEdwinResizable;
        control = EDWIN
        {
          width = 32;
          maxlength = 1024;
        };
      }
    }
    I want it to be one line, but expand to the whole display when starting to edit. I've seen this in a Gmail app but don't know how they accomplished it.

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Expanding text field in form

    Quote Originally Posted by ekstrand_joachim View Post
    What do you mean? Using CEikEdwin inside of a CAknForm?
    EEikEdwinResizable wouldn't work when specifying a form in the rss file, would it?

    I only get one line when using an Edwin inside a form, like this:

    Code:
    RESOURCE FORM r_upload_info_form
    {
      flags = EEikFormUseDoubleSpacedFormat | EEikFormEditModeOnly;
      items =
      {
      DLG_LINE
      {
        type = EEikCtEdwin;
        prompt = "Ingress";
        id = EDlgLineIngress;
        itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys | EEikEdwinResizable;
        control = EDWIN
        {
          width = 32;
          maxlength = 1024;
        };
      }
    }
    I want it to be one line, but expand to the whole display when starting to edit. I've seen this in a Gmail app but don't know how they accomplished it.
    You could mention the number of lines you want. And which gmail app are u talking a pic would make things clearer.
    Regards,
    Sriky

  5. #5
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Expanding text field in form

    what you have seen in a gmail app is a j2me editor. it is a j2me applicaiton.
    Basically when you start typing the username field, they launch the editor of the phone, which can only start in fulll screen mode in j2me.

    so in symbian you need to write this code.
    This is doable in many ways, one of which i could think of is:
    when user presses button in the ediwin part of the form, launch another window (view) with a editor... and upon return from this view, load the contents written in the form's edwin box...
    Amit Kankani
    Nokia Developer Champion

  6. #6
    Registered User
    Join Date
    Oct 2008
    Posts
    37

    Re: Expanding text field in form

    Ah, it's j2me, of course it is different, thanks Amit!

    I'm trying something simular to what you suggested. My problem is that the form dialog will be on the top and the CEikEdwin window underneath. Can I get the dialog in the background or is this always on top?

    Also, if it's not possible to set the dialog in the background, is it possible to hide it? (Closing it and open it again wouldn't be a nice solution in my case)

  7. #7
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Expanding text field in form

    well what I understand as another way to do it, though I am again not sure if it is the best way, is to selectively set the rectangles of the dialog or form.

    So when you want the editor dialog to come on top, you set its rectangle to main screen and the rectangle of the form to out of screen....
    and vice versa

    do try and let know if this not so good technique work...
    Amit Kankani
    Nokia Developer Champion

  8. #8
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Expanding text field in form

    mm even I would have done the same
    Regards,
    Sriky

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Expanding text field in form

    I am not sure but you may want something like
    Code:
    control = EDWIN
    {
        flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
        maxlength = 200;
        max_view_height_in_lines=3;
    };

  10. #10
    Registered User
    Join Date
    Oct 2008
    Posts
    37

    Re: Expanding text field in form

    wizard_hu_:
    Great stuff! This is actually enought in this case. Thanks!

    amit/sriky:
    I found out that setting the area rectangle, SetRect(), on the CAknForm to a TRect(0, 0, 0, 0) works for hiding the form.

    Cheers,
    J

  11. #11
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Expanding text field in form

    cool, so u have a solution for edwin as winzard_hu suggested...

    however, if you come across any similar problems with other controls, you could use the SetRect trick ....
    Amit Kankani
    Nokia Developer Champion

Similar Threads

  1. How to assign a value to a form field?
    By bandz_fab in forum Symbian
    Replies: 2
    Last Post: 2006-11-10, 23:05
  2. How can I add a popup field to the form dynamically
    By stelee in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-09-05, 10:19
  3. Replies: 0
    Last Post: 2004-11-24, 18:49
  4. color text within a Form (stringItem)
    By zivgr in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-05-13, 14:54
  5. Text field entry duplicate key strokes
    By gwhistance in forum Mobile Java General
    Replies: 1
    Last Post: 2002-12-18, 11:05

Posting Permissions

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