#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <GuiListBox.au3>
Local $hGUI1 = GUICreate("Gui 1",500,500)
Local $idedit = GUICtrlCreateEdit("", 0, 0,500,300, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL))
Local $idMenu1 = GUICtrlCreateMenu("Работа с формами")
Local $idCreateForm = GUICtrlCreateMenuItem("Создать форму", $idMenu1)
Local $idEndForm = GUICtrlCreateMenuItem("Закрыть форму", $idMenu1)
Local $idCheckBox = GUICtrlCreateMenuItem("Создать флажок", $idMenu1)
Local $idRadio = GUICtrlCreateMenuItem("Создать переключатель", $idMenu1)
Local $idText = GUICtrlCreateMenuItem("Создать текстовое поле", $idMenu1)
Local $idMultiText = GUICtrlCreateMenuItem("Создать многострочное текстовое поле", $idMenu1)
Local $idButton = GUICtrlCreateMenuItem("Создать кнопку", $idMenu1)
Local $idColor = GUICtrlCreateMenuItem("Создать палитру цвета", $idMenu1)
Local $idSelect= GUICtrlCreateMenuItem("Создать список", $idMenu1)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idCreateForm
gui2()
Case $idEndForm
Local $htmlcode = GUICtrlRead($idedit)
$htmlcode &= @CRLF & "</form>"
GUICtrlSetData($idedit,$htmlcode)
Case $idCheckBox
gui3()
Case $idRadio
gui4()
Case $idText
gui5()
Case $idMultiText
gui6()
Case $idButton
gui7()
Case $idColor
gui8()
Case $idSelect
gui9()
EndSwitch
WEnd
Func gui2()
Local $hGUI2 = GUICreate("Свойства формы", 350, 350)
GUICtrlCreateLabel("Имя формы",0,0)
Local $idInput_1 = GUICtrlCreateInput("",0,25,200)
GUICtrlCreateLabel("Имя обработчика",0,50)
Local $idInput_2 = GUICtrlCreateInput("",0,75,200)
GUICtrlCreateLabel("Идентификатор",0,100)
Local $idInput_3 = GUICtrlCreateInput("",0,125,200)
GUICtrlCreateLabel("Метод",0,150)
Local $idComboBox_1 = GUICtrlCreateCombo("",0,175,200)
GUICtrlSetData($idComboBox_1, "get|post")
GUICtrlCreateLabel("Способ кодирования",0,200)
Local $idComboBox_2 = GUICtrlCreateCombo("",0,225,200)
GUICtrlSetData($idComboBox_2, "text/plain|multipart/form-data|application/x-www-form-urlencoded")
Local $idComplete = GUICtrlCreateButton("Создать форму",0,275,200)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
GUIDelete($hGUI2)
ExitLoop
Case $idComplete
Local $nameform = GUICtrlRead($idInput_1)
Local $scriptname = GUICtrlRead($idInput_2)
Local $idform = GUICtrlRead($idInput_3)
Local $methodform = GUICtrlRead($idComboBox_1)
Local $enctypeform = GUICtrlRead($idComboBox_2)
Local $q = """"
Local $htmlcode = GUICtrlRead($idedit)
$htmlcode &= " <form " & _
" action= " & $q & $scriptname & $q & _
" enctype= " & $q & $enctypeform & $q & _
" id= " & $q & $idform & $q & _
" method= " & $q & $methodform & $q & _
" name= " & $q & $nameform & $q &" > "
GUICtrlSetData($idedit,$htmlcode)
GUIDelete($hGUI2)
ExitLoop
EndSwitch
WEnd
EndFunc
Func gui3()
Local $hGUI3 = GUICreate("Свойства флажка", 350, 350)
GUICtrlCreateLabel("Имя флажка",0,0)
Local $idInput_1 = GUICtrlCreateInput("",0,25,200)
GUICtrlCreateLabel("Значение",0,50)
Local $idInput_2 = GUICtrlCreateInput("",0,75,200)
GUICtrlCreateLabel("Пометка флажка",0,100)
Local $idComboBox_1 = GUICtrlCreateCombo("",0,125,200)
GUICtrlSetData($idComboBox_1, "checked")
Local $idComplete = GUICtrlCreateButton("Добавить флажок",0,150,200)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
GUIDelete($hGUI3)
ExitLoop
Case $idComplete
Local $namecheckbox = GUICtrlRead($idInput_1)
Local $valuecheckbox = GUICtrlRead($idInput_2)
Local $checked = GUICtrlRead($idComboBox_1)
Local $q =""""
Local $htmlcode=GUICtrlRead($idedit)
$htmlcode &=@CRLF&"<input "&"type="&$q&"checkbox"&$q& _
" name= " & $q & $namecheckbox & $q & _
" value= " & $q & $valuecheckbox & $q & _
" checked= " & $q & $checked & $q & " >"
GUICtrlSetData($idedit,$htmlcode)
GUIDelete($hGUI3)
ExitLoop
EndSwitch
WEnd
EndFunc
Func gui4()
Local $hGUI4 = GUICreate("Свойства переключателя", 350, 350)
GUICtrlCreateLabel("Имя",0,0)
Local $idInput_1 = GUICtrlCreateInput("",0,25,200)
GUICtrlCreateLabel("Значение",0,50)
Local $idInput_2 = GUICtrlCreateInput("",0,75,200)
GUICtrlCreateLabel("Пометка переключателя",0,100)
Local $idComboBox_1 = GUICtrlCreateCombo("",0,125,200)
GUICtrlSetData($idComboBox_1, "checked")
Local $idComplete = GUICtrlCreateButton("Добавить переключатель",0,150,200)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
GUIDelete($hGUI4)
ExitLoop
Case $idComplete
Local $nameradio = GUICtrlRead($idInput_1)
Local $valueradio = GUICtrlRead($idInput_2)
Local $checked = GUICtrlRead($idComboBox_1)
Local $q = """"
Local $htmlcode=GUICtrlRead($idedit)
$htmlcode&=@CRLF&"<input "&"type="&$q&"radio"&$q& _
" name= " & $q & $nameradio & $q & _
" value= " & $q & $valueradio & $q & _
" checked= " & $q & $checked & $q & " >"
GUICtrlSetData($idedit,$htmlcode)
GUIDelete($hGUI4)
ExitLoop
EndSwitch
WEnd
EndFunc
Func gui5()
Local $hGUI5=GUICreate("Свойства текствого поля", 350, 350)
GUICtrlCreateLabel("Имя",0,0)
Local $idInput_1=GUICtrlCreateInput("",0,25,200)
GUICtrlCreateLabel("Значение",0,50)
Local $idInput_2 = GUICtrlCreateInput("",0,75,200)
GUICtrlCreateLabel("Ширина поля",0,100)
Local $idInput_3 = GUICtrlCreateInput("",0,125,200)
GUICtrlCreateLabel("Максимальное число символов",0,150)
Local $idInput_4 = GUICtrlCreateInput("",0,175,200)
GUICtrlCreateLabel("Тип содержимого",0,200)
Local $idComboBox_1 = GUICtrlCreateCombo("",0,225,200)
GUICtrlSetData($idComboBox_1, "text|password")
Local $idComplete = GUICtrlCreateButton("Добавить текстовое поле",0,275,225)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
GUIDelete($hGUI5)
ExitLoop
Case $idComplete
Local $nametext = GUICtrlRead($idInput_1)
Local $valuetext = GUICtrlRead($idInput_2)
Local $sizetext = GUICtrlRead($idInput_3)
Local $maxlengthtext = GUICtrlRead($idInput_4)
Local $typetext = GUICtrlRead($idComboBox_1)
Local $q = """"
Local $htmlcode = GUICtrlRead($idedit)
$htmlcode &= @CRLF & "<input " & "type=" &$q & $typetext & $q & _
" name= " & $q & $nametext & $q & _
" value= " & $q & $valuetext & $q & _
" size= " & $q & $sizetext & $q & _
" maxlength= " & $q & $maxlengthtext & $q & " >"
GUICtrlSetData($idedit,$htmlcode)
GUIDelete($hGUI5)
ExitLoop
EndSwitch
WEnd
EndFunc
Func gui6()
Local $hGUI6 = GUICreate("Свойства мультитекствого поля", 350, 350)
GUICtrlCreateLabel("Имя",0,0)
Local $idInput_1 = GUICtrlCreateInput("",0,25,200)
GUICtrlCreateLabel("Количество колонок",0,50)
Local $idInput_2 = GUICtrlCreateInput("",0,75,200)
GUICtrlCreateLabel("Количество строк",0,100)
Local $idInput_3 = GUICtrlCreateInput("",0,125,200)
GUICtrlCreateLabel("Значение",0,150)
Local $idInput_4 = GUICtrlCreateInput("",0,175,200)
Local $idComplete = GUICtrlCreateButton("Добавить мультитекстовое поле",0,275,225)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
GUIDelete($hGUI6)
ExitLoop
Case $idComplete
Local $nametext = GUICtrlRead($idInput_1)
Local $colstext = GUICtrlRead($idInput_2)
Local $rowstext = GUICtrlRead($idInput_3)
Local $valuetext = GUICtrlRead($idInput_4)
Local $q = """"
Local $htmlcode = GUICtrlRead($idedit)
$htmlcode &= @CRLF & "<textarea" & _
" name= " & $q & $nametext & $q & _
" cols= " & $q & $colstext & $q & _
" rows= " & $q & $rowstext & $q & " >" & _
$valuetext & "</textarea>"
GUICtrlSetData($idedit,$htmlcode)
GUIDelete($hGUI6)
ExitLoop
EndSwitch
WEnd
EndFunc
Func gui7()
Local $hGUI7 = GUICreate("Свойства кнопки", 350, 350)
GUICtrlCreateLabel("Имя кнопки",0,0)
Local $idInput_1 = GUICtrlCreateInput("",0,25,200)
GUICtrlCreateLabel("Идентификатор",0,50)
Local $idInput_2 = GUICtrlCreateInput("",0,75,200)
GUICtrlCreateLabel("Значение",0,100)
Local $idInput_3 = GUICtrlCreateInput("",0,125,200)
GUICtrlCreateLabel("Тип",0,150)
Local $idComboBox_1 = GUICtrlCreateCombo("",0,175,200)
GUICtrlSetData($idComboBox_1, "buttton|submit|reset")
Local $idComplete = GUICtrlCreateButton("Добавить кнопку",0,275,200)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
GUIDelete($hGUI7)
ExitLoop
Case $idComplete
Local $namebutton = GUICtrlRead($idInput_1)
Local $idbutton= GUICtrlRead($idInput_2)
Local $valuebutton = GUICtrlRead($idInput_3)
Local $typebutton = GUICtrlRead($idComboBox_1)
Local $q = """"
Local $htmlcode = GUICtrlRead($idedit)
$htmlcode &=@CRLF & " <input " & "type=" & $q & $typebutton & $q & _
" name= " & $q & $namebutton & $q & _
" id= " & $q & $idbutton & $q & _
" value= " & $q & $valuebutton & $q & " > "
GUICtrlSetData($idedit,$htmlcode)
GUIDelete($hGUI7)
ExitLoop
EndSwitch
WEnd
EndFunc
Func gui8()
Local $hGUI8 = GUICreate("Свойства палитры цвета", 350, 350)
GUICtrlCreateLabel("Имя палитры",0,0)
Local $idInput_1 = GUICtrlCreateInput("",0,25,200)
GUICtrlCreateLabel("Идентификатор",0,50)
Local $idInput_2 = GUICtrlCreateInput("",0,75,200)
GUICtrlCreateLabel("Значение",0,100)
Local $idInput_3 = GUICtrlCreateInput("",0,125,200)
Local $idComplete = GUICtrlCreateButton("Добавить палитру",0,275,200)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
GUIDelete($hGUI8)
ExitLoop
Case $idComplete
Local $namecolor = GUICtrlRead($idInput_1)
Local $idcolor= GUICtrlRead($idInput_2)
Local $valuecolor = GUICtrlRead($idInput_3)
Local $q = """"
Local $htmlcode = GUICtrlRead($idedit)
$htmlcode &=@CRLF & " <input " & "type=" & $q & "color" & $q & _
" name= " & $q & $namecolor & $q & _
" id= " & $q & $idcolor & $q & _
" value= " & $q & $valuecolor & $q & " > "
GUICtrlSetData($idedit,$htmlcode)
GUIDelete($hGUI8)
ExitLoop
EndSwitch
WEnd
EndFunc
Func gui9()
Local $hGUI9 = GUICreate("Свойства списка", 350, 350)
GUICtrlCreateLabel("Имя списка",0,0)
Local $idInput_1 = GUICtrlCreateInput("",0,25,200)
GUICtrlCreateLabel("Идентификатор",0,50)
Local $idInput_2 = GUICtrlCreateInput("",0,75,200)
GUICtrlCreateLabel("Размер",0,100)
Local $idInput_3 = GUICtrlCreateInput("",0,125,200)
Local $idMylist = GUICtrlCreateList("",0,175,200,50)
Local $idInputlist = GUICtrlCreateInput("",210,175,125,25)
Local $idButton_Add = GUICtrlCreateButton("Добавить",210,200,125,20)
Local $idComplete = GUICtrlCreateButton("Добавить список",0,275,200)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
GUIDelete($hGUI9)
ExitLoop
Case $idButton_Add
GUICtrlSetData($idMylist,GUICtrlRead($idInputlist))
Case $idComplete
Local $nameselect = GUICtrlRead($idInput_1)
Local $idselect= GUICtrlRead($idInput_2)
Local $sizeselect = GUICtrlRead($idInput_3)
Local $optionstext
Local $q = """"
Local $count = _GUICtrlListBox_GetCount($idMylist)
for $index = 0 to $count - 1
$elem = _GUICtrlListBox_GetText($idMylist,$index)
$optionstext &= @CRLF & "<option value= " & $q & $elem & $q & " > " & $elem & "</option>"
next
msgbox(0,"title",$optionstext)
Local $htmlcode = GUICtrlRead($idedit)
$htmlcode &= @CRLF & "<select " & _
" name= " & $q & $nameselect & $q & _
" id= " & $q & $idselect & $q & _
" size= " & $q & $sizeselect & $q & " > " & _
$optionstext & @CRLF & "</select>"
GUICtrlSetData($idedit,$htmlcode)
GUIDelete($hGUI9)
ExitLoop
EndSwitch
WEnd
EndFunc
|