building a control -- Well trying anyway

Richmond richmondmathewson at gmail.com
Sat Nov 16 06:00:14 EST 2013


On 16.11.2013 12:21, Nakia Brewer wrote:

Why not have your ToolBar set up NOT as a stack, but as a background 
group (which will then be propagated across all of your cards); then all 
you need to do is toggle the VIS of that group?

Richmond.

> 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





More information about the Use-livecode mailing list