Jump to content

Search the Community

Showing results for tags 'guictrlcreateedit'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • Forum
  • AutoIt


  • Community Calendar

Found 12 results

  1. I am working on a Video Player Test Script. I am reading a text file into a 3d array to be displayed in a GUI. Array Content: [x][0]FileName.mp4 [x][1]UsageCount -> Up to a 4 digit number [x][2]EnableUsageCount (True/False) In the GUI the user can check the filename box, edit the number of usages and check EnableUsageCount to turn on the UsageCount control using the UsageCount number for the maximum number of plays. To make this easier to deal with I have removed the EnableUsageCount section, and am just concentrating on getting a method to put the edited (or unchanged) UsageCount in the array. Currently nothing is read into the array, due to my using the wrong method in the Case statement. Here are code snippets of what I am trying to do: ; Snippets from script ; I read the text file at the bottom and put the .mp4 filenames in $aManifest[x][0] and UsageCount in $aManifest[x][1] ; Then I create a GUI to display the .mp4 filenames with checkboxes and the UsageCount to the right. UsageCount is editable by the user. ; If the filename is checked, I want to read the filename into $aCheckedVideos[x][0] and the updated UsageCount in $aCheckedVideos[x][1] ; The GUICtrlRead($aVideoName[$i]) with Case $GUI_CHECKED & UNCHECKED works for the checkboxes ; This section puts the filenames in the GUI with a checkbox For $i = 0 to $iMMCount Step 1 $sMP4Text = $aManifest[$i][0] $iMP4Length = StringLen($sMP4Text) $aVideoName[$i] = GUICtrlCreateCheckbox($sMP4Text,$iLeft, $iTop) $iTop += 30 Next ; This section reads numbers from the Manifest array, and I want to be able to change the number and have them saved. ; So the Case $GUI_CHECKED & UNCHECKED won't work here, and I can't figure out what I should be doing here. For $i = 0 to $iMMCount Step 1 $sUsageText = $aManifest[$i][1] $aUsageCount[$i] = GUICtrlCreateInput($sUsageText,$iLeft, $iTop, 50,18, $GUI_DOCKAUTO) GUICtrlSetPos($aUsageCount[$i],200) $iTop += 30 Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idCloseGUI For $i = 0 To $iMMNewCount Step 1 Switch GUICtrlRead($aVideoName[$i]) Case $GUI_CHECKED $aCheckedVideos[$i][0] = $aManifest[$i][0] ; If checked, I put the results into a two D array Case $GUI_UNCHECKED ; where Video Name is $aCheckedVideos[x][0] EndSwitch Switch GUICtrlRead($aUsageCounter[$i]) Case $GUI_CHECKED $aCheckedVideos[$i][1] = $aUsageCount[$i] ;I want to put the text (numbers) in $aCheckedVideos[x][1] Case $GUI_UNCHECKED ;but what is returned is blank, probably due to EndSwitch ; $GUI_CHECKED being the wrong thing. Next ExitLoop EndSwitch WEnd ;The txt file I'm reading has the following: ;~ /** Title #1: Big Buck Bunny 1080p **/ ;~ "Name": "Big Buck Bunny", ;~ "URI": "..\\MediaFiles\\bbb_1080_60s.mp4", ;~ "UsageCount": 9999, ;~ "URI": "..\\MediaFiles\\bbb_1080_60s_enc1.mp4", ;~ "UsageCount": 45, ;~ "URI": "..\\MediaFiles\\bbb_1080_60s_enc1.mp4", ;~ "UsageCount": 2, ;~ /** Title #2: Tears of Steel 4K **/ ;~ "Name": "Tears of Steel 4K", ;~ "URI": "..\\MediaFiles\\tos_4K_60s_HEVC.mp4", ;~ "UsageCount": 9876, ;~ "URI": "..\\MediaFiles\\tos_4K_60s_HEVC_enc2.mp4", ;~ "UsageCount": 0, ;~ "URI": "..\\MediaFiles\\tos_4K_60s_HEVC_enc2.mp4", ;~ "UsageCount": 5, I am certain that the section Switch GUICtrlRead($aUsageCounter[$i]) Case $GUI_CHECKED $aCheckedVideos[$i][1] = $aUsageCount[$i] ;I want to put the text (numbers) in $aCheckedVideos[x][1] Case $GUI_UNCHECKED ;but what is returned is blank, probably due to EndSwitch ; $GUI_CHECKED being the wrong thing. is wrong, and this is what I am looking for help with. Instead of $GUI_CHECKED what should I be looking for? The worst part of this is I had this working late last night, and then lost my changes and cannot for the life of me remember how I had this working. Help is truly appreciated! Jibberish
  2. I hope someone explain me how to do that... well, if you run the command netstat -a inside cmd prompt he look nice( indented ) but if you try to show the output inside the GUICtrlCreateEdit he look without indentation... how can I fix it? Thx $Pid = Run(@ComSpec & " /c " & "netstat -a",@ScriptDir,@SW_HIDE,$STDERR_CHILD + $STDOUT_CHILD) Dim $_StderrRead='', $_StdoutRead='', $_StdReadAll='' While ProcessExists ( $Pid ) $_StderrRead = StderrRead ( $Pid ) If Not @error And $_StderrRead <> '' Then GUICtrlSetData($Edit1, "Error: " & $_StderrRead & @Crlf ,1) EndIf $_StdoutRead = StdoutRead ( $Pid ) If Not @error And $_StdoutRead <> '' Then GUICtrlSetData($Edit1, "Log: " & $_StdoutRead & @Crlf ,1) EndIf Wend
  3. How can I write a good output inside Edit control? 4 example on notepad (windows) he looks terrible... but he looks perfect on notepad++ and cmd. THX GUICtrlSetData($Edit1, "Log: " & $_StdoutRead & @Crlf ,1) the log.. <snip>
  4. Hello. Could you help me find the answer for my issue. I'm trying to set fomatted data wich is selected from SQL to GUICtrlCreateEdit field. And the GUICtrlSetData function is inserting it in one line. But when I'm trying to do the same using MsgBox the data looks fine. I'm trying to not use _GUICtrlRichEdit UDF. Thanks in advance. Here is my test code. #include <GUIConstants.au3> #include <GUIListBox.au3> #include <SQLite.au3> #include <SQLite.dll.au3> Opt("GUIOnEventMode", 1) $hMainGUI = GUICreate("Test", 520, 240) $hListBox = _GUICtrlListBox_Create($hMainGUI, "", 10, 10, 180, 80) $hEdit = GUICtrlCreateEdit("", 10, 80, 500, 150) GUISetState(@SW_SHOW, $hMainGUI) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") Local $hQuery, $aRow _SQLite_Startup() $hDB = _SQLite_Open('MyDB.sqlite') _SQLite_Query(-1, "SELECT ID ||"". "" || Name FROM Templates ORDER BY ID;", $hQuery) While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK _GUICtrlListBox_AddString($hListBox, $aRow[0]) WEnd GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSE_Button") While 1 Sleep(100) WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox If Not IsHWnd($hListBox) Then $hWndListBox = GUICtrlGetHandle($hListBox) $hWndFrom = $lParam $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word $iCode = BitShift($wParam, 16) ; Hi Word Switch $hWndFrom Case $hListBox, $hWndListBox Switch $iCode Case $LBN_DBLCLK Select_Template(_GUICtrlListBox_GetCurSel($hListBox) + 1) Return 0 EndSwitch EndSwitch EndFunc ;==>_WM_COMMAND Func CLOSE_Button() _SQLite_Close() _SQLite_Shutdown() Exit EndFunc ;==>CLOSE_Button Func Select_Template($sListItem) _SQLite_QuerySingleRow($hDB, _ "SELECT Content " & _ "FROM Templates " & _ "WHERE ID = " & $sListItem & ";", $aRow) ;~ MsgBox(64, "Test: " & $sListItem, $aRow[0]) GUICtrlSetData($hEdit, $aRow[0]) WinSetTitle($hMainGUI, "", "Test: " & $sListItem) EndFunc ;==>Select_Template
  5. Hi, I'm trying to create a console reader. All is working but I have a problem with the look. I want the line numbers with another backgroundcolor in silver. I made this with a small silver label. The edit control over the label has a transparent background. But if I start the prog then i can see how the line numbers wipe the silver background off. And if I click into the Edit then the silver label disappears completely. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ColorConstants.au3> #include <StaticConstants.au3> #include <GuiEdit.au3> Opt("GUIOnEventMode", 1) Global $g_iZaehler = 0 Global $g_hGUI = GUICreate("Console: StdoutRead" , 800, 800, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPCHILDREN, $WS_EX_ACCEPTFILES) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") Global $text = GUICtrlCreateEdit("",10,30,780,760, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY + $ES_NOHIDESEL) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSetFont(-1, 9, -1, -1, "Lucida Console") GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) Global $g_LaZeilen = GUICtrlCreateLabel("Zeilen: " & StringFormat("% 5d", $g_iZaehler), 680, 10, 100, 9, $SS_LEFTNOWORDWRAP) GUICtrlSetFont(-1, 9, -1, -1, "Lucida Console") GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKSIZE) Global $g_hCbFreeze = GUICtrlCreateCheckbox("&Freeze", 13, 5, 90) GUICtrlSetFont(-1, 9, -1, -1, "Lucida Console") GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlCreateLabel("", 11, 31, 42, 758) ; soll die Ziffern andersfarbig hinterlegen GUICtrlSetBkColor(-1, $COLOR_SILVER) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKBOTTOM + $GUI_DOCKWIDTH) GUISetState(@SW_SHOW) Global $sText = StringFormat("% 5d", $g_iZaehler) & @CRLF _GUICtrlEdit_AppendText($text, $sText) While 1 Sleep(200) $g_iZaehler += 1 $sText = StringFormat("% 5d", $g_iZaehler) & @CRLF _GUICtrlEdit_AppendText($text, $sText) WEnd Func _Exit() Exit EndFunc Do you have any suggestions. Regards, Conrad
  6. Hi guys, I would like to implement the words in GuiCtrlCreateEdit through the choices the GuiCtrlCreateCombo. Each item in the GuiCtrlCreateCombo must contain the words that are to be reported later in the GuiCtrlCreateEdit. I have attached an example , I added just a GuiCtrlCreateCombo , then it will insert more. Thanks for the attention
  7. Hello! When utilizing GUICtrlSetData to edit what is displayed in a GUICtrlCreateEdit field, is there a way to just make it write new lines rather than clearing what's there and writing the new information? For example ... GUICtrlSetData ($editField, "Line one"&@CRLF , "") GUICtrlSetData ($editField, "Line two"&@CRLF , "") GUICtrlSetData ($editField, "Line three"&@CRLF , "") What happens now if those three things run one after another, the Edit field displays "Line One" , then that is replaced with "Line Two" and so on with the previous information disappearing and the subsequent taking its place. I'd like for it to say all three, one after another. Any documents on how I may accomplish this? Thanks! -Reiz
  8. Hello, Hereby I'd like to ask for the devs proffesional help cause there is something I can not get to work. I have an Combobox containing 3 strings. When I choose one, I'd wish for the 'readonly'editbox to hold some data from each string, a different data. string 1-> GUICtrlEdit /Edit1 : data ; blabla string 2-> GUICtrlEdit /Edit1 : data ; random typin string 3-> GUICtrlEdit /Edit1 : data ; other info Just to give an example I have a hunge it has something to do with Case $Combo1, GuiCtrlSetData and a read command. I shall provide a KodaForm generated code script.au3 below but I'm kinda lost in how to get it done. If only I had the beginning from one of the strings I'd make the ones for the other strings myself. Kind regards Theo Van Der Wal, Frieschepalen, Holland theolonghair.au3
  9. I want to open and display a text file in a Window. The following test script does it for me, but when the window appears the text is highlighted (the text is selected). I must click on the text to deselect it. What is causing it to be pre-selected and how can I fix this? Thank you. #include <Constants.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> $sBody = FileRead(@ScriptDir & "\mailbody.txt") Local $hGUI = GUICreate("Test GUI", 600,300) GUICtrlCreateEdit($sBody, 5, 5, 590, 295, $WS_VSCROLL + $ES_READONLY) GUISetState(@SW_SHOW) Local $iMsg = 0 While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ;MsgBox($MB_SYSTEMMODAL, "GUI Event", "You selected the Close button. Exiting...") ExitLoop EndSwitch WEnd GUIDelete($hGUI)
  10. I've been unsuccessful in being able to send Keepass AutoType strings over to a GUICtrlCreateEdit field. I'm not adding any optional settings so maybe that is why, but I don't know which one(s) I should add if they are necessary. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $sInputText = "" #Region ### START Koda GUI section ### Form= $FormSendText = GUICreate("Text To Window", 634, 353, 192, 124) $EditString = GUICtrlCreateEdit("", 8, 24, 601, 273) GUICtrlSetData(-1, "") $ButtonSend = GUICtrlCreateButton("Send Now", 264, 312, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $ButtonSend $sInputText = GUICtrlRead($EditString) SendTextToWindow($sInputText) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ; The SendTextToWindow() function is not included since it is beyond the scope of the question. Keepass Autotype sets focus to the target window, but the GUICtrlCreateEdit field doesn't appear to accept it.
  11. Hello, need a tool for job to count how many text i write and simulate effect on paper. Is possible to jump on another column when reach bottom of previus one ? And, On post image (modified), on avarage every columns contain 30 characters of text, is possibile to set a limit for rows? Thank you for any help, m.
  12. hello, need some help for a small text editor My job system need to stay alway connected (lan, internet) to works. So i script a small text editor to allow my user to work offline and then send to system. It does simple task, count chars, save to disk, send to mail, etc. Now i need to add a simple code menagement. Text effect as BOLD, italic, underline, are based on open/close tag, so i think to intercept highlight text, add my special codes, ruturn modified text to editor/user. Exist any function that i can use ? thank you for any help, m.