You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/CoreGraphics DirectDisplay/CGDisplay Rotation
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control BevelButton1 Inherits BevelButton
ControlInstance BevelButton1 Inherits BevelButton
EventHandler Sub Action()
dim d as CGDisplayMBS = CGDisplayMBS.MainDisplay
dim e as integer = d.SetRotation(90)
if e<>0 then
MsgBox "Error: "+str(e)
end if
End EventHandler
End Control
Control BevelButton2 Inherits BevelButton
ControlInstance BevelButton2 Inherits BevelButton
EventHandler Sub Action()
dim d as CGDisplayMBS = CGDisplayMBS.MainDisplay
dim e as integer = d.SetRotation(180)
if e<>0 then
MsgBox "Error: "+str(e)
end if
End EventHandler
End Control
Control BevelButton3 Inherits BevelButton
ControlInstance BevelButton3 Inherits BevelButton
EventHandler Sub Action()
dim d as CGDisplayMBS = CGDisplayMBS.MainDisplay
dim e as integer = d.SetRotation(270)
if e<>0 then
MsgBox "Error: "+str(e)
end if
End EventHandler
End Control
Control BevelButton4 Inherits BevelButton
ControlInstance BevelButton4 Inherits BevelButton
EventHandler Sub Action()
dim d as CGDisplayMBS = CGDisplayMBS.MainDisplay
dim e as integer = d.SetRotation(0)
if e<>0 then
MsgBox "Error: "+str(e)
end if
End EventHandler
End Control
EventHandler Sub Close()
dim d as CGDisplayMBS = CGDisplayMBS.MainDisplay
dim e as integer = d.SetRotation(0)
End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar