################################################ ### ### ####### Setting Glopus for GoPal ####### ### ### ####### Grundidee von athos ####### ### Umsetzung athos & panik ### #### #### ### (c) 2009 Team Sokobana ### ####### http://forum.pocketnavigation.de ####### ### http://www.varioskin.de ### ################################################ # ############################################################ ### Anwendung auf eigene Gefahr und ohne Gewährleistung! ### ### Dieses Programm unterliegt den Rechten der ### ###Creative Commons Attribut Non-Commercial Share Alike 3### ### Lizenz. Genaue Angaben finden Sie beiliegend ### ### in der Datei Lizenz_VarioSkin3.txt ### ############################################################ # # --- Beginn Hauptteil --- # Vorbelegung von Variablen für das direkte Aufrufen der setting.mscr presetliste[1] = "PKW" presetliste[2] = "Bike" presetliste[3] = "Fahrrad" presetliste[4] = "Wandern" feldliste[1] = "Feld1" feldliste[2] = "Feld2" feldliste[3] = "Feld3" feldliste[4] = "Feld4" feldliste[5] = "Feld5" feldliste[6] = "Feld6" feldliste[7] = "Feld7" feldliste[8] = "Feld8" feldliste[9] = "Feld Bat Sat Mem Menü" presetauswahl = 1 feldauswahl = 1 wartezeit = 15 # # [Presetnummer][Stylenummer][zu_aendernde_Groesse] # Style1 stylearray[1][1][0] = "1100" stylearray[1][1][1] = "21" stylearray[1][1][2] = "-3" stylearray[1][1][3] = "0" stylearray[1][1][4] = "80" stylearray[1][1][5] = "16" # stylearray[1][2][0] = "900" stylearray[1][2][1] = "16" stylearray[1][2][2] = "-2" stylearray[1][2][3] = "2" stylearray[1][2][4] = "80" stylearray[1][2][5] = "16" # stylearray[1][3][0] = "700" stylearray[1][3][1] = "15" stylearray[1][3][2] = "-1" stylearray[1][3][3] = "3" stylearray[1][3][4] = "80" stylearray[1][3][5] = "16" # Style2 stylearray[2][1][0] = "1400" stylearray[2][1][1] = "28" stylearray[2][1][2] = "4" stylearray[2][1][3] = "0" stylearray[2][1][4] = "110" stylearray[2][1][5] = "32" # stylearray[2][2][0] = "1300" stylearray[2][2][1] = "25" stylearray[2][2][2] = "4" stylearray[2][2][3] = "4" stylearray[2][2][4] = "110" stylearray[2][2][5] = "32" # stylearray[2][3][0] = "1200" stylearray[2][3][1] = "22" stylearray[2][3][2] = "4" stylearray[2][3][3] = "8" stylearray[2][3][4] = "110" stylearray[2][3][5] = "32" # Style3 stylearray[3][1][0] = "1400" stylearray[3][1][1] = "28" stylearray[3][1][2] = "4" stylearray[3][1][3] = "0" stylearray[3][1][4] = "110" stylearray[3][1][5] = "32" # stylearray[3][2][0] = "1300" stylearray[3][2][1] = "25" stylearray[3][2][2] = "4" stylearray[3][2][3] = "4" stylearray[3][2][4] = "110" stylearray[3][2][5] = "32" # stylearray[3][3][0] = "1200" stylearray[3][3][1] = "22" stylearray[3][3][2] = "4" stylearray[3][3][3] = "8" stylearray[3][3][4] = "110" stylearray[3][3][5] = "32" # Style4 stylearray[4][1][0] = "1400" stylearray[4][1][1] = "28" stylearray[4][1][2] = "4" stylearray[4][1][3] = "0" stylearray[4][1][4] = "110" stylearray[4][1][5] = "32" # stylearray[4][2][0] = "1300" stylearray[4][2][1] = "25" stylearray[4][2][2] = "4" stylearray[4][2][3] = "4" stylearray[4][2][4] = "110" stylearray[4][2][5] = "32" # stylearray[4][3][0] = "1200" stylearray[4][3][1] = "22" stylearray[4][3][2] = "4" stylearray[4][3][3] = "8" stylearray[4][3][4] = "110" stylearray[4][3][5] = "32" # bildschirmbreite = 480.0 bildschirmhoehe = 272.0 vorschaubildbreite = 262.0 vorschaubildhoehe = 148.0 bildbeginnhorizontal = 100.0 bildbeginnvertikal = 23.0 faktorbreite = round((vorschaubildbreite/bildschirmbreite),3) * 1.000 faktorhoehe = round((vorschaubildhoehe/bildschirmhoehe),3) * 1.000 # scriptordner = SystemPath("ScriptPath") mortscriptexe = SystemPath("ScriptExe") \ "MortScript.exe" naviordner = "\My Flash Disk\navigation\" koordexe = "\My Flash Disk\Sokobana\Koord\koord465.exe" osmordner = "\Storage Card\Programme\NaviPOWM\" windowsmobiledir = "\Windows" # call presetstrings # # Entscheidung, ob setting.mscr ohne Parameter - also direkt - aufgerufen wurde If ((argument1=0 AND argument2=0) OR argument3=1) call basissetup EndIf # # Ist ein Preset gewählt, ob mit Parameterübergabe oder nach vorhergehender PresetAuswahl geht es hier weiter If (argument1=1 OR argument1=2 OR argument1=3 OR argument1=4) # call presetstrings # aktualisierungsparameter = 1 # # Entscheidungen, ob es sich um Haupt- oder Zusatzfelder handelt - in diesem Fall: Hauptfelder If (argument2=1 OR argument2=2 OR argument2=3 OR argument2=4 OR argument2=5 OR argument2=6 OR argument2=7 OR argument2=8) # FeldParameter werden in bestimmten Variablen festgehalten feld_str1 = "Feld" & argument2 feld_var = argument2 # Werte werden für die genaue Preset/Feld-Kombination aus der zugeordneten MNinfo[Preset]-Datei geholt call ini_lesen If (stylewert_aus_ini = 0) anzeigewert_aus_ini = "-" else EndIf # Sprung zu den jeweiligen Auswahlabschnitten call arraybelegung_anzeige_big If (not (anzeigewert eq "-")) call arraybelegung_color call arraybelegung_style else stylewert = 0 colorfontwert = colorfontwert_aus_ini EndIf else EndIf # Entscheidungen, ob es sich um Haupt- oder Zusatzfelder handelt - in diesem Fall: Zusatzfelder(Systemeinblendung "SatBatMem") If (argument2=9) # FeldParameter werden in bestimmten Variablen festgehalten feld_str1 = "FeldSat" feld_var = argument2 # Werte werden für die genaue Preset/Feld-Kombination aus der zugeordneten MNinfo[Preset]-Datei geholt call ini_lesen # zusatz1 = Question("Sollen weitere Anzeigen dargestellt werden ? ^NL^ Satellitenanzahl^NL^ Batteriezustand^NL^ Freier Speicher^NL^^NL^Momentan (On\Off) : " & stylewert_aus_ini , "SatBatMem", "YesNo") # # Sprung zu den jeweiligen Auswahlabschnitten # stylewert = zusatz1 # zusatz2 = Question("Soll ein Kompass mit Menüauswahl dargestellt werden ? ^NL^ Trackaufzeichnung^NL^ Reset Track^NL^ Glopus Map^NL^ GloGoSet^NL^^NL^Momentan (On\Off) : " & compasswert_aus_ini , "Kompass", "YesNo") # # Sprung zu den jeweiligen Auswahlabschnitten # compasswert = zusatz2 # else EndIf # abschließendes Schreiben der Anzeigeparameter in die zugeordnete MNinfo[Preset]-Datei # !!! Diese dienen gleichzeitig als Sicherung - eine weitere Sicherung der Preset/Feld-Kombinationen ist nicht nötig, wenn Glopus+Verzeichnis gesichert wird !!! call ini_schreiben # else EndIf # call toolende exit # # --- Ende Hauptteil --- # # # --- Beginn der Subroutinen --- # sub presetstrings # Je nach übergebenen Parameter wird der Titel des aktuellen Presets in eine StringVariable übernommen If ((argument1=1) OR (argument1=2) OR (argument1=3) OR (argument1=4)) preset_str2 = presetliste[argument1] endif # PresetParameter werden in bestimmten Variablen festgehalten preset_str1 = "Preset" & argument1 preset_var = argument1 mninfodatei = scriptordner \ "MNInfo_" & preset_str1 & ".ini" endsub # sub basissetup basisauswahl[1] = "Presets konfigurieren (Inhalte, Style)" basisauswahl[2] = "Presets konfigurieren (Lage)" basisauswahl[3] = "Synchronisierung (MnInfo.ini-GoPal ,MnInfo.ini-NaviPOWM ,Map.ini)" basisauswahl[4] = "Einblendung aus NaviPOWM entfernen" If (DirExists(windowsmobiledir)) basisauswahl[5] = "Beliebiges Preset in Gopal aktivieren" basisauswahl[6] = "Startverhalten Glopus - GoPal festlegen" endif # Edit by athos Aufruf des Backup aus Glopus basisauswahl[7] = "Backup von Glopus mit seinen Einstellungen" # aktualisierungsparameter = 0 SetChoiceEntryFormat( 18,14, Tahoma ) ChoiceDefault("Auswahl einer Aktion", "Bitte wählen Sie eine Aktion" , 0, 25, basisauswahl ) case(1) call preset_auswahl call feld_auswahl aktualisierungsparameter = 1 # hier geht es statt zum Toolende im Hauptteil weiter bis Ende Hauptteil ! case(2) aktualisierungsparameter = 1 call preset_auswahl_lage exit case(3) call sync call toolende exit case(4) call NaviPOWMohne exit case(5) call presetaktivierung call toolende exit case(6) call glostart call toolende exit # Edit by athos Aufruf des Backup aus Glopus case(7) call backup call toolende exit case(0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolendeabbruch exit EndChoice endsub # Auswahl der Presets, wenn setting.mscr direkt aufgerufen wurde sub preset_auswahl SetChoiceEntryFormat( 18,14, Tahoma ) presetauswahl = Choice("Auswahl des Presets", "Bitte wählen Sie ein Preset aus" , presetauswahl, wartezeit, presetliste) If (presetauswahl = 0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolendeabbruch exit else argument1 = presetauswahl EndIf endsub # Auswahl der Felder, wenn setting.mscr direkt aufgerufen wurde sub feld_auswahl SetChoiceEntryFormat( 18,14, Tahoma ) feldauswahl = Choice("Auswahl des Feldes", "Bitte wählen Sie ein Feld aus" , feldauswahl, wartezeit, feldliste) If (feldauswahl = 0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolendeabbruch exit else argument2 = feldauswahl EndIf endsub # Lage der Felder bearbeiten sub preset_auswahl_lage If (WndExists("Glopus")) Minimize("Glopus") endif SetChoiceEntryFormat( 18,14, Arial ) presetauswahl = Choice("Auswahl des Presets", "Bitte wählen Sie ein Preset aus" , presetauswahl, wartezeit, presetliste) If (presetauswahl = 0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolende exit else argument1 = presetauswahl EndIf # Je nach übergebenen Parameter wird der Titel des aktuellen Presets in eine StringVariable übernommen call presetstrings call feldedit endsub sub feld_auswahl_lage SetChoiceEntryFormat( 18,14, Arial ) feldliste[9] = "" feldauswahl = Choice("Auswahl des Feldes", "Bitte wählen Sie ein Feld aus" , feldauswahl, wartezeit, feldliste) If (feldauswahl = 0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolende exit else argument2 = feldauswahl EndIf If (feldauswahl = 9) abbruchtext = " Grund:^NL^ Keine korrekte Auswahl getroffen^NL^ " call toolendeabbruch exit EndIf endsub # sub feldedit # call feld_auswahl_lage feld_str1 = "Feld" & argument2 feld_var = argument2 # call ini_lesen_lage # ax = Part( positionwert, ",", -4 ) ax = Part( ax, "(", -1 ) ay = Part( positionwert, ",", -3 ) # call positioneingeben # call ini_schreiben_lage # feldauswahl = feldauswahl + 1 if (einzelfeldbearbeitung=0) if (feldauswahl = 9) feldauswahl = 1 presetauswahl = presetauswahl + 1 call preset_auswahl_lage endif if ((feldauswahl = 9) AND (presetauswahl = 4)) feldauswahl = 0 presetauswahl = 0 endif call feldedit else call toolende exit endif exit # endsub sub positioneingeben eingabewert = "" If (DirExists(windowsmobiledir)) Run (koordexe, "window=0 sip=1") sleep(200) Run (koordexe, "window=0 sip=1") EndIf # eingabewert = Input( "Bitte Position Anfang X [ax] eingeben :" , "Positionswerteingabe" , false, false, ax ) if (eingabewert eq "") eingabewert = ax endif ax = eingabewert eingabewert = "" If (DirExists(windowsmobiledir)) Run (koordexe, "window=0 sip=1") sleep(200) Run (koordexe, "window=0 sip=1") EndIf eingabewert = Input( "Bitte Position Anfang Y [ay] eingeben :" , "Positionswerteingabe" , false, false, ay ) if (eingabewert eq "") eingabewert = ay endif ay = eingabewert eingabewert = "" # If (DirExists(windowsmobiledir)) Run (koordexe, "window=0 sip=0") EndIf # endsub # Lesen und Schreiben von Werten aus der zugeordneten MNinfo[Preset]-Datei sub ini_lesen IniRead ( mninfodatei, "TOP", feld_str1 , stylewert_aus_ini) IniRead ( mninfodatei, "TOP", "Compass" , compasswert_aus_ini) IniRead ( mninfodatei, feld_str1 & "=1", "Text" , anzeigewert_aus_ini) IniRead ( mninfodatei, feld_str1 & "=1", "Color_1" , colorfontwert_aus_ini) # IniRead ( mninfodatei, feld_str1 & "=1", "Pos" , position_aus_ini) positionwert = position_aus_ini endsub sub ini_lesen_lage IniRead ( mninfodatei, "TOP", feld_str1 , stylewert_aus_ini) IniRead ( mninfodatei, feld_str1 & "=1", "Pos" , position_aus_ini) positionwert = position_aus_ini endsub sub ini_schreiben If (DirExists(windowsmobiledir)) Run( mortscriptexe, """" & scriptordner & "\warten.mscr" & """ argument=2" ) endif sleep(1000) ErrorLevel ("syntax") # IniWrite ( mninfodatei, "TOP", feld_str1 , stylewert) # If (feld_var = 9) IniWrite ( mninfodatei, "TOP", "FeldSat" , stylewert) IniWrite ( mninfodatei, "TOP", "FeldBat" , stylewert) IniWrite ( mninfodatei, "TOP", "FeldMem" , stylewert) IniWrite ( mninfodatei, "TOP", "Compass" , compasswert) if (preset_var = 1) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons", "VorschauSat" ,stylewert) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons", "VorschauBat" ,stylewert) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons", "VorschauMem" ,stylewert) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons", "VorschauKompmenue" ,compasswert) else IniWrite( scriptordner \ "GloGoSet.ini", "Buttons" & preset_var, "VorschauSat" ,stylewert) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons" & preset_var, "VorschauBat" ,stylewert) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons" & preset_var, "VorschauMem" ,stylewert) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons" & preset_var, "VorschauKompmenue" ,compasswert) endif else endif # If (feld_var < 9) IniWrite( mninfodatei, feld_str1 & "=1", "Text" ,anzeigewert) IniWrite( mninfodatei, feld_str1 & "=2", "Text" ,anzeigewert) IniWrite( mninfodatei, feld_str1 & "=3", "Text" ,anzeigewert) # IniWrite( mninfodatei, feld_str1 & "=1", "Color_1" ,colorfontwert) IniWrite( mninfodatei, feld_str1 & "=2", "Color_1" ,colorfontwert) IniWrite( mninfodatei, feld_str1 & "=3", "Color_1" ,colorfontwert) else endif # If (DirExists(windowsmobiledir)) KillScript( "warten.mscr" ) endif call presetaktivierung endsub sub ini_schreiben_lage If (DirExists(windowsmobiledir)) Run( mortscriptexe, """" & scriptordner & "\warten.mscr" & """ argument=2" ) endif sleep(1000) ErrorLevel ("syntax") # Styles schreiben for schleife1 = 1 to 3 IniWrite( mninfodatei, feld_str1 & "=" & schleife1, "Font.lfWeight" ,stylearray[preset_var][schleife1][0]) IniWrite( mninfodatei, feld_str1 & "=" & schleife1, "Font.lfHeight" ,stylearray[preset_var][schleife1][1]) IniWrite( mninfodatei, feld_str1 & "=" & schleife1, "YOffset" ,stylearray[preset_var][schleife1][2]) positionwert = "RECT( " & ax & ", " & (ay + stylearray[preset_var][schleife1][3]) & ", " & (ax + stylearray[preset_var][schleife1][4]) & ", " & (ay + stylearray[preset_var][schleife1][5]) & ")" IniWrite( mninfodatei, feld_str1 & "=" & schleife1, "Pos" ,positionwert) # Vorschaubilder in Glogoset.ini dynamisch nach Positionswert des bearbeiteten Presets und Feldes anpassen if (schleife1=1) ax_vorschaubild = floor((((ax) * faktorbreite) + bildbeginnhorizontal), 0) ay_vorschaubild = floor((((ay + stylearray[preset_var][schleife1][3]) * faktorhoehe) + bildbeginnvertikal), 0) ex_vorschaubild = floor((ax_vorschaubild + ((stylearray[preset_var][schleife1][4]) * faktorbreite)), 0) ey_vorschaubild = floor((ay_vorschaubild + ((stylearray[preset_var][schleife1][5]) * faktorhoehe)), 0) if not (ex_vorschaubild > ax_vorschaubild) abbruchtext = "Fehler(ax nicht kleiner ex bei " & "Vorschau" & feld_str1 & preset_str1 & ")" call toolendeabbruch exit endif if not (ey_vorschaubild > ay_vorschaubild) abbruchtext = "Fehler(ay nicht kleiner ey bei " & "Vorschau" & feld_str1 & preset_str1 & ")" call toolendeabbruch exit endif if (preset_var = 1) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons", "Vorschau" & feld_str1 & preset_str1, 1) elseif (preset_var > 1) IniWrite( scriptordner \ "GloGoSet.ini", "Buttons" & preset_var, "Vorschau" & feld_str1 & preset_str1, stylewert_aus_ini) else endif positionwert = "RECT( " & ax_vorschaubild & ", " & ay_vorschaubild & ", " & ex_vorschaubild & ", " & ey_vorschaubild & ")" IniWrite( scriptordner \ "GloGoSet.ini", "Vorschau" & feld_str1 & preset_str1 & "=" & schleife1, "Pos" ,positionwert) endif next # Vorschaubilder in Glogoset.ini dynamisch nach Positionswert der zusätzlichen Einblendungen anpassen - wird momentan nur vom Programmierer EINMALIG benutzt ! # Sat bezeichnung = "Sat" IniRead( mninfodatei, "Feld" & bezeichnung & "=" & 1, "Pos" ,positionwert) call festfelder # Bat bezeichnung = "Bat" IniRead( mninfodatei, "Feld" & bezeichnung & "=" & 1, "Pos" ,positionwert) call festfelder # Mem bezeichnung = "Mem" IniRead( mninfodatei, "Feld" & bezeichnung & "=" & 1, "Pos" ,positionwert) call festfelder # Kompmenue bezeichnung = "Compass" IniRead( mninfodatei, bezeichnung & "=" & 1, "Pos" ,positionwert) bezeichnung = "Kompmenue" call festfelder # If (DirExists(windowsmobiledir)) KillScript( "warten.mscr" ) endif endsub sub festfelder ax = Part( positionwert, ",", -4 ) ax = Part( ax, "(", -1 ) ay = Part( positionwert, ",", -3 ) ex = Part( positionwert, ",", -2 ) ey = Part( positionwert, ",", -1 ) ey = Part( ey, ")", -2 ) ax_vorschaubild = floor((((ax) * faktorbreite) + bildbeginnhorizontal), 0) ay_vorschaubild = floor((((ay) * faktorhoehe) + bildbeginnvertikal), 0) ex_vorschaubild = floor((ax_vorschaubild + ((ex-ax) * faktorbreite)), 0) if (ex_vorschaubild > (vorschaubildbreite + bildbeginnhorizontal)) ex_vorschaubild = ((vorschaubildbreite + bildbeginnhorizontal) - 1) endif ey_vorschaubild = floor((ay_vorschaubild + ((ey-ay) * faktorhoehe)), 0) if not (ex_vorschaubild > ax_vorschaubild) abbruchtext = "Fehler(ax nicht kleiner ex bei " & bezeichnung & ")" call toolendeabbruch exit endif if not (ey_vorschaubild > ay_vorschaubild) abbruchtext = "Fehler(ax nicht kleiner ex bei " & bezeichnung & ")" call toolendeabbruch exit endif positionwert = "RECT( " & ax_vorschaubild & ", " & ay_vorschaubild & ", " & ex_vorschaubild & ", " & ey_vorschaubild & ")" IniWrite( scriptordner \ "GloGoSet.ini", "Vorschau" & bezeichnung & "=" & 1, "Pos" ,positionwert) endsub # # Vorbereitungsroutine für die Auswahl, was im Feld angezeigt wird (Hauptfeldanzeige) Sub arraybelegung_anzeige_big # ein mehrdimensionales Array wird angelegt; es kann sehr gut und gezielt angsprochen werden und beinhaltet mehr Informationen anzeigewert1[0][1] = "Höhe" anzeigewert1[1][1] = "%Altitude% m" anzeigewert1[0][2] = "Maximale Höhe" anzeigewert1[1][2] = "%MaxAltitude% m" anzeigewert1[0][3] = "Durchschnittsgeschwindigkeit" anzeigewert1[1][3] = "%Average% km/h" anzeigewert1[0][4] = "Aktuelle Geschwindigkeit" anzeigewert1[1][4] = "%Speed% km/h" anzeigewert1[0][5] = "Maximale Geschwindigkeit" anzeigewert1[1][5] = "%MaxSpeed% km/h" anzeigewert1[0][6] = "Trip Strecke" anzeigewert1[1][6] = "%Distance% km" anzeigewert1[0][7] = "Trip Zeit" anzeigewert1[1][7] = "%TripTime%" anzeigewert1[0][8] = "Vergangene Zeit, bei der eine Geschwindigkeit > 3 km/h gemessen wurde" anzeigewert1[1][8] = "%DriveTime%" anzeigewert1[0][9] = "Pausenzeit" anzeigewert1[1][9] = "%Break%" anzeigewert1[0][10] = "Fahrtrichtung in Grad" anzeigewert1[1][10] = "%Direction% ° " anzeigewert1[0][11] = "Steigung in Prozent" anzeigewert1[1][11] = "%Slope% %%" anzeigewert1[0][12] = "Horizontal dilution of percision" anzeigewert1[1][12] = "%HDOP%" anzeigewert1[0][13] = "Winkel zu Sonne" anzeigewert1[1][13] = "%SunAzimut%°" anzeigewert1[0][14] = "Höhenwinkel zur Sonne" anzeigewert1[1][14] = "%SunAltitude%°" anzeigewert1[0][15] = "keine Anzeige" anzeigewert1[1][15] = "-" # # Die Vorbelegung des Listfeldes in der kommenden Choise-Abfrage wird ermittelt anzeigewertvorbelegung = 1 for a = 1 to 15 If (anzeigewert_aus_ini eq anzeigewert1[1][a]) anzeigewertvorbelegung = a else EndIf next # arrayanzeigevorbelegung = anzeigewert1 call auswahldialog_anzeige endsub # Auswahldialog (Choise-Abfrage) und Zuweisung des Anzeigewertes sub auswahldialog_anzeige b = 0 SetChoiceEntryFormat( 18,14, Tahoma ) b = Choice("Einblendung " & feld_str1, "Was soll im " & feld_str1 & " des " & preset_str1 & " (" & preset_str2 & ") angezeigt werden?" , anzeigewertvorbelegung, wartezeit, arrayanzeigevorbelegung[0]) # If (b = 0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolendeabbruch exit else anzeigewert = arrayanzeigevorbelegung[1][b] EndIf endsub # # Vorbereitungsroutine für die Auswahl, welche Schriftfarbe der Anzeigewert annehmen soll sub arraybelegung_color colorfontwert1[0][1] = "Rot" colorfontwert1[1][1] = "Color(255,0,0)" colorfontwert1[0][2] = "Blau" colorfontwert1[1][2] = "Color(0,0,255)" colorfontwert1[0][3] = "Grün" colorfontwert1[1][3] = "Color(0,150,0)" colorfontwert1[0][4] = "Schwarz" colorfontwert1[1][4] = "Color(1,0,0)" colorfontwert1[0][5] = "Braun" colorfontwert1[1][5] = "Color(80,0,0)" colorfontwert1[0][6] = "Grau" colorfontwert1[1][6] = "Color(80,80,80)" colorfontwert1[0][7] = "Rosa" colorfontwert1[1][7] = "Color(255,100,100)" colorfontwert1[0][8] = "Violett" colorfontwert1[1][8] = "Color(100,0,100)" colorfontwert1[0][9] = "Eigene Farbe definieren" colorfontwert1[1][9] = colorfontwert_aus_ini # Die Vorbelegung des Listfeldes in der kommenden Choise-Abfrage wird ermittelt colorfontwertvorbelegung = 9 for a = 1 to 8 If (colorfontwert_aus_ini eq colorfontwert1[1][a]) colorfontwertvorbelegung = a else EndIf next # arraycolorfontvorbelegung = colorfontwert1 call auswahldialog_colorfont endsub # Auswahldialog (Choise-Abfrage) und Zuweisung des Schriftfarbwertes sub auswahldialog_colorfont b = 0 SetChoiceEntryFormat( 18,14, Tahoma ) b = Choice("Schriftfarbe " & feld_str1, "Welche Schriftfarbe soll " & feld_str1 & " des " & preset_str1 & " (" & preset_str2 & ") annehmen?" , colorfontwertvorbelegung, wartezeit, arraycolorfontvorbelegung[0]) # If (b = 0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolendeabbruch exit elseIf (b=9) call farbemischen else colorfontwert = arraycolorfontvorbelegung[1][b] EndIf endsub # Eigene Farbe mischen - Dialog wurde auf notwendigste, einfachste Eingabedarstellung beschränkt Sub farbemischen If (DirExists(windowsmobiledir)) Run (koordexe, "window=0 sip=1") Run (koordexe, "window=0 sip=1") EndIf # colorwerteingabe= Input( "Bitte definieren Sie Ihre gewünschte Farbe: Color_1([Rot],[Grün],[Blau)]" , "Farbwerteingabe" , false, false, colorfontwert_aus_ini ) # If (DirExists(windowsmobiledir)) Run (koordexe, "window=0 sip=0") EndIf # If (colorwerteingabe eq "") colorfontwert = colorfontwert_aus_ini else EndIf # colorfontwert = colorwerteingabe EndSub # # Vorbereitungsroutine für die Auswahl, welche Style verwendet werden soll oder ob Anzeige deaktiviert wird sub arraybelegung_style stylewert1[0][1] = "Groß" stylewert1[1][1] = 1 stylewert1[0][2] = "Mittel" stylewert1[1][2] = 2 stylewert1[0][3] = "Klein" stylewert1[1][3] = 3 # Die Vorbelegung des Listfeldes in der kommenden Choise-Abfrage wird ermittelt stylewertvorbelegung = 2 for a = 1 to 3 If (stylewert_aus_ini = stylewert1[1][a]) stylewertvorbelegung = a else EndIf next # arraystylevorbelegung = stylewert1 call auswahldialog_style endsub # Auswahldialog (Choise-Abfrage) und Zuweisung des Styles sub auswahldialog_style b = 0 SetChoiceEntryFormat( 18,14, Tahoma ) b = Choice("Style " & feld_str1, "Welchen Schriftstyle soll " & feld_str1 & " des " & preset_str1 & " (" & preset_str2 & ") annehmen?" , stylewertvorbelegung, wartezeit, arraystylevorbelegung[0]) # If (b = 0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolendeabbruch exit else stylewert = arraystylevorbelegung[1][b] EndIf endsub # # Presets werden zur Auswahl angeboten und können nun direkt im Gopalprogramm aktiviert/deaktiviert werden sub presetaktivierung If (DirExists(naviordner)) LastActivPreset = RegRead("HKCU", "Software\PkSoft\GpsLog\GloGo", "LastActivPreset") SetChoiceEntryFormat( 18,14, Tahoma ) If (FileExists(naviordner \ "MNInfo_deaktiviert.ini")) datei1 = naviordner \ "MNInfo_deaktiviert.ini" datei2 = naviordner \ "MNInfo.ini" presetliste[5] = "Reaktivierung" endif If (FileExists(naviordner \ "MNInfo.ini")) datei1 = naviordner \ "MNInfo.ini" datei2 = naviordner \ "MNInfo_deaktiviert.ini" presetliste[5] = "Deaktivierung" endif ChoiceDefault("Presetaktivierung", "Presetaktivierung" & "^NL^" & "Bitte wählen Sie das Preset aus, das nun in GoPal aktiviert werden soll" & "^NL^" & "Aktuell Preset" & LastActivPreset , preset_var, wartezeit, presetliste) case(1) Copy( scriptordner \ "MNInfo_Preset" & 1 & ".ini", naviordner \ "MNInfo.ini", true ) LastActivPreset = 1 RegWriteString( "HKCU", "Software\PkSoft\GpsLog\GloGo", "LastActivPreset", LastActivPreset) SetMessageFont( 30, Tahoma ) sleepmessage(3,"^NL^" & "^NL^" & " Preset """ & presetliste[1] & """ wurde in GoPal" & "^NL^" & " aktiviert bzw. aktualisiert.") case(2) Copy( scriptordner \ "MNInfo_Preset" & 2 & ".ini", naviordner \ "MNInfo.ini", true ) LastActivPreset = 2 RegWriteString( "HKCU", "Software\PkSoft\GpsLog\GloGo", "LastActivPreset", LastActivPreset) SetMessageFont( 30, Tahoma ) sleepmessage(3,"^NL^" & "^NL^" & " Preset """ & presetliste[2] & """ wurde in GoPal" & "^NL^" & " aktiviert bzw. aktualisiert.") case(3) Copy( scriptordner \ "MNInfo_Preset" & 3 & ".ini", naviordner \ "MNInfo.ini", true ) LastActivPreset = 2 RegWriteString( "HKCU", "Software\PkSoft\GpsLog\GloGo", "LastActivPreset", LastActivPreset) SetMessageFont( 30, Tahoma ) sleepmessage(3,"^NL^" & "^NL^" & " Preset """ & presetliste[3] & """ wurde in GoPal" & "^NL^" & " aktiviert bzw. aktualisiert.") case(4) Copy( scriptordner \ "MNInfo_Preset" & 4 & ".ini", naviordner \ "MNInfo.ini", true ) LastActivPreset = 2 RegWriteString( "HKCU", "Software\PkSoft\GpsLog\GloGo", "LastActivPreset", LastActivPreset) SetMessageFont( 30, Tahoma ) sleepmessage(3,"^NL^" & "^NL^" & " Preset """ & presetliste[4] & """ wurde in GoPal" & "^NL^" & " aktiviert bzw. aktualisiert.") case(5) # MNInfo wird umbenannt und damit deaktiviert Rename( datei1, datei2, true ) call toolende exit case(0) abbruchtext = " Grund:^NL^ Keine Auswahl getroffen^NL^ " call toolendeabbruch exit EndChoice Else call toolende exit EndIf endsub # sub sync If (DirExists(windowsmobiledir)) mninfodatei = naviordner \ "MNInfo.ini" else mninfodatei = scriptordner \ "MNInfo_Preset1.ini" endif If ((FileExists(mninfodatei)) AND (FileExists(scriptordner \ "Map.ini")) AND (FileExists(scriptordner \ "MNInfo_NaviPOWM.ini"))) If (DirExists(windowsmobiledir)) Run( mortscriptexe, """" & scriptordner & "\warten.mscr" & """ argument=3" ) endif sleep(4000) for a = 1 to 8 tempwert = IniRead ( mninfodatei , "TOP" , "Feld" & a) if (tempwert > 1) tempwert = 1 endif IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "TOP" , "Feld" & a, tempwert) IniWrite( scriptordner \ "Map.ini" , "Felder" , "Feld" & a, tempwert) next for a = 1 to 8 stylewert = IniRead ( mninfodatei, "TOP" , "Feld" & a) if (stylewert > 0) tempwert = IniRead ( mninfodatei , "Feld" & a & "=" & stylewert, "Pos") IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "Feld" & a & "=1", "Pos", tempwert) ax = Part( tempwert, ",", -4 ) ax = Part( ax, "(", -1 ) ay = Part( tempwert, ",", -3 ) ex = Part( tempwert, ",", -2 ) ey = Part( tempwert, ",", -1 ) ey = Part( ey, ")", -2 ) tempwert = "RECT( " & ax & ", " & (ay-17) & ", " & ex & ", " & (ey-17) & ")" IniWrite( scriptordner \ "Map.ini" , "Feld" & a & "=1", "Pos", tempwert) tempwert = IniRead ( mninfodatei , "Feld" & a & "=" & stylewert, "YOffset") IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "Feld" & a & "=1", "YOffset", tempwert) IniWrite( scriptordner \ "Map.ini" , "Feld" & a & "=1", "YOffset", tempwert) tempwert = IniRead ( mninfodatei , "Feld" & a & "=" & stylewert, "Text") IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "Feld" & a & "=1", "Text", tempwert) IniWrite( scriptordner \ "Map.ini" , "Feld" & a & "=1", "Text", tempwert) tempwert = IniRead ( mninfodatei , "Feld" & a & "=" & stylewert, "Color_0") IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "Feld" & a & "=1", "Color_0", tempwert) IniWrite( scriptordner \ "Map.ini" , "Feld" & a & "=1", "Color_0", tempwert) tempwert = IniRead ( mninfodatei , "Feld" & a & "=" & stylewert, "Color_1") IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "Feld" & a & "=1", "Color_1", tempwert) IniWrite( scriptordner \ "Map.ini" , "Feld" & a & "=1", "Color_1", tempwert) tempwert = IniRead ( mninfodatei , "Feld" & a & "=" & stylewert, "Font.lfWeight") IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "Feld" & a & "=1", "Font.lfWeight", tempwert) IniWrite( scriptordner \ "Map.ini" , "Feld" & a & "=1", "Font.lfWeight", tempwert) tempwert = IniRead ( mninfodatei , "Feld" & a & "=" & stylewert, "Font.lfHeight") IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "Feld" & a & "=1", "Font.lfHeight", tempwert) IniWrite( scriptordner \ "Map.ini" , "Feld" & a & "=1", "Font.lfHeight", tempwert) tempwert = IniRead ( mninfodatei , "Feld" & a & "=" & stylewert, "TransparentColor") IniWrite( scriptordner \ "MNInfo_NaviPOWM.ini" , "Feld" & a & "=1", "TransparentColor", tempwert) IniWrite( scriptordner \ "Map.ini" , "Feld" & a & "=1", "TransparentColor", tempwert) endif next If (DirExists(osmordner)) Copy( scriptordner \ "MNInfo_NaviPOWM.ini", osmordner \ "MNInfo.ini", true ) endif If (DirExists(windowsmobiledir)) KillScript( "warten.mscr" ) endif If (DirExists(windowsmobiledir)) SetMessageFont( 30, Tahoma ) sleepmessage(2, "^NL^" & "^NL^" & " Die Synchronisierung wurde" & "^NL^" & " erfolgreich beendet.", "Meldung") else sleepmessage(2, "Synchronisierung erfolgreich beendet", "Meldung") endif else abbruchtext = " Grund:^NL^ Eine der drei Dateien existiert nicht:^NL^ " & mninfodatei & "^NL^ " & scriptordner \ "Map.ini" & "^NL^ " & scriptordner \ "MNInfo_NaviPOWM.ini" & "^NL^" call toolendeabbruch exit endif endsub # # verschiedene Startoptionen werden hier angeboten sub glostart Glopusstartwert = RegRead("HKCU", "Software\PkSoft\GpsLog\GloGo", "Glopusstartwert") Glopusstart[1] = "Glopus und Gopal getrennt starten" Glopusstart[2] = "Glopus mit Gopal starten und beenden" Glopusstart[3] = "Glopus mit Gopal starten, aber nicht beenden" SetChoiceEntryFormat( 18,14, Tahoma ) ChoiceDefault("Glopus Start", "Glopus Startverhalten" & "^NL^" & "Bitte wählen Sie eine Startart aus." , Glopusstartwert, wartezeit, Glopusstart ) case(1) Glopusstartwert = 1 RegWriteString( "HKCU", "Software\PkSoft\GpsLog\GloGo", "Glopusstartwert", Glopusstartwert) Copy( naviordner \ "Skin480x272\PPSkin\punkt_rot.png", naviordner \ "Skin480x272\PPSkin\glopus_autostart.png", 1 ) case(2) Glopusstartwert = 2 RegWriteString( "HKCU", "Software\PkSoft\GpsLog\GloGo", "Glopusstartwert", Glopusstartwert) Copy( naviordner \ "Skin480x272\PPSkin\punkt_gruen.png", naviordner \ "Skin480x272\PPSkin\glopus_autostart.png", 1 ) case(3) Glopusstartwert = 3 RegWriteString( "HKCU", "Software\PkSoft\GpsLog\GloGo", "Glopusstartwert", Glopusstartwert) Copy( naviordner \ "Skin480x272\PPSkin\punkt_gruen.png", naviordner \ "Skin480x272\PPSkin\glopus_autostart.png", 1 ) case(0) call toolende EndChoice endsub # ToolEndeRoutinen sub toolendeabbruch if (DirExists(windowsmobiledir)) SetMessageFont( 30, Tahoma ) sleep(500) SleepMessage(2, "^NL^" & " Tool wird beendet ... " & "^NL^" & abbruchtext & "^NL^", "Ende...") else Message("Tool wird beendet ..." & "^NL^" & abbruchtext & "^NL^", "Ende...") endif If (WndExists("Glopus")) Show ("Glopus") endif exit endsub # Edit by athos Aufruf des Backup aus Glopus sub NaviPOWMohne If (fileExists(osmordner \ "MNInfo.ini")) Delete( osmordner \ "MNInfo.ini" ) endif endsub sub backup #--------------------------- Konfiguration ------------------------------- If (Not DirExists("\Storage Card")) Message ("Es ist keine Speicherkarte eingelegt oder Sie haben den Storage Card2 Fehler !") Exit EndIf If (FileExists ("\My Flash Disk\Programme\Glopus\Glopus.exe")) If( question( "Glopus sichern?^NL^Glopus wird beendet^NL^und am Ende wieder gestartet" ) ) kill ("glopus.exe") If (fileExists("\Storage Card\BackupV3\glopus.zip")) Rename("\Storage Card\BackupV3\glopus.zip","\Storage Card\BackupV3\glopus.zip" & ".old",1) EndIf freespace1 = 1 freespace2 = 2 Run( "\My Flash Disk\Sokobana\Mortscript2\MortScript.exe", """\My Flash Disk\Sokobana\Mortscript2\warten.mscr" & """ zeit=99 schrift=30 okerl=0 text=_______Bitte_warten_Sie.^NL^^NL^Glopus_wird_gesichert" ) ZipFiles("\My Flash Disk\Programme\Glopus\*.*", "\Storage Card\BackupV3\glopus.zip",1,"\My Flash Disk\Programme\Glopus",8 ) While (%freespace1% <> %freespace2%) freespace1 = FreeDiskSpace("\") sleep (300) freespace2 = FreeDiskSpace("\") EndWhile runwait ( "\My Flash Disk\Sokobana\Mortscript2\GloRegBackup.exe") RegWriteString( "HKCU", "Software\PkSoft\GpsLog", "CurrentView","GloGoSet") KillScript( "warten.mscr" ) CallScript ( "\My Flash Disk\Sokobana\Mortscript\Glopusactiv.mscr") EndIf EndIf endsub sub toolende if (DirExists(windowsmobiledir)) If (WndExists("Glopus")) Show ("Glopus") if (aktualisierungsparameter = 1) If (DirExists(windowsmobiledir)) Run( mortscriptexe, """" & scriptordner & "\warten.mscr" & """ argument=1" ) endif WaitForActive( "Glopus", 10 ) windowok = 0 notaus = 0 While ( windowok < 1 ) if (ColorAt (90, 215) = RGB(0, 255, 0)) windowok = 1 sleep(500) notaus = notaus + 1 if (notaus = 12) windowok = 1 endif endif EndWhile sleep(500) MouseClick( 80, 65 ) If (DirExists(windowsmobiledir)) KillScript( "warten.mscr" ) endif sleep(500) notaus = 0 sleep(500) While (ColorAt (210, 100) = RGB(132, 130, 132)) sleep(500) notaus = notaus + 1 if (notaus = 12) vergleich = 1 SleepMessage(1, " Zwangsende von while " & "^NL^" & " bitte Admin melden " & "^NL^", "Ende...") endif EndWhile sleep(500) if (ColorAt (210, 100) = RGB(8, 0, 0)) sleep(500) MouseClick( 80, 65 ) SetMessageFont( 30, Tahoma ) SleepMessage(2, "^NL^" & "^NL^" & " Vorschau wurde aktualisiert ... ", "Ende...") else endif exit endif else SetMessageFont( 30, Tahoma ) sleep(500) SleepMessage(2, "^NL^" & "^NL^" & " Tool wird beendet ... ", "Ende...") exit EndIf else Message("Tool wird beendet ..." & abbruchtext & "^NL^", "Ende...") endif exit endsub # # --- Ende der Subroutinen / Ende Script ---