Войти

Показать полную графическую версию : Автоматическое переключение Checkbox


nibble74
07-04-2016, 12:39
Возможно ли реализовать авто переключение CHECKBOX в этом скрипте и как ?
Допустим установлена галочка на CHECKBOX 1, тогда с CHECKBOX 1.1 галочка снимается если она там была. Если устанавливаем на CHECKBOX 1.1, то с CHECKBOX 1 снимается.
Также CHECKBOX 2 - CHECKBOX 2.2
и так далее в случае присутствия следующих CHECKBOX .....

#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.2
#ce ----------------------------------------------------------------------------
#include <GUIConstants.au3>
Opt("TrayIconDebug", 1)
Opt("TrayIconHide", 0)
Opt("GUICloseOnESC", 1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Beep(1000, 150)
GUICreate("TEST", 440, 440)
$nInst = GUICtrlCreateButton ("Run", 7, 410, 80, 22)
$Close = GUICtrlCreateButton ("Exit", 350, 410, 80, 22)
$icon = GUICtrlCreateIcon ("@ScriptDir & '\name.exe",0, 29,375,32,32)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup("Disable", 7, 15, 426, 170)
GUICtrlSetFont(-1, -1, 700)
DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor(-1, 0x0000FF)
$id1 = GUICtrlCreateCheckbox ("CHECKBOX 1", 12, 40, -1, -1)
$id2 = GUICtrlCreateCheckbox ("CHECKBOX 2", 12, 60, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup("Restore", 7, 200, 426, 170)
GUICtrlSetFont(-1, -1, 700)
DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor(-1, 0x0000FF)
$id11 = GUICtrlCreateCheckbox ("CHECKBOX 1.1", 12, 230, -1, -1)
$id12 = GUICtrlCreateCheckbox ("CHECKBOX 2.2", 12, 250, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUISetState()
Do
$msg = GUIGetMsg()
If $msg = $Close Then Exit
If $msg = $nInst Then
GUISetState(@SW_MINIMIZE);@SW_MINIMIZE
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Отключить и остановить^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If _Checked($id1) Then
MsgBox(4096+48, '', 'CHECKBOX 1', 1)
Endif
If _Checked($id2) Then
MsgBox(4096+48, '', 'CHECKBOX 2', 1)
Endif
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^По умолчанию^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If _Checked($id11) Then
MsgBox(4096+48, '', 'CHECKBOX 1.1', 1)
Endif
If _Checked($id12) Then
MsgBox(4096+48, '', 'CHECKBOX 2.2', 1)
Endif
GUISetState(@SW_RESTORE)
If $msg = $GUI_EVENT_CLOSE Then Exit
EndIf
Until $msg = -3
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Func _Checked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_Checked

Creat0R
07-04-2016, 13:07
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.2
#ce ----------------------------------------------------------------------------

#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <GUIConstantsEx.au3>

Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)("TrayIconDebug", 1)
Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)("TrayIconHide", 0)
Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)("GUICloseOnESC", 1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Beep (http://www.autoitscript.com/autoit3/docs/functions/Beep.htm)(1000, 150)
GUICreate (http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm)("TEST", 440, 440)
$nInst = GUICtrlCreateButton (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateButton.htm) ("Run", 7, 410, 80, 22)
$Close = GUICtrlCreateButton (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateButton.htm) ("Exit", 350, 410, 80, 22)
$icon = GUICtrlCreateIcon (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateIcon.htm) ("@ScriptDir & '\name.exe",0, 29,375,32,32)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateGroup.htm)("Disable", 7, 15, 426, 170)
GUICtrlSetFont (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetFont.htm)(-1, -1, 700)
DllCall (http://www.autoitscript.com/autoit3/docs/functions/DllCall.htm)('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlGetHandle.htm)(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetColor.htm)(-1, 0x0000FF)
$id1 = GUICtrlCreateCheckbox (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateCheckbox.htm) ("CHECKBOX 1", 12, 40, -1, -1)
$id2 = GUICtrlCreateCheckbox (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateCheckbox.htm) ("CHECKBOX 2", 12, 60, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateGroup.htm)("Restore", 7, 200, 426, 170)
GUICtrlSetFont (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetFont.htm)(-1, -1, 700)
DllCall (http://www.autoitscript.com/autoit3/docs/functions/DllCall.htm)('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlGetHandle.htm)(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetColor.htm)(-1, 0x0000FF)
$id11 = GUICtrlCreateCheckbox (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateCheckbox.htm) ("CHECKBOX 1.1", 12, 230, -1, -1)
$id12 = GUICtrlCreateCheckbox (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateCheckbox.htm) ("CHECKBOX 2.2", 12, 250, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUISetState (http://www.autoitscript.com/autoit3/docs/functions/GUISetState.htm)()

While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
$iMsg = GUIGetMsg (http://www.autoitscript.com/autoit3/docs/functions/GUIGetMsg.htm)()

Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $iMsg
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $Close, $GUI_EVENT_CLOSE
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $nInst
GUISetState (http://www.autoitscript.com/autoit3/docs/functions/GUISetState.htm)(@SW_MINIMIZE (http://www.autoitscript.com/autoit3/docs/macros.htm#@sw_minimize));@SW_MINIMIZE
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Отключить и остановить^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) _Checked($id1) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
MsgBox (http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm)(4096+48, '', 'CHECKBOX 1', 1)
Endif (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) _Checked($id2) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
MsgBox (http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm)(4096+48, '', 'CHECKBOX 2', 1)
Endif (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^По умолчанию^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) _Checked($id11) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
MsgBox (http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm)(4096+48, '', 'CHECKBOX 1.1', 1)
Endif (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) _Checked($id12) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
MsgBox (http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm)(4096+48, '', 'CHECKBOX 2.2', 1)
Endif (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
GUISetState (http://www.autoitscript.com/autoit3/docs/functions/GUISetState.htm)(@SW_RESTORE (http://www.autoitscript.com/autoit3/docs/macros.htm#@sw_restore))
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $id1, $id11, $id2, $id12
$iNext = $iMsg + 1

If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) $iMsg = $id2 Or (http://www.autoitscript.com/autoit3/docs/keywords.htm#Or) $iMsg = $id12 Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
$iNext = $iMsg - 1
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)

GUICtrlSetState (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetState.htm)($iNext, $GUI_UNCHECKED)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) _Checked($iMsg) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) GUICtrlSetState (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetState.htm)($iMsg, $GUI_CHECKED)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _Checked($idControlID)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) BitAND (http://www.autoitscript.com/autoit3/docs/functions/BitAND.htm)(GUICtrlRead (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlRead.htm)($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_Checked

nibble74
08-04-2016, 08:13
Creat0R, в вашем варианте рекурсия происходит в каждой из групп, а нужно чтобы рекурсивно происходило в обеих группах.

Изначально галочки отсутствуют.

Установили на CHECKBOX 1 имеет связь с CHECKBOX 1.1
Установили на CHECKBOX 1.1 с CHECKBOX 1 снимается

Установили на CHECKBOX 2 имеет связь с CHECKBOX 2.2
Установили на CHECKBOX 2.2 с CHECKBOX 2 снимается

CHECKBOX 1 >> CHECKBOX 1.1
CHECKBOX 1 << CHECKBOX 1.1

CHECKBOX 2 >> CHECKBOX 2.2
CHECKBOX 2 << CHECKBOX 2.2

Есть ли идеи ?

Creat0R
08-04-2016, 12:20
в вашем варианте рекурсия происходит в каждой из групп, а нужно чтобы рекурсивно происходило в обеих группах. »
Не совсем понял, что значит в обеих?
1 привязан к 1.1, а 2 к 2.2.

Может так:
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.2
#ce ----------------------------------------------------------------------------

#include <GUIConstantsEx.au3>

Opt("TrayIconDebug", 1)
Opt("TrayIconHide", 0)
Opt("GUICloseOnESC", 1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Beep(1000, 150)
GUICreate("TEST", 440, 440)
$nInst = GUICtrlCreateButton ("Run", 7, 410, 80, 22)
$Close = GUICtrlCreateButton ("Exit", 350, 410, 80, 22)
$icon = GUICtrlCreateIcon ("@ScriptDir & '\name.exe",0, 29,375,32,32)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup("Disable", 7, 15, 426, 170)
GUICtrlSetFont(-1, -1, 700)
DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor(-1, 0x0000FF)
$id1 = GUICtrlCreateCheckbox ("CHECKBOX 1", 12, 40, -1, -1)
$id11 = GUICtrlCreateCheckbox ("CHECKBOX 1.1", 12, 230, -1, -1)
$id2 = GUICtrlCreateCheckbox ("CHECKBOX 2", 12, 60, -1, -1)
$id12 = GUICtrlCreateCheckbox ("CHECKBOX 2.2", 12, 250, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup("Restore", 7, 200, 426, 170)
GUICtrlSetFont(-1, -1, 700)
DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor(-1, 0x0000FF)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUISetState()

While 1
$iMsg = GUIGetMsg()

Switch $iMsg
Case $Close, $GUI_EVENT_CLOSE
Exit
Case $nInst
GUISetState(@SW_MINIMIZE);@SW_MINIMIZE
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Отключить и остановить^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If _Checked($id1) Then
MsgBox(4096+48, '', 'CHECKBOX 1', 1)
Endif
If _Checked($id2) Then
MsgBox(4096+48, '', 'CHECKBOX 2', 1)
Endif
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^По умолчанию^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If _Checked($id11) Then
MsgBox(4096+48, '', 'CHECKBOX 1.1', 1)
Endif
If _Checked($id12) Then
MsgBox(4096+48, '', 'CHECKBOX 2.2', 1)
Endif
GUISetState(@SW_RESTORE)
Case $id1, $id11, $id2, $id12
$iNext = $iMsg + 1

If $iMsg = $id11 Or $iMsg = $id12 Then
$iNext = $iMsg - 1
EndIf

GUICtrlSetState($iNext, $GUI_UNCHECKED)
If Not _Checked($iMsg) Then GUICtrlSetState($iMsg, $GUI_CHECKED)
EndSwitch
WEnd
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Func _Checked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_Checked

А вообще это делается не с CheckBox, а с Radio.

#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.2
#ce ----------------------------------------------------------------------------

#include <GUIConstantsEx.au3>

Opt("TrayIconDebug", 1)
Opt("TrayIconHide", 0)
Opt("GUICloseOnESC", 1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Beep(1000, 150)
GUICreate("TEST", 440, 440)
$nInst = GUICtrlCreateButton ("Run", 7, 410, 80, 22)
$Close = GUICtrlCreateButton ("Exit", 350, 410, 80, 22)
$icon = GUICtrlCreateIcon ("@ScriptDir & '\name.exe",0, 29,375,32,32)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup("Disable", 7, 15, 426, 170)
GUICtrlSetFont(-1, -1, 700)
DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor(-1, 0x0000FF)
$id1 = GUICtrlCreateRadio ("CHECKBOX 1", 12, 40, -1, -1)
$id11 = GUICtrlCreateRadio ("CHECKBOX 1.1", 12, 230, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup("Restore", 7, 200, 426, 170)
GUICtrlSetFont(-1, -1, 700)
DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor(-1, 0x0000FF)
$id2 = GUICtrlCreateRadio ("CHECKBOX 2", 12, 60, -1, -1)
$id12 = GUICtrlCreateRadio ("CHECKBOX 2.2", 12, 250, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUISetState()

While 1
$iMsg = GUIGetMsg()

Switch $iMsg
Case $Close, $GUI_EVENT_CLOSE
Exit
Case $nInst
GUISetState(@SW_MINIMIZE);@SW_MINIMIZE
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Отключить и остановить^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If _Checked($id1) Then
MsgBox(4096+48, '', 'CHECKBOX 1', 1)
Endif
If _Checked($id2) Then
MsgBox(4096+48, '', 'CHECKBOX 2', 1)
Endif
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^По умолчанию^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If _Checked($id11) Then
MsgBox(4096+48, '', 'CHECKBOX 1.1', 1)
Endif
If _Checked($id12) Then
MsgBox(4096+48, '', 'CHECKBOX 2.2', 1)
Endif
GUISetState(@SW_RESTORE)
EndSwitch
WEnd
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Func _Checked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_Checked

nibble74
08-04-2016, 17:43
Creat0R,

С чекбоксами лучше, там есть возможность добавить ещё пункты CHECKBOX 3 - 4 - 5 >> CHECKBOX 13 - 14 - 15 (цифры поменял для удобства) и т.д,
а вот как добавить в Radio не разобрался. Возможно ли и в Radio добавлять пункты ???

Вот с добавлением для CHECKBOX
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.2
#ce ----------------------------------------------------------------------------

#include <GUIConstantsEx.au3>

Opt("TrayIconDebug", 1)
Opt("TrayIconHide", 0)
Opt("GUICloseOnESC", 1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Beep(1000, 150)
GUICreate("TEST", 440, 440)
$nInst = GUICtrlCreateButton ("Run", 7, 410, 80, 22)
$Close = GUICtrlCreateButton ("Exit", 350, 410, 80, 22)
$icon = GUICtrlCreateIcon ("@ScriptDir & '\name.exe",0, 29,375,32,32)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup("Disable", 7, 15, 426, 170)
GUICtrlSetFont(-1, -1, 700)
DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor(-1, 0x0000FF)
$id1 = GUICtrlCreateCheckbox ("CHECKBOX 1", 12, 40, -1, -1)
$id11 = GUICtrlCreateCheckbox ("CHECKBOX 11", 12, 230, -1, -1)
$id2 = GUICtrlCreateCheckbox ("CHECKBOX 2", 12, 60, -1, -1)
$id12 = GUICtrlCreateCheckbox ("CHECKBOX 12", 12, 250, -1, -1)
$id3 = GUICtrlCreateCheckbox ("CHECKBOX 3", 12, 80, -1, -1)
$id13 = GUICtrlCreateCheckbox ("CHECKBOX 13", 12, 270, -1, -1)
$id4 = GUICtrlCreateCheckbox ("CHECKBOX 4", 12, 100, -1, -1)
$id14 = GUICtrlCreateCheckbox ("CHECKBOX 14", 12, 290, -1, -1)

;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICtrlCreateGroup("Restore", 7, 200, 426, 170)
GUICtrlSetFont(-1, -1, 700)
DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle(-1), 'wstr', 0, 'wstr', 0)
GUICtrlSetColor(-1, 0x0000FF)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUISetState()

While 1
$iMsg = GUIGetMsg()

Switch $iMsg
Case $Close, $GUI_EVENT_CLOSE
Exit
Case $nInst
GUISetState(@SW_MINIMIZE);@SW_MINIMIZE
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Отключить и остановить^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If _Checked($id1) Then
MsgBox(4096+48, '', 'CHECKBOX 1', 1)
Endif
If _Checked($id2) Then
MsgBox(4096+48, '', 'CHECKBOX 2', 1)
Endif
If _Checked($id3) Then
MsgBox(4096+48, '', 'CHECKBOX 3', 1)
Endif
If _Checked($id4) Then
MsgBox(4096+48, '', 'CHECKBOX 4', 1)
Endif
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^По умолчанию^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If _Checked($id11) Then
MsgBox(4096+48, '', 'CHECKBOX 11', 1)
Endif
If _Checked($id12) Then
MsgBox(4096+48, '', 'CHECKBOX 12', 1)
Endif
If _Checked($id13) Then
MsgBox(4096+48, '', 'CHECKBOX 13', 1)
Endif
If _Checked($id14) Then
MsgBox(4096+48, '', 'CHECKBOX 14', 1)
Endif
GUISetState(@SW_RESTORE)
Case $id1, $id11, $id2, $id12, $id3, $id13, $id4, $id14
$iNext = $iMsg + 1

If $iMsg = $id11 Or $iMsg = $id12 Then
$iNext = $iMsg - 1
EndIf
If $iMsg = $id12 Or $iMsg = $id13 Then
$iNext = $iMsg - 1
EndIf
If $iMsg = $id13 Or $iMsg = $id14 Then
$iNext = $iMsg - 1
EndIf
GUICtrlSetState($iNext, $GUI_UNCHECKED)
If Not _Checked($iMsg) Then GUICtrlSetState($iMsg, $GUI_CHECKED)
EndSwitch
WEnd
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Func _Checked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_Checked

Creat0R
12-04-2016, 21:07
...

GUIStartGroup()
$id1 = GUICtrlCreateRadio ("CHECKBOX 1", 12, 40, -1, -1)
$id11 = GUICtrlCreateRadio ("CHECKBOX 11", 12, 230, -1, -1)

GUIStartGroup()
$id2 = GUICtrlCreateRadio ("CHECKBOX 2", 12, 60, -1, -1)
$id12 = GUICtrlCreateRadio ("CHECKBOX 12", 12, 250, -1, -1)

GUIStartGroup()
$id3 = GUICtrlCreateRadio ("CHECKBOX 3", 12, 80, -1, -1)
$id13 = GUICtrlCreateRadio ("CHECKBOX 13", 12, 270, -1, -1)

GUIStartGroup()
$id4 = GUICtrlCreateRadio ("CHECKBOX 4", 12, 100, -1, -1)
$id14 = GUICtrlCreateRadio ("CHECKBOX 14", 12, 290, -1, -1)

...

Case $id1, $id11, $id2, $id12, $id3, $id13, $id4, $id14
в этом случае не нужно.

nibble74
12-04-2016, 22:18
Creat0R,

Премного благодарен !

nibble74
14-04-2016, 20:18
Creat0R,

Не разобрался с активностью и не активностью Checkbox в это скрипте
хотел сделать так чтобы при установке галочки на "ID 7" со всех "ID 1...ID 6" галочки снимались и
сами "ID 1...ID 6" становились неактивные, а при снятии галочки с "ID 7" всё становилось снова активным.
Помогите пожалуйста
#include <GUIConstants.au3>
GUICreate("Test", 250, 250)
$Button1 = GUICtrlCreateButton("Установить", 7, 220, 80, 22)
GUICtrlSetState(-1, 256 + 512) ;$GUI_FOCUS + $GUI_DEFBUTTON
$Close = GUICtrlCreateButton("Выход", 160, 220, 80, 22)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$id1 = GUICtrlCreateCheckbox ("ID 1", 16, 50, -1, -1)
GUICtrlSetState (-1,$GUI_UNCHECKED)
$id2 = GUICtrlCreateCheckbox ("ID 2", 16, 70, -1, -1)
GUICtrlSetState (-1,$GUI_CHECKED)
$id3 = GUICtrlCreateCheckbox ("ID 3", 16, 90, -1, -1)
GUICtrlSetState (-1,$GUI_CHECKED)

;GUIStartGroup()
$id4 = GUICtrlCreateCheckbox ("ID 4", 16, 120, -1, -1, $BS_AUTORADIOBUTTON)
$id5 = GUICtrlCreateCheckbox ("ID 5", 16, 140, -1, -1, $BS_AUTORADIOBUTTON)
$id6 = GUICtrlCreateCheckbox ("ID 6", 16, 160, -1, -1, $BS_AUTORADIOBUTTON)
$id7 = GUICtrlCreateCheckbox ("ID 7", 16, 190, -1, -1)
GUICtrlSetState ($id6,$GUI_CHECKED)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

GUISetState()
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $Close, $GUI_EVENT_CLOSE
Exit
Case $Button1
GUISetState(@SW_HIDE)
If _Checked($id1) Then
MsgBox(0,"","ID 1",1)
Endif
If _Checked($id2) Then
MsgBox(0,"","ID 2",1)
Endif
If _Checked($id3) Then
MsgBox(0,"","ID 3",1)
Endif
If _Checked($id4) Then
MsgBox(0,"","ID 4",1)
Endif
If _Checked($id5) Then
MsgBox(0,"","ID 5",1)
Endif
If _Checked($id6) Then
MsgBox(0,"","ID 6",1)
Endif
If _Checked($id7) Then
MsgBox(0,"","ID 7",1)
Endif
GUIDelete()
MsgBox(4096+48, '', 'Завершено', 5)
Exit
EndSwitch
WEnd
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Func _Checked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_Checked

Creat0R
17-04-2016, 00:21
While 1
$iMsg = GUIGetMsg()

Switch $iMsg
Case $Close, $GUI_EVENT_CLOSE
Exit
Case $Button1
...
Case $id7
$iState = $GUI_ENABLE

If GUICtrlRead($id7) = $GUI_CHECKED Then
$iState = $GUI_DISABLE
EndIf

For $iID = $id1 To $id6
GUICtrlSetState($iID, BitOR($GUI_UNCHECKED, $iState))
Next
EndSwitch
WEnd

nibble74
01-05-2016, 18:20
Creat0R,

Тут вот набрал часть скрипта
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <AutoItConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Opt("TrayIconDebug", 1) ;0 - без сведений, 1 - отладочные сведения
Opt("TrayIconHide", 0) ;0 - отображать, 1 - скрыть
Opt("GUICloseOnESC", 1) ;0 = При нажатии ESC не высылать сообщение $GUI_EVENT_CLOSE.
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Global $Title = "TEST"
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUICreate($Title, 265, 355, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MINIMIZEBOX)
$Button2 = GUICtrlCreateButton("DELETE", 70, 260, 120, 22)
$Close = GUICtrlCreateButton("ESC", 70, 300, 120, 22)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$id1 = GUICtrlCreateCheckbox ("ID 1", 18, 50, -1, -1)
$id2 = GUICtrlCreateCheckbox ("ID 2", 18, 70, -1, -1)
$id3 = GUICtrlCreateCheckbox ("ID 3", 18, 90, -1, -1)
$id4 = GUICtrlCreateCheckbox ("ID 4", 18, 110, -1, -1)
$id5 = GUICtrlCreateCheckbox ("ID 5", 18, 130, -1, -1)
$id6 = GUICtrlCreateCheckbox ("ID 6", 18, 150, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUISetState()
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $Close, $GUI_EVENT_CLOSE
Exit
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Case $Button2
GUISetState(@SW_DISABLE)
$Ask = MsgBox(256+32+4+262144, "", "TEST", 0)
If $Ask <> 6 Then
For $iID = $id1 To $id6
GUICtrlSetState($iID, BitOR($GUI_UNCHECKED, $GUI_ENABLE))
Next
GUISetState(@SW_ENABLE)
If Not WinActive($Title) Then WinActivate($Title)
Else

; 1. Тут проверка на присутствие отмеченных чекбоксов и если хотя бы один не отмечен (т.е. все пустые) то появляется диалог
MsgBox(4096+64, "", "UNCHECKED", 1) ;дальнейшее выполнение скрипта прекращается и преходит в режим ожидания.

; 2. Если присутствуют отмеченные чекбоксы (все или хотя бы один, то скрипт продолжает выполнять команды ниже


GUISetState(@SW_HIDE)
If _Checked($id1) Then MsgBox(4096+64, "", "id1", 1)
If _Checked($id2) Then MsgBox(4096+64, "", "id2", 1)
If _Checked($id3) Then MsgBox(4096+64, "", "id3", 1)
If _Checked($id4) Then MsgBox(4096+64, "", "id4", 1)
If _Checked($id5) Then MsgBox(4096+64, "", "id5", 1)
If _Checked($id6) Then MsgBox(4096+64, "", "id6", 1)
MsgBox(4096+64, "", "END", 1)
GUISetState(@SW_SHOW)
GUISetState(@SW_ENABLE)
For $iID = $id1 To $id6
GUICtrlSetState($iID, BitOR($GUI_UNCHECKED, $GUI_ENABLE))
Next
If Not WinActive($Title) Then WinActivate($Title)
EndIf
EndSwitch
WEnd
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Func _Checked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_Checked
в самом скрипте закомментировано что не получается сделать после "Else". Может есть вариант это реализовать ?

Creat0R
02-05-2016, 02:23
Много непоняток в коде, например, зачем там GUISetState(@SW_DISABLE) и проверка активности окна?
И что за AutoItConstants.au3?

Я бы делал так:

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Opt("TrayIconDebug", 1) ;0 - без сведений, 1 - отладочные сведения
Opt("TrayIconHide", 0) ;0 - отображать, 1 - скрыть
Opt("GUICloseOnESC", 1) ;0 = При нажатии ESC не высылать сообщение $GUI_EVENT_CLOSE.
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Global $Title = "TEST"
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$hGUI = GUICreate($Title, 265, 355, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MINIMIZEBOX)
$Button2 = GUICtrlCreateButton("DELETE", 70, 260, 120, 22)
$Close = GUICtrlCreateButton("ESC", 70, 300, 120, 22)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$id1 = GUICtrlCreateCheckbox("ID 1", 18, 50, -1, -1)
$id2 = GUICtrlCreateCheckbox("ID 2", 18, 70, -1, -1)
$id3 = GUICtrlCreateCheckbox("ID 3", 18, 90, -1, -1)
$id4 = GUICtrlCreateCheckbox("ID 4", 18, 110, -1, -1)
$id5 = GUICtrlCreateCheckbox("ID 5", 18, 130, -1, -1)
$id6 = GUICtrlCreateCheckbox("ID 6", 18, 150, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUISetState()
While 1
$iMsg = GUIGetMsg()

Switch $iMsg
Case $Close, $GUI_EVENT_CLOSE
Exit
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Case $Button2
$Ask = MsgBox(256 + 32 + 4 + 262144, "", "TEST", 0, $hGUI)

If $Ask <> 6 Then
For $iID = $id1 To $id6
GUICtrlSetState($iID, BitOR($GUI_UNCHECKED, $GUI_ENABLE))
Next

ContinueLoop
EndIf

GUISetState(@SW_HIDE)
$bChecked = False

For $iID = $id1 To $id6
; хотя бы один отмечен
If _Checked($iID) Then
$bChecked = True

MsgBox(4096 + 64, "", GUICtrlRead($iID, 1), 1, $hGUI)
GUICtrlSetState($iID, BitOR($GUI_UNCHECKED, $GUI_ENABLE))
EndIf
Next

; все пустые
If Not $bChecked Then
MsgBox(4096 + 64, "", "UNCHECKED", 1, $hGUI)
Else
MsgBox(4096 + 64, "", "END", 1, $hGUI)
EndIf

GUISetState(@SW_SHOW)
EndSwitch
WEnd
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Func _Checked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_Checked

nibble74
02-05-2016, 13:43
зачем там GUISetState(@SW_DISABLE) и проверка активности окна? »

Так в моём варианте после появления окна с кнопками Да и Нет родительское окно оставалось активным, что меня не устраивало, а активация из-за того, что это же окно иногда убегало на задний план если открыты какие нибудь окна приложений.

И что за AutoItConstants.au3? »

просто забыл убрать, для чего нужно было уже не помню )

Огромнейшее спасибо за помощь.


P.S. Жаль, что полноценной справки к AutoIt на русском нет.

nibble74
02-05-2016, 18:24
Creat0R,

Что то я не понял как вставить команды, мучаюсь уже пару часов )

Допустим отметили несколько CheckBox (ID2, ID4, ID6) и нужно выполнить RunWait - у каждого CheckBox своя команда RunWait, а также у каждого CheckBox
может быть несколько RunWait с проверкой архитектуры, скажем вот так

If _Checked($id1) Then
If @OSArch = "X86" Then RunWait(@ScriptDir & "\...")
If @OSArch = "X64" Then
RunWait(@ScriptDir & "\...")
RunWait(@ScriptDir & "\...")
EndIf
EndIf

nibble74
03-05-2016, 12:25
Немного пришлось изменить

GUISetState(@SW_HIDE)
$bChecked = False

For $iID = $id1 To $id6
If _Checked($id1) Then
$bChecked = True
MsgBox(4096 + 64, "", "ID1", 1, $hGUI)
GUICtrlSetState($id1, BitOR($GUI_UNCHECKED, $GUI_ENABLE))
EndIf
If _Checked($id2) Then
$bChecked = True
MsgBox(4096 + 64, "", "ID2", 1, $hGUI)
GUICtrlSetState($id2, BitOR($GUI_UNCHECKED, $GUI_ENABLE))
EndIf
; .....

Next

If Not $bChecked Then
MsgBox(4096 + 64, "", "UNCHECKED", 1, $hGUI)
Else
MsgBox(4096 + 64, "", "END", 1, $hGUI)
EndIf

GUISetState(@SW_SHOW)

Creat0R
03-05-2016, 13:02
While 1
$iMsg = GUIGetMsg()

Switch $iMsg
Case $Close, $GUI_EVENT_CLOSE
Exit
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Case $Button2
$Ask = MsgBox(256 + 32 + 4 + 262144, "", "TEST", 0, $hGUI)

If $Ask <> 6 Then
For $iID = $id1 To $id6
GUICtrlSetState($iID, BitOR($GUI_UNCHECKED, $GUI_ENABLE))
Next

ContinueLoop
EndIf

GUISetState(@SW_HIDE)
$bChecked = False

For $iID = $id1 To $id6
; хотя бы один отмечен
If _Checked($iID) Then
$bChecked = True
ExitLoop
EndIf
Next

; все пустые
If Not $bChecked Then
MsgBox(4096 + 64, "", "UNCHECKED", 1, $hGUI)
Else
If _Checked($id1) Then
MsgBox(4096 + 64, "", "id1", 1, $hGUI)
GUICtrlSetState($id1, BitOR($GUI_UNCHECKED, $GUI_ENABLE))

Switch @OSArch
Case "X86"
RunWait(@ScriptDir & "\...")
Case "X64"
RunWait(@ScriptDir & "\...")
RunWait(@ScriptDir & "\...")
EndSwitch
EndIf

;и т.д. (If _Checked($id2) Then)

MsgBox(4096 + 64, "", "END", 1, $hGUI)
EndIf

GUISetState(@SW_SHOW)
EndSwitch
WEnd

nibble74
16-05-2016, 12:48
Creat0R,

Есть ли возможность сделать GUICtrlCreateRadio с прокруткой в окне ?

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$hGUI = GUICreate("Test", 200, 150, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_VSCROLL)
GUIStartGroup()
$id1 = GUICtrlCreateRadio ("1", 15, 20, -1, -1)
$id2 = GUICtrlCreateRadio ("2", 15, 40, -1, -1)
$id3 = GUICtrlCreateRadio ("3", 15, 60, -1, -1)
$id4 = GUICtrlCreateRadio ("4", 15, 80, -1, -1)
GUIStartGroup()
$id5 = GUICtrlCreateRadio ("5", 15, 100, -1, -1)
$id6 = GUICtrlCreateRadio ("6", 15, 120, -1, -1)
$id7 = GUICtrlCreateRadio ("7", 15, 140, -1, -1)
$id8 = GUICtrlCreateRadio ("8", 15, 160, -1, -1)
GUIStartGroup()
$id9 = GUICtrlCreateRadio ("9", 15, 180, -1, -1)
$id10 = GUICtrlCreateRadio ("10", 15, 200, -1, -1)
$id11 = GUICtrlCreateRadio ("11", 15, 220, -1, -1)
$id12 = GUICtrlCreateRadio ("12", 15, 240, -1, -1)
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GUISetState()
While 1
$iMsg = GUIGetMsg()

Switch $iMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

Creat0R
18-05-2016, 12:03
Есть ли возможность сделать GUICtrlCreateRadio с прокруткой в окне ? »
Да, но это уже другая тема.

nibble74
18-05-2016, 20:06
Да, но это уже другая тема. »

Фильтр не дал результат такой темы, только нашёл для GUICtrlCreateLabel, но это не совсем то, что надо.

Создать новую тему ?

Creat0R
19-05-2016, 03:08
Создать новую тему ? »
Да, а эту пометить решённой.




© OSzone.net 2001-2012