B4J Question {SOLVED} [B4XPages] how to resize layout

giannimaione

Well-Known Member
Licensed User
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")
 

giannimaione

Well-Known Member
Licensed User
[Solved]
in Main:
B4X:
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
 

giannimaione

Well-Known Member
Licensed User
code for maxim pages

B4X:
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
 
Top