Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/Core Animation


Required plugins for this example: MBS MacBase Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/Core Animation

This example is the version from Sun, 17th Mar 2012.

Project "Core Animation.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() if TargetCocoa = false then MsgBox "This application must be run with Cocoa target in RB 2010." quit end if End EventHandler
End Class
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control BevelButton1 Inherits BevelButton
ControlInstance BevelButton1 Inherits BevelButton
EventHandler Sub Action() ovalview.alphaValue = 1.0 End EventHandler
End Control
Control BevelButton2 Inherits BevelButton
ControlInstance BevelButton2 Inherits BevelButton
EventHandler Sub Action() ovalview.alphaValue = 0.0 End EventHandler
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control BevelButton3 Inherits BevelButton
ControlInstance BevelButton3 Inherits BevelButton
EventHandler Sub Action() OvalAnimator.alphaValue = 1.0 End EventHandler
End Control
Control BevelButton4 Inherits BevelButton
ControlInstance BevelButton4 Inherits BevelButton
EventHandler Sub Action() OvalAnimator.alphaValue = 0.0 End EventHandler
End Control
Control Oval1 Inherits Oval
ControlInstance Oval1 Inherits Oval
End Control
Control BevelButton5 Inherits BevelButton
ControlInstance BevelButton5 Inherits BevelButton
EventHandler Sub Action() dim r as NSRectMBS = ovalview.frame // calculate position. Cocoa has y=0 on the bottom, so it is some math: r.Y = self.Height-Oval1.Height-14 ovalview.frame = r End EventHandler
End Control
Control BevelButton6 Inherits BevelButton
ControlInstance BevelButton6 Inherits BevelButton
EventHandler Sub Action() dim r as NSRectMBS = ovalview.frame // calculate position. Cocoa has y=0 on the bottom, so it is some math: r.Y = 14 ovalview.frame = r End EventHandler
End Control
Control BevelButton7 Inherits BevelButton
ControlInstance BevelButton7 Inherits BevelButton
EventHandler Sub Action() dim r as NSRectMBS = OvalAnimator.frame // calculate position. Cocoa has y=0 on the bottom, so it is some math: r.Y = self.Height-Oval1.Height-14 OvalAnimator.frame = r End EventHandler
End Control
Control BevelButton8 Inherits BevelButton
ControlInstance BevelButton8 Inherits BevelButton
EventHandler Sub Action() dim r as NSRectMBS = OvalAnimator.frame // calculate position. Cocoa has y=0 on the bottom, so it is some math: r.Y = 14 OvalAnimator.frame = r End EventHandler
End Control
EventHandler Sub Open() OvalView = Oval1.NSViewMBS OvalView.wantsLayer = true OvalAnimator = OvalView.animator End EventHandler
Property OvalAnimator As NSViewMBS
Property Protected OvalView As NSViewMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

The items on this page are in the following plugins: MBS MacCocoa Plugin.


The biggest plugin in space...