Sub App_Start
WaitCursor(True)
If (DateYear(Now)>=2009) AND (DateMonth(Now)>2) Then
Msgbox("Application test period expired", version1)
AppClose
End If
'Start-up registry handling
reg1.New1
reg1.RootKey(reg1.rtLocalMachine)
reg1.createsubkey("Software","Jxxx")
bit.New1
sid1=reg1.GetString(regkey,"id")
If (sid1="") OR (StrLength(sid1)=9) Then
sid1=StrToUpper(bit.dectohex(Abs(Rnd(123456789,987654321))))
reg1.setstringvalue(regkey,"id",sid1)
End If
lbpid.Text="Key: "&sid1
sini=reg1.GetString(regkey,"inifile")
If sini="" Then
sini="default.msprf"
reg1.setstringvalue(regkey,"inifile",sini)
End If
lbcurrentprofile.Text=sini
'VGA-mode Korrektur
If form1.Height>400 Then
fontdiff=7 'Change to VGA mode
pendiff=3 'Change to VGA mode
vgafac=7
vgafac2=2
vga2=2 'Targets Zuschlag
isvga=True
vga.ChangeToVGA 'Change to VGA mode
End If
'Bildschirmhintergrund
screen1(0).X = 0
screen1(0).Y = 0
screen1(1).X = Form1.Width
screen1(1).Y = 0
screen1(2).X = Form1.Width
screen1(2).Y = Form1.Height+100
screen1(3).X = 0
screen1(3).Y = Form1.Height+100
'Objekte positionieren
panel3.left=form1.Width/2-panel3.width/2 'Locate the splash panel
buload.Left=form1.width-buload.Width 'Locate the Load button
buup.Left=form1.width-buup.Width 'Locate the Load button
budn.Left=form1.width-budn.Width 'Locate the Load button
buleft.Left=form1.width-buleft.Width 'Locate the Load button
buright.Left=form1.width-buright.Width 'Locate the Load button
Form1.Show
WaitCursor(True)
DoEvents
'Device relevant initialization
Form1.ForeLayer=True
formwidth=form1.Width
fw2=formwidth*8
formheight=form1.Height
fh2=formheight*8
tbc.New1 ("Form3", -5,0, formwidth+5,formheight+5)
tbc.AddTabPage("Config")
tbc.SetColor(0,Rgb(220,220,220))
tbc.AddTabPage("WX")
tbc.SetColor(1,Rgb(220,220,220))
tbc.AddTabPage("Text")
tbc.SetColor(2,Rgb(202,200,174))
tbc.AddTabPage("Misc")
tbc.SetColor(3,Rgb(188,204,172))
Controls() = GetControls("Form2")
For i=0 To ArrayLen(controls())-1
tbc.AddControl(Control(Controls(i)).name,0,Control(controls(i)).left,Control(controls(i)).top)
Next
Controls() = GetControls("wxForm")
For i=0 To ArrayLen(controls())-1
tbc.AddControl(Control(Controls(i)).name,1,Control(controls(i)).left,Control(controls(i)).top)
Next
Controls() = GetControls("TextForm")
For i=0 To ArrayLen(controls())-1
tbc.AddControl(Control(Controls(i)).name,2,Control(controls(i)).left,Control(controls(i)).top)
Next
Controls() = GetControls("MiscForm")
For i=0 To ArrayLen(controls())-1
tbc.AddControl(Control(Controls(i)).name,3,Control(controls(i)).left,Control(controls(i)).top)
Next
DoEvents
TimeFormat ("HH:mm:ss")
DateFormat ("dd/mm/yy")
Hardware1.New1
lbscreen.Text="Screen: "&formwidth & " x " & formheight
lbdeviceid.Text="Device: "&Hardware1.GetDeviceID
lbnet.Text=".Net: "&Hardware1.NetVersion
lbver1.text="Version: "&version1
flb.New1("Form1",B4PObject(1))
flb.FullScreen(False)
lbversion.Text=Version1
flb.TextAlignment("lbversion",flb.alCenter)
obj.New1(False)
flb3.New1("Form3",B4PObject(3))
flb3.FullScreen(False)
flb3.TextAlignment("lbcurrentprofile",flb.alCenter)
flb4.New1("wxform",B4PObject(4))
flb4.FullScreen(False)
coldi.New1 'colordialog
gps.New1
converter1.New1
ctxm.New1
ctxm.AddItem("Buttons")
ctxm.AddItem("-")
ctxm.AddItem("Center>Tap")
ctxm.AddItem("Center<GPS")
ctxm.AddItem("-")
ctxm.AddItem("Full/Window")
ctxm.AddItem("-")
ctxm.AddItem("more...")
ctxm.AddItem("-")
ctxm.AddItem("Quit")
flb.AddContextMenu("Form1",ctxm.Value)
ctx2.New1
ctx2.AddItem("5 NM")
ctx2.AddItem("10 NM")
ctx2.AddItem("15 NM")
ctx2.AddItem("20 NM")
ctx2.AddItem("25 NM")
ctx2.AddItem("30 NM")
ctx2.AddItem("40 NM")
ctx2.AddItem("50 NM")
ctx2.AddItem("60 NM")
ctx2.AddItem("80 NM")
ctx2.AddItem("100 NM")
ctx2.AddItem("140 NM")
ctx2.AddItem("180 NM")
ctx2.AddItem("240 NM")
flb.AddContextMenu("burange",ctx2.Value)
ctx3.New1
ctx3.AddItem("more...")
flb.AddContextMenu("buload",ctx3.Value)
WaitCursor(True)
'Load the configuration
Readinifile (lbcurrentprofile.Text)
lbwx.Text=""
lbwx.Left=10
lbwx.Width=formwidth-15
lbtext.Text=""
lbtext.Left=10
lbtext.Width=formwidth-15
'Map relevant initialization
calclong 'calc the current long factor
LoadMaps 'Load the maps
buGPS.Color=cSilver
panel3.Visible=False
DoEvents
WaitCursor(False)
timer2.Enabled = True
End Sub