×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    29

    [moved] UI: user text input on canvas

    I am developing a mobile application using PyS60, and would like to develop an attractive UI. I would like to use the following functionality:

    - allow the user to type onto the canvas

    I have not found any examples of this. Does anyone know if this is possible? Has anyone come across any good UI examples on PyS60?

    Thanks in advance for your expertise.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: UI: user text input on canvas

    You could detect keypresses and write the text on the canvas accordingly. But it might be tricky to switch between text and number mode.
    Or you could use a personalised version of appuifw.Text() with custom font color/size/style. And appuifw2 offers enhanced functionality.
    Last edited by bogdan.galiceanu; 2008-10-26 at 15:09.

  3. #3
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: [moved] UI: user text input on canvas

    This is quite easy:

    Code:
    import appuifw
    
    # creates an instance for the text
    
    tx = appuifw.Text()
    
    
    #sets app body to text
    
    appuifw.app.body = tx
    
    
    # sets the text font
    
    tx.font = u"Nokia Hindi S6016b"
    
    
    # sets text color - red in this case
    
    tx.color = (255,0,0)
    
    
    # sets text style - bold in this case
    
    tx.style = (appuifw.STYLE_BOLD)
    
    
    # adds text Hello World! to the screen
    
    tx.add(u"Hello World!")
    
    
    # returns unicode string with the screen text
    
    user_text = tx.get()
    
    
    # clears the text editor
    
    tx.clear()

    Hope it helps,

    Rafael.
    Last edited by Rafael T.; 2008-10-26 at 15:43.

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    29

    Re: UI: user text input on canvas

    Thanks Bogdan -

    It seems like the method you describe would not allow a person to input letters effectively, since each key corresponds to three letters. Am I correct?

    I would like to implement my own version of forms and add IM functionality. However, it is important that these features are in keeping with my application design that I will design on the canvas.

    Alternatively, perhaps it is possible to import images onto a text interface (appuifw.text)?

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: UI: user text input on canvas

    Quote Originally Posted by mango7 View Post
    Alternatively, perhaps it is possible to import images onto a text interface (appuifw.text)?
    hi mango7

    AFAIK you cant draw an image on appuifw.text(). You can draw an image using canvas class and then add text on that image.

    hope i got your question.

    Enjoy Pythoning
    Gaba88

  6. #6
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: UI: user text input on canvas

    Quote Originally Posted by mango7 View Post
    Thanks Bogdan -

    It seems like the method you describe would not allow a person to input letters effectively, since each key corresponds to three letters. Am I correct?

    I would like to implement my own version of forms and add IM functionality. However, it is important that these features are in keeping with my application design that I will design on the canvas.

    Alternatively, perhaps it is possible to import images onto a text interface (appuifw.text)?
    Yes, that's the problem. Three or four letters on each key. There might be an improvised solution: Detect keypresses and if the same key is pressed several times in a very short interval display the correct letter. It's a bit hard to explain but if you have a look at an example of detecting keypresses and use some variables to keep track of intervals between presses it should be possible. Though a lot of work

    And sadly it isn't possible to put images on appuifw.Text

  7. #7
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: [moved] UI: user text input on canvas

    It isn´t possible to display an image using appuifw.Text()

    You can use appuifw.Canvas() or if the image will be displayed just for some seconds you may put it on a Topwindow()

    For the keypress problem, unfortunately, the only solution is the one provided by Bogdan, which really needs lot of work.


    BR,

    Rafael.
    Last edited by Rafael T.; 2008-10-27 at 17:21.

Similar Threads

  1. Nokia 6300 limiting user input
    By aib in forum Mobile Java General
    Replies: 5
    Last Post: 2008-10-08, 14:04
  2. How to have user input string of only digits
    By yqmtooblue in forum Symbian
    Replies: 3
    Last Post: 2007-12-06, 14:33
  3. A large number of text leads to App. closed: lcdui USER 130
    By iloveyiyi in forum Mobile Java General
    Replies: 3
    Last Post: 2007-10-09, 09:33
  4. How to get numeric input from user in Text mode(NOT GUI)???
    By Amit Mahajan in forum Symbian User Interface
    Replies: 4
    Last Post: 2006-04-13, 05:35
  5. Notifications of changing text input mode
    By GuusDavidson in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-11-07, 05: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
  •  
×