Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/CoreGraphics Overlay Window/Overlay Window/Attached OverlayWindows
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/Attached OverlayWindows
This example is the version from Sun, 17th Mar 2012.
Project "Attached OverlayWindows.rbp"
Class Window1 Inherits Window
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
EventHandler Sub Action() if me.Value then o.Show else o.Hide end if End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
EventHandler Sub Open() dim e as integer o=new MyOverlay1 e=o.Create(100,100,100,100) o.InstallEventHandler o.AttachToWindow(self,true) o.Show End EventHandler
Property Protected o As MyOverlay1
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 MyOverlay1 Inherits OverlayWindowMBS
EventHandler Sub WindowBoundsChanged() draw End EventHandler
EventHandler Sub WindowShown() draw End EventHandler
Sub draw() dim c as CGContextMBS dim r as CGRectMBS r=CGMakeRectMBS(0,0,Width,Height) c=me.Context c.ClearRect r c.SetRGBFillColor 1,0,0,0.1 c.FillRect r c.Flush End Sub
End Class
Class App Inherits Application
EventHandler Sub Open() if TargetMacOS then // ok else MsgBox "This example requires Mac OS X!" quit end if Window1.Show Window2.Show Window3.Show End EventHandler
End Class
Class Window3 Inherits Window
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
EventHandler Sub Action() if me.Value then o.Show else o.Hide end if End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
EventHandler Sub Open() dim e as integer o=new MyOverlay3 e=o.Create(left+100,top+100,200,200) o.InstallEventHandler o.AttachToWindow(self,true,false) o.Show p=new MyOverlay3 e=p.Create(left+300,top+100,200,200) p.InstallEventHandler p.AttachToWindow(self,true,false, o) p.Show End EventHandler
Property Protected o As MyOverlay3
Property Protected p As myoverlay3
End Class
Class MyOverlay2 Inherits OverlayWindowMBS
EventHandler Sub WindowBoundsChanged() draw End EventHandler
EventHandler Sub WindowShown() draw End EventHandler
Sub draw() dim c as CGContextMBS dim r as CGRectMBS r=CGMakeRectMBS(0,0,Width,Height) c=me.Context c.ClearRect r c.SetRGBFillColor 1,0,0,0.1 c.FillRect r c.Flush End Sub
End Class
Class MyOverlay3 Inherits OverlayWindowMBS
EventHandler Sub WindowBoundsChanged() draw End EventHandler
EventHandler Sub WindowShown() draw End EventHandler
Sub draw() dim c as CGContextMBS dim r as CGRectMBS r=CGMakeRectMBS(0,0,Width,Height) c=me.Context c.ClearRect r c.SetRGBFillColor rnd*1,rnd*1,rnd*1,0.1 c.FillRect r c.Flush End Sub
End Class
Class Window2 Inherits Window
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
EventHandler Sub Action() if me.Value then o.Show else o.Hide end if End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
EventHandler Sub Open() dim e as integer o=new MyOverlay2 e=o.Create(left+100,top+100,200,200) o.InstallEventHandler o.AttachToWindow(self,true,false) o.Show End EventHandler
Property Protected o As MyOverlay2
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 Chart Plugins