I have been combing Mac OS Lib lately for little tidbits of cool OS X “stuff” and I came across the native Add/Delete buttons. Technically it is a segmented control and it looks absolutely fantastic in my app.
My App Example:
Add the entire Mac OS Lib project to your project
Add a “Segmented control” into your project on the IDE
Add the “Action” and “Open” events to the segmented control
If itemIndex = 0 Then
// THIS THE INDEX FOR THE ADD (PLUS) BUTTON SEGMENT
// Add your code here when users click the add button
Elseif itemIndex = 1 Then
// THIS THE INDEX FOR THE DELETE (MINUS) BUTTON SEGMENT
// Add your code here when users click the delete button
End If
The last article I did for xDev was about getting some of these cool interface things going with your apps, using the system images sure does make life easier to generate consistent applications across the different versions of Aqua (although I still think should’a called the new interface Crayola).
The only downside to using system images, is that they’re not there on Windows or Linux. So if you’re targeting other platforms, you need to manually generate some graphics. Maybe a Windows guru can come in and help obtain some Windows system graphics.
[quote=142076:@Sam Rowlands]The last article I did for xDev was about getting some of these cool interface things going with your apps, using the system images sure does make life easier to generate consistent applications across the different versions of Aqua (although I still think should’a called the new interface Crayola).
The only downside to using system images, is that they’re not there on Windows or Linux. So if you’re targeting other platforms, you need to manually generate some graphics. Maybe a Windows guru can come in and help obtain some Windows system graphics.[/quote]
I am not a guru but have dabbed enough with the new API to tell you that apart from fundamentals such as windows and buttons that are styled by the system, there is no equivalent to the system supplied pictures. Well. Not quite. Windows uses fonts such as Segoe UI to provide symbols, and the closest they have of the Apple HIG for that is here: http://msdn.microsoft.com/en-us/library/windows/apps/jj841126.aspx
Mike,
It looks awesome and I tried the example from your opening post but I’m missing something.
With ‘Segmented Control’, do you mean an actual Xojo Segmented Control? If so, the standard segmented control doesn’t have a ‘ImageForSegment’ property so how does that work?
Also, with MacOSLib pasted in my project, ‘SystemIcons’ isn’t found.
[quote=202243:@Marco Hof]Mike,
It looks awesome and I tried the example from your opening post but I’m missing something.
With ‘Segmented Control’, do you mean an actual Xojo Segmented Control? If so, the standard segmented control doesn’t have a ‘ImageForSegment’ property so how does that work?
Also, with MacOSLib pasted in my project, ‘SystemIcons’ isn’t found.[/quote]
Hi Marco,
Yes I used the actual Segmented Control in Xojo.
This is a screen shot from one of my apps:
Can you share your code example that is giving you issues?
FWIW My final Arista Navigator release didn’t use the systemIcons as I found they weren’t retina friendly for me. I added two Mac Like + and - images both at @1 and @2.
And I find it weird that images are more retina friendly than the SystemIcons. I assumed that these were native.[/quote]
Here is my final code specifically for my Segmented Control via Arista Navigator. It is different that my original post here.
(I am Using RetinaKit)
SegmentedControl.Open Event:
Dim theAdd as HIDPIPicture = HIDPIPicture.imageNamed( "AddPlus" )
Me.setIcon(0,theAdd)
Dim theRemove as HIDPIPicture = HIDPIPicture.imageNamed( "RemoveMinus" )
Me.setIcon(1,theRemove)
Dim theS as SegmentedControlItem
theS =Me.Items(1)
theS.Enabled = False