Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/CoreGraphics Overlay Window/Overlay Window/Addressbook like number display
Required plugins for this example: 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/Addressbook like number display
This example is the version from Thu, 16th Nov 2016.
Project "Addressbook like number display.rbp"
Filetype text
End FileTypes
Class Window1 Inherits Window
EventHandler Sub Open() text="0 12 34 / 56 78 90" call me.MakeTransparentMBS graphics.TextSize=100 graphics.ForeColor=Rgb(0,0,0) Width=60+Graphics.StringWidth(text) Left=(Screen(0).Width-Width)/2+Screen(0).Left Top=(Screen(0).Height-Height)/2+Screen(0).top End EventHandler
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect) dim c as CGContextMBS dim m,p as Picture dim ci as CGImageMBS dim gg as Graphics p = new Picture(Width,Height,32) m = new Picture(Width,Height,32) gg=m.Graphics gg.TextSize=100 gg.ForeColor=Rgb(0,0,0) gg.DrawString text,30,90 ci=CGCreateImageMBS(p,m) if TargetCocoa then c = GetCurrentCGContextMBS elseif TargetCarbon then c = me.CGContextMBS else break // not supported platform end if c.ClearRect CGMakeRectMBS(0,0,Width,Height) c.SetRGBFillColor 0,0,0,0.5 c.SetRGBStrokeColor 0,0,0,0.5 c.FillRect CGMakeRectMBS(0,0,width,height) c.DrawPicture ci,CGMakeRectMBS(0,0,Width,Height) c.Flush End EventHandler
Property Protected text As string
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

See also:

Feedback, Comments & Corrections

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

MBS Xojo Plugins