Hi Erel,
Lots of excellent features, unfortunately we still get not intialized errors on buttons that have been initialized.
It crashes on b = sender, the second time this sub is used. The first time works. The sub works fine in version 2.52.
Sub SetupMenu_Click
If ClickEvent Then Return
DoEvents: ProgressDialogShow(Common.Language.Phrase("Wait")): DoEvents
Dim B As Button: Dim T As String: B = Sender: T = B.Tag
Select T
Case "New", "Existing"
If Common.CurrentProfile.IsSaved OR Not(Common.CurrentProfile.GetDeviceConfigured(1)) Then
If T = "Existing" Then
ProgressDialogHide: DoEvents
LoadProfileReturnState = "SetupMenu": LoadProfileGotoState = "Devices"
GotoState("LoadProfile"): IgnoreCMD = False: Return
Else
Common.CurrentProfile.Initialize("New"): GetLanguage: GotoState("Devices")
End If
Else
Dim Result As Int: Result = Msgbox2(Common.Language.Phrase("Action?"), Common.Language.Phrase("CurrentUnsaved"), Common.Language.Phrase("SaveCurrent"), Common.Language.Phrase("EditCurrentProfile"), Common.Language.Phrase("DiscardCurrent"), Null)
If Result = DialogResponse.POSITIVE Then GotoState("SaveProfile")
If Result = DialogResponse.CANCEL Then GotoState("Activities")
If Result = DialogResponse.NEGATIVE Then
If T = "Existing" Then
ProgressDialogHide: DoEvents
LoadProfileReturnState = "SetupMenu": LoadProfileGotoState = "Devices"
GotoState("LoadProfile"): IgnoreCMD = False: Return
Else
Common.CurrentProfile.Initialize("New"): GetLanguage: GotoState("Devices")
End If
End If
End If
Case "Current"
If Not(Common.CurrentProfile.GetDeviceConfigured(1)) OR Not(Common.CurrentProfile.GetActivityPartial(1)) Then
GotoState("Devices")
Else
GotoState("Activities")
End If
Case "Advanced"
GotoState("ProfileView")
Case "Save"
GotoState("SaveProfile")
Case "Language"
GetLanguage
Case "Exit"
If Not(Common.CurrentProfile.DeviceConfigured(1)) OR Not(Common.CurrentProfile.GetActivityConfigured(1)) Then
IgnoreCMD = False: ProgressDialogHide: Activity.Finish ' ***
End If
Common.CurrentWatchMode = -1: Ini.WatchMode = Common.CurrentWatchMode: Ini.SaveIni
DBase.UnloadDB: DBLoaded = False: SetupMode = False
GotoState("Splash")
End Select
ProgressDialogHide: DoEvents
IgnoreCMD = False
End Sub