youtuber Posted October 29, 2018 Share Posted October 29, 2018 Adding to the edit box box is adding more and doing the wrong to the beginning and end expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <ComboConstants.au3> #include <EditConstants.au3> Global $ListElements[7] = ["ID-1-Apple", _ "ID-2-Appricot", _ "ID-3-Banana", _ "ID-4-Cherry", _ "ID-5-Grape", _ "ID-6-Orange", _ "ID-7-Tangerine"] $Form1 = GUICreate("Form1", 934, 248) $ListView1 = GUICtrlCreateListView("All|split", 8, 48, 355, 150) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 250) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) $Button1 = GUICtrlCreateButton("Ok", 368, 208, 147, 33) $Edit1 = GUICtrlCreateEdit("", 368, 48, 553, 153) GUICtrlSetData(-1, "") $RadioBottom = GUICtrlCreateRadio("Sort bottom", 371, 13, 81, 17) GUICtrlSetState($RadioBottom, $GUI_CHECKED) $RadioSideBySide = GUICtrlCreateRadio("Sort Side By Side", 470, 13, 95, 17) $ComboPer = GUICtrlCreateCombo("-", 654, 13, 81, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($ComboPer, "+|_|/|\|*|(|)| |#|&|") $ComboEnd = GUICtrlCreateCombo("-", 838, 13, 81, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($ComboEnd, "+|_|/|\|*|(|)| |#|&|") $CheckboxAddPer = GUICtrlCreateCheckbox("Add Per", 584, 16, 65, 17) $CheckboxAddEnd = GUICtrlCreateCheckbox("Add End", 761, 17, 73, 17) For $i = 0 To UBound($ListElements) - 1 $aFruits = StringRegExp($ListElements[$i], "-(\w+)\W*$", 3) If IsArray($aFruits) Then GUICtrlCreateListViewItem($ListElements[$i] & "|" & $aFruits[0], $ListView1) EndIf Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Edit1, "") $aReadComboPer = GUICtrlRead($ComboPer) $aReadComboEnd = GUICtrlRead($ComboEnd) For $x = 0 To _GUICtrlListView_GetItemCount($ListView1) - 1 $alist = _GUICtrlListView_GetItemText($ListView1, $x, 1) If GUICtrlRead($RadioBottom) = 1 Then GUICtrlSetData($Edit1, $alist & @CRLF, 1) ElseIf GUICtrlRead($RadioBottom) And GUICtrlRead($CheckboxAddPer) = 1 Then GUICtrlSetData($Edit1, $aReadComboPer & $alist & @CRLF, 1) ElseIf GUICtrlRead($RadioBottom) And GUICtrlRead($CheckboxAddEnd) = 1 Then GUICtrlSetData($Edit1, $alist & $aReadComboEnd & @CRLF, 1) ElseIf GUICtrlRead($RadioBottom) And GUICtrlRead($CheckboxAddEnd) And GUICtrlRead($CheckboxAddPer) = 1 Then GUICtrlSetData($Edit1, $aReadComboPer & $alist & $aReadComboEnd & @CRLF, 1) EndIf If GUICtrlRead($RadioSideBySide) = 1 Then GUICtrlSetData($Edit1, $alist, 1) ElseIf GUICtrlRead($RadioSideBySide) And GUICtrlRead($CheckboxAddPer) = 1 Then GUICtrlSetData($Edit1, $aReadComboPer & $alist, 1) ElseIf GUICtrlRead($RadioSideBySide) And GUICtrlRead($CheckboxAddEnd) = 1 Then GUICtrlSetData($Edit1, $alist & $aReadComboEnd, 1) ElseIf GUICtrlRead($RadioSideBySide) And GUICtrlRead($CheckboxAddEnd) And GUICtrlRead($CheckboxAddPer) = 1 Then GUICtrlSetData($Edit1, $aReadComboPer & $alist & $aReadComboEnd, 1) EndIf Next EndSwitch WEnd Link to comment Share on other sites More sharing options...
TheXman Posted October 29, 2018 Share Posted October 29, 2018 If I understand correctly, maybe something like this? expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <ComboConstants.au3> #include <EditConstants.au3> Global $ListElements[7] = ["ID-1-Apple", _ "ID-2-Appricot", _ "ID-3-Banana", _ "ID-4-Cherry", _ "ID-5-Grape", _ "ID-6-Orange", _ "ID-7-Tangerine"] $Form1 = GUICreate("Form1", 934, 248) $ListView1 = GUICtrlCreateListView("All|split", 8, 48, 355, 150) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 250) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) $Button1 = GUICtrlCreateButton("Ok", 368, 208, 147, 33) $Edit1 = GUICtrlCreateEdit("", 368, 48, 553, 153) GUICtrlSetData(-1, "") $RadioBottom = GUICtrlCreateRadio("Sort bottom", 371, 13, 81, 17) GUICtrlSetState($RadioBottom, $GUI_CHECKED) $RadioSideBySide = GUICtrlCreateRadio("Sort Side By Side", 470, 13, 95, 17) $ComboPer = GUICtrlCreateCombo("-", 654, 13, 81, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($ComboPer, "+|_|/|\|*|(|)| |#|&|") $ComboEnd = GUICtrlCreateCombo("-", 838, 13, 81, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($ComboEnd, "+|_|/|\|*|(|)| |#|&|") $CheckboxAddPer = GUICtrlCreateCheckbox("Add Per", 584, 16, 65, 17) $CheckboxAddEnd = GUICtrlCreateCheckbox("Add End", 761, 17, 73, 17) For $i = 0 To UBound($ListElements) - 1 $aFruits = StringRegExp($ListElements[$i], "-(\w+)\W*$", 3) If IsArray($aFruits) Then GUICtrlCreateListViewItem($ListElements[$i] & "|" & $aFruits[0], $ListView1) EndIf Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Edit1, "") For $x = 0 To _GUICtrlListView_GetItemCount($ListView1) - 1 ;build record $sRec = "" If GUICtrlRead($CheckboxAddPer) = $GUI_CHECKED Then $sRec &= GUICtrlRead($ComboPer) $sRec &= _GUICtrlListView_GetItemText($ListView1, $x, 1) If GUICtrlRead($CheckboxAddEnd) = $GUI_CHECKED Then $sRec &= GUICtrlRead($ComboEnd) ;write record If GUICtrlRead($RadioBottom) = $GUI_CHECKED Then GUICtrlSetData($Edit1, $sRec & @CRLF, 1) Else GUICtrlSetData($Edit1, $sRec, 1) EndIf Next EndSwitch WEnd youtuber 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
youtuber Posted October 29, 2018 Author Share Posted October 29, 2018 @TheXman Thank you yes that's what I wanted leaving a variable blank And then you fill it up, it's good that I learned it. very nice example TheXman 1 Link to comment Share on other sites More sharing options...
TheXman Posted October 29, 2018 Share Posted October 29, 2018 Glad to have helped. youtuber 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now