B4J Question Help me about multi layout.

universengo

Member
Hello everyone! I am a newbje, so I need your help as below:
I use mebubar to make as below:
File1 -> Open 1
File2 -> Open 2
.....
I use many forms: Main, Open1, Open2
The frist load MAIN layout
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    'Load form
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Main")
End Sub
Then I choose menubar to load OPEN1 layout
Then I choose menubar to load OPEN2 layout

When I load form then the following loading form will overlap the previous loading form.
I don't now how to remove these layout that is only current layout open.
I used
B4X:
MainForm.RootPane.RemoveAllNodes
before load new layout BUT menu Action do nothing.

Help me. Thanks.
 

universengo

Member
Error:

In Open 1 and Open 2...layout, I almost have a CLOSE button with the code:
B4X:
MainForm.RootPane.RemoveNodeFromParent
MainForm.RootPane.LoadLayout("Main")
the current layout will CLOSE but when I open new layout from menu will be DO NOTHING.

SOLVED:

I use menu CLOSE in Main layout and use code:
B4X:
Sub CLOSE-MAIN_ACTION
MainForm.RootPane.RemoveNodeFromParent
MainForm.RootPane.LoadLayout("Main")
End Sub

these code of CLOSE buttons of layouts will change to:
B4X:
CallSub("",Main.CLOSE-MAIN_Action)

That is OK NOW.
 
Upvote 0
Top