building a control -- Well trying anyway
Nakia Brewer
Nakia.Brewer at westrac.com.au
Sat Nov 16 06:23:38 EST 2013
Its showing the following error in the message window
Message execution error:
Error description: Chunk: can't find background
Hint:
Its failing when its trying to set the rect of the newly created group.
I have tried so far:
set the rect of group tNewControl to tRect
set the rect of control tNewControl to tRect
The contents of tNweControl are:
group id 1080 of card id 1002 of stack "/Users/nakia/Desktop/UIKeyboardToolbar Test App.livecode"
Im trying the lockLoc now
________________________________________
From: use-livecode [use-livecode-bounces at lists.runrev.com] on behalf of Mark Schonewille [m.schonewille at economy-x-talk.com]
Sent: Saturday, November 16, 2013 10:07 PM
To: How to use LiveCode
Subject: Re: building a control -- Well trying anyway
Hi Nakia,
Set the lockLoc of the group to true. This makes sure that any rects set
by script will stick.
When you change the rect of the group, the controls inside the group
won't resize automatically. You need a script to do this. You can add a
resizeControl handler to the group and change all controls' sizes in
response to that.
The border of the group may be invisible, making you to think that the
rect doesn't change while in fact it does change.
You write "this action does not complete". Do you get an error? What is
the exact text of the error?
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553
Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other
colour spaces. http://www.color-converter.com
Buy my new book "Programming LiveCode for the Real Beginner"
http://qery.us/3fi
Fill out this survey please
http://livecodebeginner.economy-x-talk.com/survey/
On 11/16/2013 11:21, Nakia Brewer wrote:
> Hi,
>
> I thought I might have ago at building a simple little control that simulates the iOS xCode UIKeyboardToolbar
> (the one that has the 'Done' 'Last' buttons on it etc)
>
> So, I have mocked up a group of objects in LC to simulate the look of the Native object (roughly close) and now I am trying to get it all to work.
>
> My current plan is to use this as a 'library' so I have it loaded as a substack of my test app. I want to be able to call it optionally depending on the field that bought the keyboard up.
>
> Now, so far I have got to the point of being able to copy the group from library stack to the current card of the current stack but have hit a stumble trying to perform any actions on the newly copied group. For example, I am trying to set the rect of the new group post creation and for the life of me cant get it to work.. Can anyone see something stupid below?
>
> In the stackscript of the library I am currently doing the below.
>
> on showUIKeyboardToolbar
> ## First calculate the correct size for the UIKeyboardToolbar from the effective screen rect
> -- Note, simply assuming the UIToolbar should be ~ 10% of its width
> put the working screenRect into tRect
> set the itemdel to comma
> put (.10*(item 3 of tRect - item 1 of tRect)) into tHeight
> put (item 4 of tRect - tHeight) into item 2 of tRect
> copy group "UIKeyboardToolbar" of card "iPhone_Standard_Portrait" of stack "LC_iOS_UIKeyboardToolbar" to the current card of the current stack
> put it into tNewGroup
> set the rect of group tNewGroup of the current card of the current stack to tRect -- This action does not complete and the copied group does not resize ???
> show group tNewGroup of the current card of the current stack
> end showUIKeyboardToolbar
>
> on keyboardDeactivated
> ## Destroy the copied group -- This works fine, when the keyboard closes the group is destroyed
> delete group "UIKeyboardToolbar" of the current card of the current stack
> end keyboardDeactivated
>
>
> In the application stack on the landing UI Card I have
>
> on openCard
> start using stack "LC_iOS_UIKeyboardToolbar"
> iphoneUseDeviceResolution true
> end openCard
>
> on keyboardActivated
> showUIKeyboardToolbar
> end keyboardActivated
>
>
>
>
>
> COPYRIGHT / DISCLAIMER: This message and/or including attached files may contain confidential proprietary or privileged information. If you are not the intended recipient, you are strictly prohibited from using, reproducing, disclosing or distributing the information contained in this email without authorisation from WesTrac. If you have received this message in error please contact WesTrac on +61 8 9377 9444. We do not accept liability in connection with computer virus, data corruption, delay, interruption, unauthorised access or unauthorised amendment. We reserve the right to monitor all e-mail communications.
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
COPYRIGHT / DISCLAIMER: This message and/or including attached files may contain confidential proprietary or privileged information. If you are not the intended recipient, you are strictly prohibited from using, reproducing, disclosing or distributing the information contained in this email without authorisation from WesTrac. If you have received this message in error please contact WesTrac on +61 8 9377 9444. We do not accept liability in connection with computer virus, data corruption, delay, interruption, unauthorised access or unauthorised amendment. We reserve the right to monitor all e-mail communications.
More information about the use-livecode
mailing list