Hi,
I think I am doing something wrong but can't work it out.
I have been using the Multiple Page example tutorial - https://www.b4x.com/android/forum/threads/multiple-pages-example.48170/#content
I am trying to add a side menu to one page only.
For example, PagePage1Module to show the side menu but the rest not to show the side menu.
I have used the following code, and everything works and shows the side menu, but if I try and show another page after viewing the page which contains the side menu then it doesn't show the new page.
Main Page shows and loads the LoginModule.
LoginModule asks for the name, and I press Enter.
This then shows the page with a button that says 'Select color'
When I press that button, it seems to run that sub, but it fails to load the ColorsModule screen.
I am guessing I am doing this wrong.
Any ideas on what I have done wrong ?
I have followed the tutorial above for the multiple pages, and then checked out the side menu tutorials but can't work out how to merge the two together.
I only want to display the side menu on one screen only and not all screens.
PageModule Code:
(All other pages/modules from the Multiple pages tutorial is the same code)
I think I am doing something wrong but can't work it out.
I have been using the Multiple Page example tutorial - https://www.b4x.com/android/forum/threads/multiple-pages-example.48170/#content
I am trying to add a side menu to one page only.
For example, PagePage1Module to show the side menu but the rest not to show the side menu.
I have used the following code, and everything works and shows the side menu, but if I try and show another page after viewing the page which contains the side menu then it doesn't show the new page.
Main Page shows and loads the LoginModule.
LoginModule asks for the name, and I press Enter.
This then shows the page with a button that says 'Select color'
When I press that button, it seems to run that sub, but it fails to load the ColorsModule screen.
I am guessing I am doing this wrong.
Any ideas on what I have done wrong ?
I have followed the tutorial above for the multiple pages, and then checked out the side menu tutorials but can't work out how to merge the two together.
I only want to display the side menu on one screen only and not all screens.
PageModule Code:
(All other pages/modules from the Multiple pages tutorial is the same code)
B4X:
'Code module
Sub Process_Globals
Private btnSelectColor As Button
Private Label1 As Label
Private SMC As SideMenuController
Public NavControl1 As NavigationController
Dim myapp As Application
Dim MainPage As Page
End Sub
Public Sub Show
'create a new navigation controller
Dim nc As NavigationController
nc.Initialize("nc")
NavControl1 = nc
' Main Page
MainPage.Initialize("MainPage")
MainPage.Title = "Page 1"
MainPage.RootPanel.Color = Colors.White
MainPage.RootPanel.LoadLayout("Page1Layout")
' Left Menu
Dim lp As Page
lp.Initialize("lp")
lp.RootPanel.Color = Colors.Red
lp.RootPanel.LoadLayout("leftmenu")
SMC.Initialize(lp, nc, Null)
myapp.KeyController = SMC
nc.ShowPage(MainPage)
End Sub
Private Sub btnSelectColor_Click
Log("btnSelectColor_Click")
ColorsModule.ShowModule
End Sub
Public Sub ReturnFromColors(SelectedColor As Int)
Main.NavControl.ShowPage(MainPage)
MainPage.RootPanel.Color = SelectedColor
End Sub