ZirconSwitch for Xojo
Issue: 12.2 (March/April 2014)
Author: Marc Zeedar
Article Description: No description available.
Article Length (in bytes): 3,309
Starting Page Number: 12
Article Number: 12202
Related Link(s): None
Full text of article...
Former Xojo employee Thom McGrath has released a few "Zircon" controls for Xojo. ZirconSwitch mimics the iOS-style "on-off" switches Xojo uses in its IDE.
The simple Read Me page makes it sound like ZirconSwitch is trivial to use, but that's only if you know all the parts. Since the folder has nine items in it, knowing which ones to drag into your project isn't obvious. (For the record, "ZirconSwitch.xojo
project" is the demo; "ZirconSwitch.xojocode" is the control. This is different from ZirconBreadcrumbs.) It'd be nicer if this was made more clear.
Start by importing ZirconKit, then add the control. You can then drag the control to a window to use it. If you hit "Run" at this point, the control will just work. It defaults to on; clicking on it shows smooth animation as it slides to the "Off" position. A second click returns it to "On"—the subtle animation helps the user see the change.
At this point you can use code to customize the control, or use the Inspector panel in the IDE with the control selected. You can set the alignment (where it appears within the canvas), the colors, the captions ("On/Off" are the defaults), turn the animation off, and more. You can also choose between three sizes of the control: normal, small, and mini.
The code for these settings is trivial. It looks like this:
me.animated = false
me.controlSize = me.sizeMini
The control is freely useable within the IDE; you only need to pay to use it in standalone apps. This means you can easily try out the control and see how you like it. The included demo shows off the control's features, but it has some odd visual bugs (like not erasing the previous control when you pick a new size). These aren't in the control, only in the demo, but it's still off-putting.
Considering the inexpensive price, ZirconSwitch is a terrific value and well-worth the minimal cost if you desire snazzy on-off switches in your app. It would be nice if the control were updated with iOS 7-style graphics, though that's possibly something you could add yourself. In the meantime, it does what it does really well.
End of article.