Platforms to show: All Mac Windows Linux Cross-Platform
/MacCG/CoreGraphics DirectDisplay/CGScreenRefreshEvent Test
Required plugins for this example: MBS MacCG Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/CoreGraphics DirectDisplay/CGScreenRefreshEvent Test
This example is the version from Mon, 14th Feb 2016.
Project "CGScreenRefreshEvent Test.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open()
m = new MyCGScreenRefreshEvent
m.list = list
u = new MyCGScreenUpdateMoveEvent
u.list = list
End EventHandler
Property m As MyCGScreenRefreshEvent
Property u As MyCGScreenUpdateMoveEvent
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
Class MyCGScreenRefreshEvent Inherits CGScreenRefreshEventMBS
EventHandler Sub ScreenRefresh(rectCount as Integer, rects() as CGRectMBS)
dim n as integer = 0
// filter our own window.
dim c as integer = 0
dim wl as integer = window1.Left
dim wt as integer = window1.top
dim ww as integer = window1.Width
dim wh as integer = window1.Height
for each r as CGRectMBS in rects
if r.Left >= wl and r.top >= wt then
if r.Left + r.Width <= wl + ww and r.top + r.Height <= wh + wt then
c = c + 1
end if
end if
next
if c = rectCount then return
// show others, e.g. seconds in menubar
list.InsertRow n, "ScreenRefresh "+str(rectCount)+" rectangles"
for each r as CGRectMBS in rects
n = n + 1
list.InsertRow n, " pos: "+str(r.Left)+"/"+str(r.top)+", width: "+str(r.Width)+", height: "+str(r.Height)
next
End EventHandler
Property list As Listbox
End Class
Class MyCGScreenUpdateMoveEvent Inherits CGScreenUpdateMoveEventMBS
EventHandler Sub ScreenMove(deltaX as Integer, deltaY as Integer, rectCount as Integer, rects() as CGRectMBS)
dim n as integer = 0
list.InsertRow n, "ScreenMove "+str(deltaX)+"/"+str(deltaY)+" with "+str(rectCount)+" rectangles"
for each r as CGRectMBS in rects
n = n + 1
list.InsertRow n, " pos: "+str(r.Left)+"/"+str(r.top)+", width: "+str(r.Width)+", height: "+str(r.Height)
next
End EventHandler
Property list As Listbox
End Class
End Project
See also:
- /MacCG/CoreGraphics DirectDisplay/CGDisplay Rotation
- /MacCG/CoreGraphics DirectDisplay/CGDisplayMBS CreateImageAsync
- /MacCG/CoreGraphics PDF/Getpicture PDF
- /MacCG/CoreGraphics PDF/PDF Font list
- /MacCG/CoreGraphics PDF/PDF Text
- /MacCG/CoreGraphics PDF/PDF Transparency
- /MacCG/CoreGraphics PDF/PDF using Save and Restore
- /MacCG/CoreGraphics PDF/PDF Viewer White on Black
- /MacCG/CoreGraphics PDF/Show PDF
- /MacCG/CoreGraphics PDF/Simple Make PDF
The items on this page are in the following plugins: MBS MacCG Plugin.