Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/CoreGraphics Overlay Window/Overlay Window/Overlay Window
Function:
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 Overlay Window/Overlay Window/Overlay Window
This example is the version from Sun, 17th Mar 2012.
Project "Overlay Window.rbp"
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 c=rgb(127,0,0) t=127 w=new OverlayWindowMBS 'w.EatMouseEvents=true // required before Create to be successfull on Mac OS X 10.1.5 or earlier if w.Create(200,200,200,200)<>0 then MsgBox "Can't create overlay window!" else 'w.Level=w.WindowLevelForKey(2) // desktop window level w.Show draw // MsgBox str(w.Level) end if End EventHandler
Sub draw() dim ct as CGContextMBS dim r as CGRectMBS r=CGMakeRectMBS(0,0,w.Width,w.Height) ct=w.Context ct.ClearRect r ct.SetRGBFillColor c.red/255,c.green/255,c.blue/255,t/255 ct.FillRect r ct.SetRGBFillColor 0,0,0,1 ct.SelectFont "Geneva",20,1 ct.ShowTextAtPoint "Hello world!",20,20 ct.Flush End Sub
Property c As color
Property t As integer
Property w As OverlayWindowMBS
End Class
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control Slider1 Inherits Slider
ControlInstance Slider1 Inherits Slider
EventHandler Sub ValueChanged() app.w.top=me.Value app.draw End EventHandler
End Control
Control Slider2 Inherits Slider
ControlInstance Slider2 Inherits Slider
EventHandler Sub ValueChanged() app.w.left=me.Value app.draw End EventHandler
End Control
Control Slider3 Inherits Slider
ControlInstance Slider3 Inherits Slider
EventHandler Sub ValueChanged() app.w.Width=me.Value app.draw End EventHandler
End Control
Control Slider4 Inherits Slider
ControlInstance Slider4 Inherits Slider
EventHandler Sub ValueChanged() app.w.Height=me.Value app.draw End EventHandler
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control Slider5 Inherits Slider
ControlInstance Slider5 Inherits Slider
EventHandler Sub ValueChanged() app.t=me.Value app.draw End EventHandler
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() dim c as color c=app.c if SelectColor(c,"New color:") then app.c=c app.draw end if End EventHandler
End Control
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