MobGUI Native input issues
Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21
MobGUI Native input issues
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 ?
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: MobGUI Native input issues
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 ..
or
Check out http://mobgui.com/doc.php?docId=19 or page 39 of the PDF V1.1 manual
HTH
Code: Select all
mobileControlSet "MyMultilineField", "text", gVariableToTrack
Code: Select all
set the mgText of group "MyMultilineField" to gVariableToTrack
HTH
LiveCode Development & Training : http://splash21.com
Re: MobGUI Native input issues
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.
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.
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: MobGUI Native input issues
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...
You can code each control just as you would normally
Code: Select all
on openControl
mobileControlSet "MyMultilineField", "text", gVariableToTrack
.....
LiveCode Development & Training : http://splash21.com
Re: MobGUI Native input issues
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
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
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: MobGUI Native input issues
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
Re: MobGUI Native input issues
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 488 times
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: MobGUI Native input issues
Hi, benghere. I made one change to the script in Multiline-1493;
I changed ...
to ...
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.
I changed ...
Code: Select all
mobileControlSet "Multiline-1493", "text", ghelpCount
Code: Select all
mobileControlSet "Multiline-1493", "text", "" & ghelpCount
LiveCode Development & Training : http://splash21.com
Re: MobGUI Native input issues
Thank you. I was really stumped with this.
Re: MobGUI Native input issues
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
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