B4J Question Help me about multi layout.

Discussion in 'B4J Questions' started by universengo, May 16, 2019.

  1. universengo

    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
    Code:
    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
    Code:
    MainForm.RootPane.RemoveAllNodes
    before load new layout BUT menu Action do nothing.

    Help me. Thanks.
     
  2. universengo

    universengo Member

    Error:

    In Open 1 and Open 2...layout, I almost have a CLOSE button with the code:
    Code:
    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:
    Code:
    Sub CLOSE-MAIN_ACTION
    MainForm.RootPane.RemoveNodeFromParent
    MainForm.RootPane.LoadLayout(
    "Main")
    End Sub
    these code of CLOSE buttons of layouts will change to:
    Code:
    CallSub("",Main.CLOSE-MAIN_Action)
    That is OK NOW.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice