Just like on the web, when a popup pop's up (?) and the background page is blurred.
Simple example that when button is clicked mainform is blurred.
When the window is closed, the mainform is deblurred (not a real word but I like it)
The setWidth and setHeight control how blurred the form gets. (4,4,2 gives a nice effect)
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim blur As JavaObject
Dim myForm As Form
Dim b1 As Button
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
b1.Initialize("bu1")
b1.Text = "Show New Form"
' simple form for example code
myForm.Initialize("mf",200,200)
myForm.Resizable = False
myForm.Title = "MyForm"
MainForm.RootPane.AddNode(b1,400,50,120,20)
' initialize boxblur
blur.InitializeNewInstance("javafx.scene.effect.BoxBlur",Null)
End Sub
Sub bu1_Action
myForm.show ' show new window
' fire the blur on mainform.rootpane
blur.RunMethod("setWidth",Array(4.0D))
blur.RunMethod("setHeight",Array(4.0D))
blur.RunMethod("setIterations",Array(2))
asJO(MainForm.RootPane).RunMethod("setEffect",Array(blur))
End Sub
Sub mf_CloseRequest (EventData As Event)
' clear the blur on new window closing
blur.RunMethod("setWidth",Array(0.0D))
blur.RunMethod("setHeight",Array(0.0D))
blur.RunMethod("setIterations",Array(0))
asJO(MainForm.RootPane).RunMethod("setEffect",Array(blur))
End Sub
Sub asJO(o As JavaObject)As JavaObject
Return o
End Sub
When the window is closed, the mainform is deblurred (not a real word but I like it)
The setWidth and setHeight control how blurred the form gets. (4,4,2 gives a nice effect)