MobGUI Native input issues

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
benghere
Posts: 14
Joined: Wed Jan 15, 2014 12:33 am

MobGUI Native input issues

Post by benghere » Thu Jan 23, 2014 9:16 pm

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 ?

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: MobGUI Native input issues

Post by splash21 » Thu Jan 23, 2014 10:31 pm

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
LiveCode Development & Training : http://splash21.com

benghere
Posts: 14
Joined: Wed Jan 15, 2014 12:33 am

Re: MobGUI Native input issues

Post by benghere » Fri Jan 24, 2014 3:52 am

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.

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: MobGUI Native input issues

Post by splash21 » Fri Jan 24, 2014 11:44 am

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 :)
LiveCode Development & Training : http://splash21.com

benghere
Posts: 14
Joined: Wed Jan 15, 2014 12:33 am

Re: MobGUI Native input issues

Post by benghere » Tue Jan 28, 2014 2:07 pm

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

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: MobGUI Native input issues

Post by splash21 » Tue Jan 28, 2014 4:52 pm

The snippet you've posted should work OK (unless there's something else going on...) - can you post a stack?
LiveCode Development & Training : http://splash21.com

benghere
Posts: 14
Joined: Wed Jan 15, 2014 12:33 am

Re: MobGUI Native input issues

Post by benghere » Tue Jan 28, 2014 7:34 pm

Thank you. I have zipped and attached the stack(stripped of images)
Attachments
Game_plan_new copy.livecode 2.zip
Stack
(175.55 KiB) Downloaded 439 times

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: MobGUI Native input issues

Post by splash21 » Tue Jan 28, 2014 9:44 pm

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
LiveCode Development & Training : http://splash21.com

benghere
Posts: 14
Joined: Wed Jan 15, 2014 12:33 am

Re: MobGUI Native input issues

Post by benghere » Tue Jan 28, 2014 10:55 pm

Thank you. I was really stumped with this.

drkosta
Posts: 34
Joined: Wed May 22, 2013 8:40 pm
Location: Stuttgart / Germany
Contact:

Re: MobGUI Native input issues

Post by drkosta » Tue Feb 10, 2015 2:19 pm

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

Post Reply

Return to “MobGUI”