D
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private Page2 As Page
End Sub
Private Sub Application_Start (Nav As NavigationController)
'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("1")
NavControl.ShowPage(Page1)
Page2.Initialize("Page2")
Page2.RootPanel.Color = Colors.Red
End Sub
Sub Page1_Click
NavControl.ShowPage(Page2)
End Sub
Sub Main_ShouldAutoRotate As Boolean
If Page2.Visible = True Then
Return False 'Don't auto rotate if Page2 is visible
Else
Return True
End If
End Sub
#if OBJC
@end
@interface UINavigationController (B4IResize)
@end
@implementation UINavigationController (B4IResize)
- (BOOL)shouldAutorotate
{
return [(NSNumber*)[B4IObjectWrapper raiseEvent:self :@"_shouldautorotate" :nil] boolValue];
}
#End If
My life is in danger again!Thank you Erel!
You saved my life.
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private Page2 As Page
Private smc As SideMenuController
Private pMenu As Page
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl.Initialize("NavControl")
NavControl.NavigationBarVisible = False
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("frmMainIphone")
NavControl.ShowPage(Page1)
Page2.Initialize("Page2")
Page2.RootPanel.Color = Colors.Red
pMenu.Initialize("lp")
pMenu.RootPanel.LoadLayout("frmMenu")
smc.Initialize(pMenu, NavControl, Null)
App.KeyController = smc
End Sub
Sub Page1_Click
NavControl.ShowPage(Page2)
End Sub
Sub Main_ShouldAutoRotate As Boolean
If Page2.Visible = True Then
Return False 'Don't auto rotate if Page2 is visible
Else
Return True
End If
End Sub
#if OBJC
@end
@interface UINavigationController (B4IResize)
@end
@implementation UINavigationController (B4IResize)
- (BOOL)shouldAutorotate
{
return [(NSNumber*)[B4IObjectWrapper raiseEvent:self :@"_shouldautorotate" :nil] boolValue];
}
#End If