You Are Here:

Community: Developer Discussion Boards

#1 Old [moved] UI: user text input on canvas - 2008-10-26, 09:08

Join Date: Oct 2008
Posts: 29
mango7
Offline
Registered User
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.
Reply With Quote

#2 Old Re: UI: user text input on canvas - 2008-10-26, 09:22

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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 16:09.
Reply With Quote

#3 Old Re: [moved] UI: user text input on canvas - 2008-10-26, 16:04

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
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 16:43.
Reply With Quote

#4 Old Re: UI: user text input on canvas - 2008-10-27, 06:22

Join Date: Oct 2008
Posts: 29
mango7
Offline
Registered User
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)?
Reply With Quote

#5 Old Re: UI: user text input on canvas - 2008-10-27, 08:37

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#6 Old Re: UI: user text input on canvas - 2008-10-27, 13:34

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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
Reply With Quote

#7 Old Re: [moved] UI: user text input on canvas - 2008-10-27, 16:33

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
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 18:21.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Nokia 6300 limiting user input aib Mobile Java General 5 2008-10-08 15:04
How to have user input string of only digits yqmtooblue Python 3 2007-12-06 15:33
A large number of text leads to App. closed: lcdui USER 130 iloveyiyi Mobile Java General 3 2007-10-09 10:33
How to get numeric input from user in Text mode(NOT GUI)??? Amit Mahajan Symbian User Interface 4 2006-04-13 06:35
Notifications of changing text input mode GuusDavidson Symbian User Interface 0 2005-11-07 06:05

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia