building a control -- Well trying anyway
m.schonewille at economy-x-talk.com
Sat Nov 16 12:07:31 CET 2013
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?
Economy-x-Talk Consulting and Software Engineering
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"
Fill out this survey please
On 11/16/2013 11:21, Nakia Brewer wrote:
> 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
> 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:
More information about the use-livecode