Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


Функция _GUICtrlCreateGroupEx() - Создание «Group» элемента в стиле Web-формы

Код: Выделить весь код
#include <GuiConstants.au3>

$hGUI = GUICreate("_GUICtrlCreateGroupEx() Demo")

$aGroup_Ctrls1 = _GUICtrlCreateGroupEx("", 25, 40, 350, 150, 3.5, 0xFF0000, 0) ;1 to able set color for the Group frame

GUICtrlCreateRadio("Radio 1 (Group 1)", 60, 70)
GUICtrlCreateRadio("Radio 2 (Group 1)", 230, 70)
GUICtrlCreateRadio("Radio 3 (Group 1)", 60, 140)
GUICtrlCreateRadio("Radio 4 (Group 1)", 230, 140)

$iRandom_Radio = Random($aGroup_Ctrls1[1]+1, $aGroup_Ctrls1[1]+4, 1)
GUICtrlSetState($iRandom_Radio, $GUI_CHECKED)

$aGroup_Ctrls2 = _GUICtrlCreateGroupEx("Group 2", 25, 220, 350, 150, 3.5, 0x0000FF, 0)

GUICtrlCreateRadio("Radio 1 (Group 2)", 60, 250)
GUICtrlCreateRadio("Radio 2 (Group 2)", 230, 250)
GUICtrlCreateRadio("Radio 3 (Group 2)", 60, 320)
GUICtrlCreateRadio("Radio 4 (Group 2)", 230, 320)

$iRandom_Radio = Random($aGroup_Ctrls2[1]+1, $aGroup_Ctrls2[1]+4, 1)
GUICtrlSetState($iRandom_Radio, $GUI_CHECKED)

GUISetState(@SW_SHOW, $hGUI)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _GUICtrlCreateGroupEx($sText, $iLeft, $iTop, $iWidth, $iHeight, $iLineWidth=3, $nColor=0, $iStyle=0)
    Local $aIDs[2] ;First + Last IDs

    Local $nLabel_Style = $SS_ETCHEDFRAME
    If $iStyle > 0 Then $nLabel_Style = $SS_SUNKEN

    GUIStartGroup()

    $aIDs[0] = GUICtrlCreateLabel("", $iLeft+1, $iTop, $iWidth-2, $iLineWidth, $nLabel_Style)
    GUICtrlSetBkColor(-1, $nColor)

    GUICtrlCreateLabel("", $iLeft+2, $iTop+5, $iLineWidth, $iHeight-4, $nLabel_Style)
    GUICtrlSetBkColor(-1, $nColor)

    GUICtrlCreateLabel("", ($iLeft+$iWidth), $iTop-3, $iLineWidth, $iHeight-3, $nLabel_Style)
    GUICtrlSetBkColor(-1, $nColor)

    $aIDs[1] = GUICtrlCreateLabel("", $iLeft+6, ($iTop+$iHeight)-5, $iWidth, $iLineWidth, $nLabel_Style)
    GUICtrlSetBkColor(-1, $nColor)

    If $sText <> "" Then
        $aIDs[1] = GUICtrlCreateLabel("  " & $sText, $iLeft+20, $iTop-6)
        GUICtrlSetColor(-1, $nColor)
    EndIf

    Return $aIDs
EndFunc
+ Опция установки цвета для рамки.

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community


Отправлено: 09:24, 26-03-2008 | #329