in this post: https://www.b4x.com/android/forum/threads/designer-menu-items.56602/#content Erel indicates
which crashes, and this (with varying number of -):
which does not crash but does not produce a normal separator.
Could I have an example of what to insert into the menu structure to create a separator?
TIA
I have not managed to make this work. Tried this:Use a simple string item with the value of "-" to create a separator.
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim mb As MenuBar
End Sub ' Process_Globals
Sub AppStart( Form1 As Form, Args() As String )
MainForm = Form1
MainForm.RootPane.LoadLayout( "Main" ) 'Load the layout file.
MainForm.Show
mb.Initialize( "" )
MainForm.RootPane.AddNode( mb, 0, 0, -1, -1 )
' Add Settings menu to menu bar
Dim SettingsMenu As Menu
SettingsMenu.Initialize( "Settings", "" )
mb.Menus.Add( SettingsMenu )
' Add Serial Ports submenu to Settings menu
Dim SerialPort As Menu
SerialPort.Initialize( "Ports", "" )
SettingsMenu.MenuItems.Add( SerialPort )
' add Baud Rates
Dim mnBaudrates As Menu
mnBaudrates.Initialize( "Baudrates", "" )
SettingsMenu.MenuItems.Add( mnBaudrates )
' add separator
Dim s As String = "-"
SettingsMenu.MenuItems.Add( s )
' add COM TimeOut
Dim m As MenuItem
m.Initialize( "COM Time Out", "mCOMTimeOut" )
SettingsMenu.MenuItems.Add( m )
End Sub
B4X:
' add separator
Dim m As MenuItem
m.Initialize( "-", "" )
SettingsMenu.MenuItems.Add( m )
Could I have an example of what to insert into the menu structure to create a separator?
TIA