Hallo,
Bugfix hat vor einigen Jahren ein interessantes Script geschrieben, mit dem man den Inhalt einiger Controls in einer ini-Datei speichern und wiederherstellen kann.
Dieses Script befindet sich mit im Dateianhang als "org.au3", ist nach minimalen Änderungen jetzt lauffhäig.
Kennt Ihr Euch mit ISN so gut aus, dass Ihr das Script so anpassen könnt, dass es auch mit einer (jeder) Oberfläche lauffähig ist, die in ISN erstellt wurde?
Die hochgeladene Datei ist eine als zip umbenannte rar Datei, weil die Forumssoftware rar nicht erlaubt - weiß jemand, warum nicht?
Falls es Probleme gibt, kann ich die Dateien auch einzeln hochladen.
Zum Thema:
Die in Analogie zum Script von Bugfix aufgebaute Oberfläche liegt in der "test.isf".
; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ;
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
#include <EditConstants.au3>
$Form_01 = GUICreate("Titel",548,259,-1,-1,-1,-1)
GUISetBkColor(0xFFFFFF,$Form_01)
$CB1 = GUICtrlCreateCheckbox("Check 1",20,20,82,20,-1,-1)
GUICtrlSetBkColor(-1,"0xFFFFFF")
$CB2 = GUICtrlCreateCheckbox("Check 2",20,52,82,20,-1,-1)
GUICtrlSetBkColor(-1,"0xFFFFFF")
$IN1 = GUICtrlCreateInput("Input 1",100,20,150,20,-1,$WS_EX_CLIENTEDGE)
$IN2 = GUICtrlCreateInput("Input 2",100,52,150,20,-1,$WS_EX_CLIENTEDGE)
$RB1 = GUICtrlCreateRadio("Radio 1",280,20,150,20,-1,-1)
GUICtrlSetBkColor(-1,"0xFFFFFF")
$RB2 = GUICtrlCreateRadio("Radio 2",280,52,150,20,-1,-1)
GUICtrlSetBkColor(-1,"0xFFFFFF")
#cs
[gui]
Handle_deklaration=default
Handle_deklaration_const=false
title=Titel
breite=548
hoehe=259
style=-1
exstyle=-1
bgcolour=0xFFFFFF
bgimage=none
handle=$Form_01
parent=
code=
codebeforegui=
xpos=-1
ypos=-1
center_gui=true
title_textmode=normal
isf_include_once=false
only_controls_in_isf=false
const_modus=default
gui_code_in_function=false
gui_code_in_function_name=
gui_event_close=
gui_event_minimize=
gui_event_restore=
gui_event_maximize=
gui_event_mousemove=
gui_event_primarydown=
gui_event_primaryup=
gui_event_secoundarydown=
gui_event_secoundaryup=
gui_event_resized=
gui_event_dropped=
defaultfont=MS Sans Serif
defaultfontsize=8
[0x000F2CD0]
type=checkbox
handle=418
locked=0
resize=
x=20
y=20
width=82
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=$CB1
text=Check 1
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=0xFFFFFF
code=
order=0
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00112CCE]
type=checkbox
handle=419
locked=0
resize=
x=20
y=52
width=82
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=$CB2
text=Check 2
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=0xFFFFFF
code=
tabpage=-1
iconindex=
iconlarge=0
textmode=text
order=2
[0x00202CDA]
type=input
handle=420
locked=0
resize=
x=100
y=20
width=150
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=$IN1
text=Input 1
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=$WS_EX_CLIENTEDGE
bgcolour=
code=
order=3
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00142CCC]
type=input
handle=421
locked=0
resize=
x=100
y=52
width=150
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=$IN2
text=Input 2
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=$WS_EX_CLIENTEDGE
bgcolour=
code=
tabpage=-1
iconindex=
iconlarge=0
textmode=text
order=4
[0x00242C0E]
type=radio
handle=430
locked=0
resize=
x=280
y=20
width=150
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=$RB1
text=Radio 1
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=0xFFFFFF
code=
order=5
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00182CC8]
type=radio
handle=422
locked=0
resize=
x=280
y=52
width=150
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=$RB2
text=Radio 2
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=0xFFFFFF
code=
tabpage=-1
iconindex=
iconlarge=0
textmode=text
order=6
#ce
Alles anzeigen
Das darauf basierende Script ist in der "test.au3" und endet mit Fehlermeldungen wie:
Cannot assign values to constants.:
$CB1 = GUICtrlCreateCheckbox("Check 1",20,20,82,20,-1,-1)
^ ERROR
Wer ISN verwendet, kann die test.isn als Projekt öffnen.
(2) Wenn Beispiel 1 läuft, komme ich zu Frage 2.
Wie kann man das Script von Bugfix so anpassen, dass es für jede Oberfläche verwendet werden kann, die mit ISN erstellt wird?
Dazu ist vielleicht nur 1 Zwischenschritt notwendig.
Der untenstehende Quellcode müsste ausgetauscht werden gegen ein Script, welches aus der GUI $Form_01 alle Controls auslesen und wie unten stehend speichern kann. Kennt Ihr eine Umsetzung?