User inputs from Editbox

5 posts / 0 new
Last post
noddy
noddy's picture
Offline
Mobile Conjurer
Joined: 20 Aug 2010
Posts:
User inputs from Editbox

Hello everyone,

I am new to MoSync and am running MoSync nightly build r1755.

I have seen the examples, but I can't see to find an example demonstrating how to read the user inputs from editboxes. I noticed the class MAUI::EditBoxListener in Editbox.h, but no related examples. For example, if I am doing a + b = c, when user inputs numbers in EditBox a and EditBox b, EditBox C (or a Label type) will display the result.

Does anyone know how this can be done?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Fredrik Eldh
Fredrik's picture
Offline
Mobile Sorcerer
Joined: 16 Feb 2009
Posts:

EditBox::getText() returns the text.

Then you could use MAUtil::stringToInteger() or MAUtil::stringToDouble() to convert the text to calculatable numbers.

noddy
noddy's picture
Offline
Mobile Conjurer
Joined: 20 Aug 2010
Posts:

Hi Fredrik,

Thank you for your reply. I understand EditBox::getText() returns the text entered. But what kind of event should I add so that any changes in EditBox a or b will result in a recalculation and screen being refreshed with new result? i.e., all in the same screen.

Are there any working examples of a simple a+b=c or something similar done in the same screen?

Thank you for your help.

noddy
noddy's picture
Offline
Mobile Conjurer
Joined: 20 Aug 2010
Posts:

I think I figured it out.. I can add my code to selectionChanged().

mdfazlarabbi_cse
mdfazlarabbi_cse's picture
Offline
Joined: 19 Mar 2011
Posts:

Hello everyone,
I am new in MoSync. I want to develop 3 Textbox and a Button. In first 2 Textbox i want to insert some Integer values and when i click on Button then the sum is shown in Textbox number 3.

Please anyone help me with full source code.