I want my PC software/app (B4J) to look and feel like my Android app.
The multiple 'screens' Android app UI paradigm is typically realized by using the MVC (model, view, controller) architecture, since we want to build our B4J software as we built the B4A app; we want to show a new B4A 'UI window' (while others are in background or disappear) and go back to the original 'UI main window' by hitting "OK" in the current 'UI window'.
I believe some have asked & started threads related to this central theme I mention above,
"Two 'forms' where does the code go?"
"Call new form"
"how do to create two forms connected by a button?"
This is what I did and I need your help to improve this and point out flaws(ie: variable, processes, and memory management). I've tested it briefly to find it switch back and forth forms/modules nicely.
Main Module:
The 'Other' or 'Separate' Module (in this case I called it "MainConfig"):
The multiple 'screens' Android app UI paradigm is typically realized by using the MVC (model, view, controller) architecture, since we want to build our B4J software as we built the B4A app; we want to show a new B4A 'UI window' (while others are in background or disappear) and go back to the original 'UI main window' by hitting "OK" in the current 'UI window'.
I believe some have asked & started threads related to this central theme I mention above,
"Two 'forms' where does the code go?"
"Call new form"
"how do to create two forms connected by a button?"
This is what I did and I need your help to improve this and point out flaws(ie: variable, processes, and memory management). I've tested it briefly to find it switch back and forth forms/modules nicely.
Main Module:
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 400
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private ConfigureMainBut As Button
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("LayoutMain") 'Load the layout file.
MainForm.Show
End Sub
Sub ReStartMain
MainForm.Initialize("MainForm", 600, 400)
MainForm.RootPane.LoadLayout("LayoutMain") 'Load the layout file.
MainForm.Show
End Sub
Sub ConfigureMainBut_Action 'Action is used rather than MouseEvent for testing purposes
CallSub(MainConfig, "MainConfigStart")
MainForm.Close
End Sub
The 'Other' or 'Separate' Module (in this case I called it "MainConfig"):
B4X:
'Static code module
Sub Process_Globals
Private fx As JFX
Private MainConfigForm As Form 'Form is the UI interface screen object
Private ButtonOK As Button
End Sub
Public Sub MainConfigStart
MainConfigForm.Initialize("MainConfigForm", 200, 375)
MainConfigForm.RootPane.LoadLayout("LayoutMainConfig") 'Load the layout file.
MainConfigForm.Show
End Sub
Sub ButtonOK_MouseClicked (EventData As MouseEvent) 'MouseEvent is used rather than Action for testing purposes
CallSub(Main, "ReStartMain")
MainConfigForm.Close
End Sub