Page 1 of 1

MobGUI Native input issues

Posted: Thu Jan 23, 2014 9:16 pm
by benghere
I am trying to use the mobgui native multiline to display the value of a global variable I am tracking. Sorry if this is not the right place but I cannot figure out how to do it. An example would be really appreciated. Do I need to use mobileControlCreate if I am using mobgui ? How do I display a text in this ? Or am I totally off and this is only for input ?

Re: MobGUI Native input issues

Posted: Thu Jan 23, 2014 10:31 pm
by splash21
Hi, benghere. You can just drag the control on to your card and it will be created on the simulator / device. To set the text of a multiline, you can use ..

Code: Select all

mobileControlSet "MyMultilineField", "text", gVariableToTrack
or

Code: Select all

set the mgText of group "MyMultilineField" to gVariableToTrack
Check out http://mobgui.com/doc.php?docId=19 or page 39 of the PDF V1.1 manual

HTH :D

Re: MobGUI Native input issues

Posted: Fri Jan 24, 2014 3:52 am
by benghere
Thank you for the quick help. Yes I did see those documents, but was confused. I did "Edit Behavior" and I added to

before openControl
mobileControlSet "MyMultilineField", "text", gVariableToTrack
...
and it adds it to the multiline but,

I have another multiline in another card and this change in behavior(above) affects all the multiline controls (ie setting this global variable) . I am sure this is because I am changing
the behavior of this control.
I was looking for a way to set the text of a single multiline to a value (to display to user) say on the click of a button.

Re: MobGUI Native input issues

Posted: Fri Jan 24, 2014 11:44 am
by splash21
Ah - OK! If you edit the behavior script, then yes - all controls will be affected that use the same behavior. If you just edit the control's own script, you can achieve what you're after...

Code: Select all

on openControl
  mobileControlSet "MyMultilineField", "text", gVariableToTrack
  .....
You can code each control just as you would normally :)

Re: MobGUI Native input issues

Posted: Tue Jan 28, 2014 2:07 pm
by benghere
Thank you I tried that but running into a weird issue.

on openControl
global ghelpCount
if the environment="mobile" then
answer ghelpCount
mobileControlSet "Multiline-1493", "text", ghelpCount
end if
end openControl

The answer command displays the count properly but the text is not displayed in the multiline control. Stranger still is that if I do
mobileControlSet "Multiline-1493", "text", 100 (or any other number) it displays correctly. A real head scratcher. Thank you

Re: MobGUI Native input issues

Posted: Tue Jan 28, 2014 4:52 pm
by splash21
The snippet you've posted should work OK (unless there's something else going on...) - can you post a stack?

Re: MobGUI Native input issues

Posted: Tue Jan 28, 2014 7:34 pm
by benghere
Thank you. I have zipped and attached the stack(stripped of images)

Re: MobGUI Native input issues

Posted: Tue Jan 28, 2014 9:44 pm
by splash21
Hi, benghere. I made one change to the script in Multiline-1493;

I changed ...

Code: Select all

mobileControlSet  "Multiline-1493",  "text",  ghelpCount
to ...

Code: Select all

mobileControlSet  "Multiline-1493",  "text",  "" & ghelpCount
and it works. I'm not sure what LC doesn't like about setting the text of the native multiline to the global variable containing the number, but adding the empty string to the variable then setting the text is a workaround that should get things working.

:D

Re: MobGUI Native input issues

Posted: Tue Jan 28, 2014 10:55 pm
by benghere
Thank you. I was really stumped with this.

Re: MobGUI Native input issues

Posted: Tue Feb 10, 2015 2:19 pm
by drkosta
Hi,

I created an App for iOS and used MobGui 30 to design the UI and to put some textInput Controls on the card. On iOS it looks like I was design in the IDE. But on Android the contents of fields are not shown correctly. They are above the midline and in smaller fields they are even not shown (to far above the midline). (see attached screenshots) I changed in Mobgui the Template to "Android" but this didnĀ“t helped.

Further, the option "auto delete" when start entering the text works on iOS but not on Android. Any suggestions?

Thanks in Advance

Kosta
IMG_3010.PNG.png
native Controls on iOS
Screenshot_2015-02-10-11-58-32 Kopie.png
native Controls in Android