Sign in to follow this  
Followers 0
poplat

GUICtrlCreateRadio

5 posts in this topic

#1 ·  Posted (edited)

Hello everybody,

I've wrote several scripts using AutoIt and all of them work perfectly, but ....

I'd like to combine all of my script with one GUI

So I've made one and I have a little problem .... I'm using AutoIt for a week so I donot know everything yet ....

The problem is that I have 3 radio , and each radio has its own input, how can i make other radio inputs disabled when one radio was chosen

Here is my sript, I would be greatful for any help

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

$konsola = GUICreate('Automat Lotus Notes - POPLAT')

GUISetOnEvent($GUI_EVENT_CLOSE, "zamknij")

GUISetState(@SW_SHOW)

; nazwa grupy

GuiCtrlCreateGroup("Wybierz konfiguracje Lotus Notes", 10, 10, 380, 380)

; konfiguracja ln dla nowego sklepu

$radio1 = GuiCtrlCreateRadio(" Konfiguracja Lotus Notes dla nowego sklepu ", 20, 40)

GuiCtrlSetState(-1, $GUI_CHECKED)

$imie1 = GuiCtrlCreateInput("Wprowadź Imię Ajenta", 50, 70, 230, 20)

$nazwisko1 = GuiCtrlCreateInput("Wprowadź Nazwisko Ajenta", 50, 100, 230, 20)

$mpk1 = GuiCtrlCreateInput("Wprowadź Nr Sklepu bez "&"Z", 50, 130, 230, 20)

; konfiguracja ln na podstawie user.id

$radio2 = GuiCtrlCreateRadio(" Konfiguracja Lotus Notes w przypadku awarii (user.id) ", 20, 160)

$imie2 = GuiCtrlCreateInput("Wprowadź Imię Ajenta", 50, 190, 230, 20)

$nazwisko2 = GuiCtrlCreateInput("Wprowadź Nazwisko Ajenta", 50, 220, 230, 20)

$mpk2 = GuiCtrlCreateInput("Wprowadź Nr Sklepu bez "&"Z", 50, 250, 230, 20)

; konfiguracja ln dla brzednia

$radio3 = GuiCtrlCreateRadio(" Konfiguracja Lotus Notes dla komputerów szkoleniowych (Brzednia) ", 20, 280)

$nrstanowiska = GuiCtrlCreateInput("Wprowadź Nr stanowiska", 50, 310, 230, 20)

; przycisk zaniechaj

$zaniechaj = GuiCtrlCreateButton("Zaniechaj", 90, 347, 100, 27)

GUICtrlSetOnEvent($zaniechaj, "Zaniechaj")

; przycisk dalej

$dalej = GuiCtrlCreateButton("Dalej", 220, 347, 100, 27)

GUICtrlSetState(-1,$GUI_FOCUS)

GUICtrlSetOnEvent($dalej, "Dalej")

; GUI MESSAGE LOOP

GuiSetState()

While GuiGetMsg() <> $GUI_EVENT_CLOSE

WEnd

Func Dalej()

;here will be include

EndFunc

Func Zaniechaj()

MsgBox(0, "Automat Lotus Notes - POPLAT", "Przerwane przez użytkownika")

Exit

EndFunc

Func radio2()

;???

EndFunc

Func zamknij()

Exit

EndFunc

thx, poplat

Edited by poplat

Share this post


Link to post
Share on other sites



The problem is that I have 3 radio , and each radio has its own input, how can i make other radio inputs disabled when one radio was chosen

<{POST_SNAPBACK}>

Have you seen the function GuiCtrlSetState?

Set an event for each radio button, and have those functions enable or disable the appropriate controls.


Phillip

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

add a "Group" control, and put the radio's inside it

EDIT: whoops! helps if I read a bit more attentively :)

Edited by quaizywabbit

[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

Have you seen the function GuiCtrlSetState?

Set an event for each radio button, and have those functions enable or disable the appropriate controls.

<{POST_SNAPBACK}>

Yes i know the command and already use it in the script,

but i do not know how to combine thesse coommand to work properly

Share this post


Link to post
Share on other sites

thx to everybody that helped me, i finaly make it all work

Share this post


Link to post
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
Sign in to follow this  
Followers 0