Not understanding How to import a form (gui) From Form Studio 2

Area for english topics
Antworten
Ingosa
Beiträge: 2
Registriert: Mo 2. Nov 2020, 08:44
Kontaktdaten:

Not understanding How to import a form (gui) From Form Studio 2

Beitrag von Ingosa »

Good day to you all.
I am new to autoit and form studio.
I had min making forms in the au3 file and made some small programs.
But found the studio and wanted to try that.
I did checkt the option that form studio would do the import it self, It dose trow in the line #include "Forms\SnipIt.isf" but when i hit F5 it dos not show the forum.
This is my Snipit.ifs file:

Code: Alles auswählen

; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ;
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
#include <TreeViewConstants.au3>
#include <EditConstants.au3>

Global $SnipIt = GUICreate("SnipIt",442,315,-1,-1,-1,-1)
GUICtrlCreateLabel("",0,270,350,2,-1,-1)
GUICtrlSetBkColor(-1,"-2")
GUICtrlCreateTreeView(10,10,180,266,-1,$WS_EX_CLIENTEDGE)
GUICtrlCreateButton("&Toggle",125,290,70,20,-1,-1)
GUICtrlCreateButton("&Info",205,290,70,20,-1,-1)
GUICtrlCreateButton("&Col./Exp.",284,290,70,20,-1,-1)
GUICtrlCreateButton("&Cancel",362,290,70,20,-1,-1)
GUICtrlCreateLabel("",0,284,500,2,$SS_SUNKEN,-1)
GUICtrlSetBkColor(-1,"-2")
GUICtrlCreateButton("&Mark Area",201,10,70,20,-1,-1)
GUICtrlCreateButton("&Area Select",280,10,70,20,-1,-1)
GUICtrlCreateButton("&Load Picture",359,10,70,20,-1,-1)
GUICtrlCreatePic(@scriptdir&"\"&"Images\blank.jpg",253,145,125,125,-1,-1)
GUICtrlCreateInput("",271,34,160,20,-1,$WS_EX_CLIENTEDGE)
GUICtrlSetTip(-1,"Image ID")
GUICtrlCreateInput("",271,58,160,19,-1,$WS_EX_CLIENTEDGE)
GUICtrlCreateInput("",271,82,160,20,-1,$WS_EX_CLIENTEDGE)
GUICtrlCreateInput("",271,107,160,20,-1,$WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("ImageID:",215,37,50,15,$SS_RIGHT,-1)
GUICtrlSetBkColor(-1,"-2")
GUICtrlCreateLabel("ImageSpot:",211,62,55,15,-1,-1)
GUICtrlSetBkColor(-1,"-2")
GUICtrlCreateLabel("SelectSpot:",211,87,55,15,-1,-1)
GUICtrlSetBkColor(-1,"-2")
GUICtrlCreateLabel("Infot:",210,110,55,15,$SS_RIGHT,-1)
GUICtrlSetBkColor(-1,"-2")



#cs
[gui]
Handle_deklaration=default
Handle_deklaration_const=false
title=SnipIt
breite=442
hoehe=315
style=-1
exstyle=-1
bgcolour=0xF0F0F0
bgimage=none
handle=$SnipIt
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
[0x00012004]
type=label
handle=420
locked=0
resize=
x=0
y=270
width=350
height=2
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=-2
code=
order=0
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012006]
type=treeview
handle=421
locked=0
resize=
x=10
y=10
width=180
height=266
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=$WS_EX_CLIENTEDGE
bgcolour=
code=
order=2
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x0001200A]
type=button
handle=422
locked=0
resize=
x=125
y=290
width=70
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=&Toggle
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=
code=
order=3
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x0001200C]
type=button
handle=423
locked=0
resize=
x=205
y=290
width=70
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=&Info
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=
code=
order=4
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x0001200E]
type=button
handle=424
locked=0
resize=
x=284
y=290
width=70
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=&Col./Exp.
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=
code=
order=5
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012010]
type=button
handle=425
locked=0
resize=
x=362
y=290
width=70
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=&Cancel
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=
code=
order=6
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012012]
type=label
handle=426
locked=0
resize=
x=0
y=284
width=500
height=2
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=
state=$GUI_SHOW+$GUI_ENABLE
style=$SS_SUNKEN
exstyle=
bgcolour=-2
code=
order=7
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012014]
type=button
handle=427
locked=0
resize=
x=201
y=10
width=70
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=&Mark Area
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=
code=
tabpage=-1
iconindex=
iconlarge=0
textmode=text
order=8
[0x00012016]
type=button
handle=428
locked=0
resize=
x=280
y=10
width=70
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=&Area Select
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=
code=
tabpage=-1
iconindex=
iconlarge=0
textmode=text
order=9
[0x00012018]
type=button
handle=429
locked=0
resize=
x=359
y=10
width=70
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=&Load Picture
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=
code=
tabpage=-1
iconindex=
iconlarge=0
textmode=text
order=10
[0x0001201A]
type=image
handle=430
locked=0
resize=
x=253
y=145
width=125
height=125
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=Images\blank.jpg
textcolour=0x000000
id=
text=
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=
code=
order=11
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x0001201C]
type=input
handle=431
locked=0
resize=
x=271
y=34
width=160
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=Image ID
bgimage=
textcolour=0x000000
id=
text=
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=$WS_EX_CLIENTEDGE
bgcolour=
code=
order=12
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x0001201E]
type=input
handle=432
locked=0
resize=
x=271
y=58
width=160
height=19
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=$WS_EX_CLIENTEDGE
bgcolour=
code=
order=13
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012020]
type=input
handle=433
locked=0
resize=
x=271
y=82
width=160
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=$WS_EX_CLIENTEDGE
bgcolour=
code=
order=14
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012022]
type=input
handle=434
locked=0
resize=
x=271
y=107
width=160
height=20
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=$WS_EX_CLIENTEDGE
bgcolour=
code=
order=15
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012024]
type=label
handle=435
locked=0
resize=
x=215
y=37
width=50
height=15
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=ImageID:
state=$GUI_SHOW+$GUI_ENABLE
style=$SS_RIGHT
exstyle=
bgcolour=-2
code=
order=16
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012026]
type=label
handle=436
locked=0
resize=
x=211
y=62
width=55
height=15
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=ImageSpot:
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=-2
code=
order=17
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x00012028]
type=label
handle=437
locked=0
resize=
x=211
y=87
width=55
height=15
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=SelectSpot:
state=$GUI_SHOW+$GUI_ENABLE
style=
exstyle=
bgcolour=-2
code=
order=18
tabpage=-1
iconindex=
iconlarge=0
textmode=text
[0x0001202A]
type=label
handle=438
locked=0
resize=
x=210
y=110
width=55
height=15
func=
font=MS Sans Serif
fontsize=8
fontstyle=400
fontattribute=0
tooltip=
bgimage=
textcolour=0x000000
id=
text=Infot:
state=$GUI_SHOW+$GUI_ENABLE
style=$SS_RIGHT
exstyle=
bgcolour=-2
code=
tabpage=-1
iconindex=
iconlarge=0
textmode=text
order=19
#ce
I did not post my au3 file because its only holding the line #include "Forms\SnipIt.isf"

I have bin checking the internet and youtube to find tutorials on it. also the help file points to the Create a gui tutorial.
And gave me the import in the au3 file.
I gues its some thing simple i mist, but maybe it would help others with this problem to :)
Hope some one can help me.

Best Regards
Benutzeravatar
ISI360
Administrator
Beiträge: 322
Registriert: Fr 11. Okt 2013, 13:06
Kontaktdaten:

Re: Not understanding How to import a form (gui) From Form Studio 2

Beitrag von ISI360 »

Hi

The answer is simple: The gui is currently only hidden.

The #include is correct and so the "gui code" is already in your script, you only need to tell autoit when to display the gui.
And this can be done with one simple command: GuiSetState(@SW_SHOW,$SnipIt)

This should display the GUI when you test your script.

NOTE: If your GUI displays only for a fews millisecounds after this change...then you need a little bit more in your script. (While loop at the end for example)
Or simply see the testprojects for the ISN AutoIt Studio, aviable on my homepage. There are ready to use projects, ready to edit and experiment ;)

Hope this helps.
Antworten