Am I missing something in my code? [solved]

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, robinmiller, kevinmiller, malte, splash21

Post Reply
sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Am I missing something in my code? [solved]

Post by sms5138 » Wed Jul 15, 2015 1:11 am

Hi everyone!

I've run into a bit of a snag with mobGUI. I really like how it's been working so far, but wondered if anyone else has tried to set it such that a multiline input, or input field will move up when the keyboard is activated.

I've managed to get it such that the rectangle behind the multiline input, and the confirm button will move to the desired location, but the multiline input field remains stationary... wondered if there was something i'm missing. when just trying to move the multiline input field i use the following:

Code: Select all

on openCard
   if environment() = "mobile" then
      mobileControlCreate "input"
      put the result into sinputID
      mobileControlSet sinputID, "-4,473,326,575"
      mobileControlSet sinputID, "visible", "true"
      mobileControlSet sinputID, "opaque", "true"
   end if
end openCard

on keyboardActivated
   mobileControlSet sinputID, "rect", "-4,256,326,358"
   set the rect of group "input" to "-4,256,326,358"
end keyboardActivated

on keyboardDeactivated
   mobileControlSet sinputID, "rect", "-4,473,326,575"
   set the rect of group "input" to "-4,473,326,575"
end keyboardDeactivated
I wondered if anyone could let me know if i'm perhaps missing something?

Thank you in advance!

-Sean
Last edited by sms5138 on Mon Jul 20, 2015 8:39 pm, edited 3 times in total.

Klaus
Posts: 10486
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Am I missing something in my code?

Post by Klaus » Wed Jul 15, 2015 1:37 pm

Hi Sean,

no idea if that is the troublemaker, but there is the keyword RECT issing in your "opencard" handler:
...
mobileControlCreate "input"
put the result into sinputID
## mobileControlSet sinputID, "-4,473,326,575"
mobileControlSet sinputID, "rect", "-4,473,326,575"
...


Best

Klaus

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: Am I missing something in my code?

Post by sms5138 » Thu Jul 16, 2015 4:05 pm

Thanks Klaus!

I'll have to give this a shot when i have time later today, and let you know if that fixed it!

regards,

Sean

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: Am I missing something in my code?

Post by sms5138 » Fri Jul 17, 2015 5:52 pm

Thanks Klaus!

looked at your advise, and got it working!

I really appreciate your help! it was simple, but it was driving me a bit crazy.

regards,

Sean

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: Am I missing something in my code?

Post by sms5138 » Sun Jul 19, 2015 3:10 pm

Hello again...

I've come into a strange problem... i thought that this had fixed my issue, but apparently it did not. it will work in live code, but not in the emulator...

I've attached an example project of what i'm trying to do here https://db.tt/EWKntTqh

As you'll see i've changed the code a bit for this example, but regardless of if i use the new code or the old code (shown in the post above) i get the same result.. movement in livecode, and nothing in the iPhone emulator?

does anyone have any ideas as to why this might be the case or know a of possible fix?

thank you in advance for any insight you can provide!

regards,

Sean

Post Reply

Return to “MobGUI”