Jump to content

(Beginner) Help with GUI / Koda / Script


symadis
 Share

Recommended Posts

Hello!

I have made a script that's working fine.

At the begining of my script i have put somes options like

$test = 1014 
$prod = 1013
$mode = $prodoÝ÷ Û]5Ý©©×Mxj·¢{k¢Rçè­è¥jéÜl¬r¸©¶'!jx©îjYrÓ~¦¡×­£ZµëÞ®,Ý7ê׬¶ôߪk¡Öî¶,Ûhr(±ëa{Mú^½©nz)Ú謢+kË­ªi«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì((I¥½¸MQIP-½U$ÍÑ¥½¸½É´ô(ÀÌØí½É´ÈôU%
ÉÑ ÅÕ½Ðí½É´ÄÅÕ½Ðì°ÄäØ°ÄÔÀ°ÐàÀ°ÈÌܤ(ÀÌØíµ½ôU%
Ñɱ
ÉÑ
½µ¼ ÅÕ½ÐìÅÕ½Ðì°ÌÈ°ÈаàÄ°ÈÔ¤)U%
ÑɱMÑÑ ´Ä°ÅÕ½ÐíQÍÑñAɽÕÑ¥½¸ÅÕ½Ðì°ÅÕ½ÐíAɽÕÑ¥½¸ÅÕ½Ðì¤)U%MÑMÑÑ¡M]}M!=¤(¹I¥½¸9-½U$ÍÑ¥½¸()]¡¥±Ä($ÀÌØí¹5ÍôU%Ñ5Í ¤(%MÝ¥Ñ ÀÌØí¹5Í($%
ÍÀÌØíU%}Y9Q}
1=M($$%á¥Ð((%¹MÝ¥Ñ )]¹

My question are:

- WHERE DO I PUT THE ENTIRE SCRIPT IN THE GUI SCRIPT? In the While 1 or after?

- How can i get $mode's value to see if it's working

- Can we use a label and value like in html ? (label : Test, value : 1014 ....)

<select name="mode" id="mode">
   <option value="1014">Test</option>
   <option value="1013">Production</option>
</select>

Thank you for your help,

Loris

Link to comment
Share on other sites

Read the control, then test the values. So, if $value = "Test" Then $mode = $test Else $mode = $prod. Something like that... :P It will have to be a case. Or, put into the exit func. So Read the values into a varible, exitloop, then GUIDelete. Then you can continue with the rest of the code. This snippet should be put it at the top of your script, bellow the includes.

You should map your script out like this (How I would do it):

#compiler_ directives

#includes

Options

Hotkeys

Declaring Varible/Const

GUI Control Code

Code that is needed for the GUI to be as you want it.

i.e- populating a combo with your data from an ini.

While loop

Functions

Edited by Bert
Link to comment
Share on other sites

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form1", 196, 150, 480, 237)
$mode = GUICtrlCreateCombo("", 32, 24, 81, 25)
GUICtrlSetData(-1, "Test|Production", "Production")
$ok = GUICtrlCreateButton("OK", 32, 70, 81, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $ok
            DoMyStuff()
    EndSwitch
WEnd

Func DoMyStuff()
    ; note: read values from GUI before delete GUI
    $value = GUICtrlRead($mode)
    GUIDelete($Form2)
    ; here is your script, do something with value ...
    MsgBox(0,'result', $value)
    Exit
EndFunc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...