Page 1 of 1

DeactivateKeyboard from MouseUp

Posted: Sun May 31, 2015 1:51 am
by quailcreek
Hi,
What message is send to deactivate the keyboard with the card is touched? I have a grc that covers the entire cd so touching the cd isn't possible. I know I could make the grc a background but I wanted to ask the experts first. Thanks.

Re: DeactivateKeyboard from MouseUp

Posted: Sun May 31, 2015 3:11 am
by Simon
Hi quailcreek,
I may not have understood your question correctly but...
I usually put a rectangle graphic object in the lowest layer of the grp and add a mouseUp script to it.

Code: Select all

on mouseUp
   set the traversalOn of btn "focus" to true
   focus on btn "focus"
end mouseUp
I include a hidden button on the card called "focus"
...cd so touching the cd isn't possible
So not sure this will work?

Simon

Re: DeactivateKeyboard from MouseUp

Posted: Sun May 31, 2015 3:40 am
by quailcreek
Thanks, Simon. I put this in the grc. Works perfect.

Code: Select all

on mouseUp
focus on nothing
end mouseUp

Re: DeactivateKeyboard from MouseUp

Posted: Sun May 31, 2015 3:45 am
by Simon
Hi Tom,
I once had a problem with "focus on nothing" so I don't trust it anymore.
Probably works fine.

Simon
Edit; Oh and "pass mouseUp" if you use it on the grp, or your fields won't get the touch. (I'm thinking)
Edit 2; on I see "grc" OK :)

Re: DeactivateKeyboard from MouseUp

Posted: Sun May 31, 2015 4:09 am
by quailcreek
Thanks again, Simon. I'll watch out for the focus on nothing. Too bad printing the contents of a fld isn't as simple... or do you have a solution of that one too? ;-)

Re: DeactivateKeyboard from MouseUp

Posted: Sun May 31, 2015 4:56 am
by Simon
Hi Tom,
Sorry I thought someone answered that one for you.
I have used;
create inv stack "print"
put the field into cd 1 of the new stack (doing all the resizing stuff) then just "print card 1 of stack "print"".

Simon

Re: DeactivateKeyboard from MouseUp

Posted: Sun May 31, 2015 5:52 am
by quailcreek
Simon,
That sheds some lite on printing a fld. I didn't think iSO would allow 2 stacks to be open. So then I guess I could have a second stack all prepared and sized and have it loaded to the documents folder at installation. Then just open it as hidden and go from there. :-)

Re: DeactivateKeyboard from MouseUp

Posted: Mon Jun 01, 2015 2:14 am
by quailcreek
OK I give. Been trying to resize the print stack ... all day. Did livecode remove the ability in iOS ? Resizing the stack works outside iOS.

Re: DeactivateKeyboard from MouseUp

Posted: Mon Jun 01, 2015 3:59 am
by Simon
Hi Tom,
Ahh OK, you zoom the card, from the dictionary;
print card [from topLeft to rightBottom] [into pageRect]
Simpler- print cd 1 of stack "print" into 100,100,800,900
So you can keep it all really tiny until print time "into pageRect". I don't know what the pageRect of 8.5x11 paper is (left,top,right,bottom eg 100,100,800,900) but you can figure it out.
I admit the last time I did this was for iPad and everything fit so I didn't have to mess with into pageRect.
I think I saw in your other post something about setting up a separate .livecode file? When in the standalone you can just create the stack and it will go away on shut down or after the print just delete stack "print".

Simon