Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacOSX/Fading Windows MacOSX
This example is the version from Tue, 3rd Aug 2015.
Project "Fading Windows MacOSX.xojo_binary_project"
Class Window1 Inherits Window
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect)
dim p as Picture
p=MakePicture(rgb(255,0,0)) // add whatever picture you like!
g.DrawPicture p,0,0,g.Width,g.Height,0,0,p.Width,p.Height
End EventHandler
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 Window2 Inherits Window
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect)
dim p as Picture
p=MakePicture(rgb(0,255,0)) // add whatever picture you like!
g.DrawPicture p,0,0,g.Width,g.Height,0,0,p.Width,p.Height
End EventHandler
End Class
Class App Inherits Application
EventHandler Sub Open()
Window1.Hide
Window2.Show
f=new FadingTimer
f.Period=100
f.Mode=2
End EventHandler
Property Protected f As fadingtimer
End Class
Class FadingTimer Inherits Timer
EventHandler Sub Action()
dim n as integer
dim p as Double
count=count+1
if count=100 then
count=0
end if
// fadein window1
if count>=30 and count<=40 then
n=count-30
p=n/10
Window1.TransparencyMBS=p
end if
if count=30 then // move window1 to front
Window2.TransparencyMBS=1
Window1.Show
end if
// fadein window2
if count>=80 and count<=90 then
n=count-80
p=n/10
Window2.TransparencyMBS=p
end if
if count=80 then // move window2 to front
Window1.TransparencyMBS=1
Window2.Show
end if
End EventHandler
Property Protected count As integer
End Class
Module Util
Function MakePicture(c as color) As picture
dim p as New Picture(300,300,32)
p.Graphics.ForeColor=c
p.Graphics.FillRect 0,0,p.Width,p.Height
Return p
End Function
End Module
End Project
The items on this page are in the following plugins: MBS MacOSX Plugin.