Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/CoreGraphics Overlay Window/Overlay Window/Dock like Poff
Function:
Required plugins for this example: MBS Images Plugin, MBS MacCG Plugin, MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/CoreGraphics Overlay Window/Overlay Window/Dock like Poff
This example is the version from Thu, 16th Nov 2016.
Project "Dock like Poff.rbp"
Class MainWindow Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() Poff Screen(0).Width/2,Screen(0).Height/2 End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Sub poff(x as integer,y as integer) #pragma disableautowaitcursor dim f as FolderItem dim png as PNGpictureMBS dim o as OverlayWindowMBS dim p,m as Picture dim c as CGContextMBS dim cp as CGImageMBS dim r as CGRectMBS dim t,i as integer // 128 is full size const targetwidth=128 const targetheight=128 f=CoreServicesFolderMBS(-32766) f=f.Child("Dock.app") f=f.Child("Contents") f=f.Child("Resources") f=f.Child("poof.png") png=f.OpenAsPNGMBS(0) o=new OverlayWindowMBS if o.Create(x,y,targetwidth,targetheight)=0 then o.Show for i=0 to 4 c=o.Context p = new Picture(targetwidth,targetheight,32) p.Graphics.DrawPicture png.pict,0,(-128)*i m = new Picture(targetwidth,targetheight,32) m.Graphics.DrawPicture png.mask,0,(-128)*i cp=CGCreateImageMBS(p,m) r=CGMakeRectMBS(0,0,targetwidth,targetheight) c.ClearRect r c.DrawPicture cp,r c.Flush t=ticks while abs(t-ticks)<5 wend next end if End Sub
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
EventHandler Sub Open() if TargetMacOS then // ok else MsgBox "This example requires Mac OS X!" quit end if End EventHandler
End Class
End Project

See also:

Feedback, Comments & Corrections

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





Links
MBS Xojo PDF Plugins