B4XPages 1.05: how to resize layout Width and Height ?
in Main:
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
'
#Region Delegates
Sub MainForm_Resize (Width As Double, Height As Double)
B4XPages.Delegate.MainForm_Resize(Width, Height)
'what is ?
End Sub
in B4XMainPage:
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("demoLayout")
End Sub
'
Sub B4XPage_Appear
'what is?
End Sub
'
Sub B4XPage_Resize (Width As Int, Height As Int)
'what is?
End Sub
with JFX (NOT B4XPAGES) i can resize easy:
B4X:
dim f as Form
f.Initialize("", fx.PrimaryScreen.MaxX-50dip, fx.PrimaryScreen.MaxY-50dip)
f.RootPane.LoadLayout("demo")
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.WindowWidth= 150dip
MainForm.WindowHeight= 250dip
MainForm.Show
Dim PagesManager As B4XPagesManager
PagesManager.Initialize(MainForm)
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("your layout")
#if B4J
Dim form As Form = B4XPages.GetNativeParent(Me)
Dim joForm As JavaObject = form
Dim joStage As JavaObject = joForm.GetField("stage")
joStage.RunMethod("setMaximized",Array(True))
#if
End Sub
B4J-B4XPages project. I mean that the solution that Ugo found was sufficient for him, as he only wanted to change the size of the form (Main) at every start of the application, while the title of the thread, and the problem, is to trigger the Resize event written in the B4XPage every time the user resizes the form.