Example: /MacCocoa/NSAnimation test

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/NSAnimation test


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

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

This example is the version from Sat, 31th Aug 2012.

Project "NSAnimation test.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() a = new MoveAnimation(1.0, NSAnimationMBS.NSAnimationEaseInOut) a.frameRate = 20 a.animationBlockingMode = a.NSAnimationNonblocking a.c = label1 a.StartLeft = label1.Left a.Starttop = label1.top a.DistanceX = 100 a.DistanceY = 0 a.startAnimation End EventHandler
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() a = new MoveAnimation(1.0, NSAnimationMBS.NSAnimationEaseInOut) a.frameRate = 20 a.animationBlockingMode = a.NSAnimationNonblocking a.c = label1 a.StartLeft = label1.Left a.Starttop = label1.top a.DistanceX = -100 a.DistanceY = 0 a.startAnimation End EventHandler
End Control
Property a As MoveAnimation
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
Class MoveAnimation Inherits NSAnimationMBS
EventHandler Sub CurrentProgressChanged(progress as double) if DistanceY <> 0 then c.top = StartTop + DistanceY * progress end if if DistanceX <> 0 then c.left = StartLeft + DistanceX * progress end if End EventHandler
Property DistanceX As Integer
Property DistanceY As Integer
Property StartLeft As Integer
Property StartTop As Integer
Property c As RectControl
End Class
End Project

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


💬 Ask a question or report a problem