About Screen 640x480 2.1 source code
App.update:
Sub update()
dim c as cgcontextMBS
dim r as cgrectMBS
dim w,h as integer
w=o.width
h=o.height
c=o.context
r=CGMakeRectMBS(0,0,w,h)
c.setrgbfillColor col.red/255.0,col.green/255.0,col.blue/255.0,transparency/20.0
c.ClearRect r
c.fillrect r
Select case mode
case 0
r=CGMakeRectMBS(0,h-he,wi,he)
c.ClearRect r
case 1
r=CGMakeRectMBS(w-wi,h-he,wi,he)
c.ClearRect r
case 2
r=CGMakeRectMBS(0,0,wi,he)
c.ClearRect r
case 3
r=CGMakeRectMBS(w-wi,0,wi,he)
c.ClearRect r
case 4
r=CGMakeRectMBS((w-wi)/2,(h-he)/2,wi,he)
c.ClearRect r
end Select
c.flush
End Sub
App.doresize:
Sub doresize()
o.width=screen(0).width
o.height=screen(0).height
update
End Sub
App.EnableMenuItems:
Sub EnableMenuItems()
windowDarker.enable
windowLighter.enable
windowSelectcolor.enable
appleAboutthisapplication.enable
Windowx480.Enable
Windowx600.Enable
Windowx768.Enable
Windowfull.Enable
WindowBottomleft.Enable
WindowBottomright.Enable
WindowTopleft.Enable
WindowTopright.Enable
WindowCenter.Enable
End Sub
App.Open:
Sub Open()
dim w,h as integer
// remove the line or define such a function in your own MBSPluginRegistration module
registerPlugins
transparency=10
col=rgb(128,128,128)
w=screen(0).width
h=screen(0).height
mheight=h
mwidth=w
o=new overlayWindowMBS
wi=640
he=480
Windowfull.text=str(mwidth)+" x "+str(mheight)
if o.Create(0,0,w,h)=0 then
o.Show
update
else
msgBox "This application requires Mac OS X 10.2."
quit
end if
End Sub
AboutDialog.Open:
Sub Open()
title=app.longVersion
StaticText1.text=Title
End Sub
AboutDialog.Canvas1.Paint:
Sub Paint(g As Graphics)
dim f as FolderItem
f=app.ApplicationFileMBS
if f<>Nil then
f.DrawIconMBS g,me.left,me.top
end if
End Sub
AboutDialog.StaticText4.Open:
Sub Open()
me.text="Realbasic "+rbVersionString
End Sub
AboutDialog.StaticText5.Open:
Sub Open()
me.text=mbspluginversion
End Sub
AboutDialog.PushButton1.Action:
Sub Action()
close
End Sub
AboutDialog.StaticText7.MouseUp:
Sub MouseUp(X As Integer, Y As Integer)
me.TextColor=rgb(0,0,255)
ShowURL "http://www.monkeybreadsoftware.de"
End Sub
AboutDialog.StaticText7.MouseDown:
Function MouseDown(X As Integer, Y As Integer) As Boolean
me.TextColor=rgb(255,0,0)
Return true
End Function
Links
MBS Realbasic PDF Plugins - Pfarrgemeinde Messdiener Nickenich