18 posts in this topic
add/remove from txt file inside GUI
I need help to get further with this script
Test.txt contains lines like this:
I have managed to view the content of a txt file in the left side of a GUI like this:
#Include <File.au3> #include <GUIConstants.au3> Global $file = FileRead("Test.txt") GUICreate("", 800, 800, 192, 124) $control = GUICtrlCreateEdit($file, 0, 0, 400, 800, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY) GUICtrlSetFont(-1, 14, 400, 0, "@Arial Unicode MS") GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetState($control, $GUI_FOCUS) ;Makes sure that text is not highlighted by default GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
Okay so is it possible to make each line become a clickable item?
Say I want to delete Line2, then I highlight it and click a "remove" button.
Also an "add" button would be needed to add new lines
On Case $GUI_EVENT_CLOSE the changes should be saved to Test.txt (Or with a save button)
Is this possible?
I hope you can help me :-)
Utilising existing GUI code in koda.
I have a program I made long ago for something but I never saved the koda file so it would make it a complete pain for me to visually tweak anything because as far as I am aware, I would have to design an entirely new GUI.
Would it be possible for you guys at AutoIt to add functionality to Koda so that you can take an existing GUI section, with while loop and cases and all and then koda would literally build it ready for tweaking and where existing things still exist and have been tweaked, it would tweak such details and keep all the existing case information and added formatting things that were manually tweaked etc?
This would be really amazing and I feel that other people would benefit from it. I can't be the only person who makes a GUI, doesn't save it and then has no problems making minor tweaks in-code but struggles like hell to go rearranging things perfectly. That is where using a GUI (koda) to make and arrange a GUI you are making, makes everything easy and pleasure to deal with.
A friend gives me his code and wants help. The GUI is just a mess, but trying to do all the alignment and positioning all by digits in code would be a pain. I cannot just hallucinate where everything is based on pixel locations and sizes. So I would take the entire GUI chunk of code, all the form/controls/formatting functions/while loop/switch/case in it's entirety and paste it into an area of Koda and press a button. Koda would then build the GUI on the screen, placing all the controls and formatting them with the instructions that may have been added and keeps the case information as-is. Then when you make your alterations in Koda, you go to export it and it makes an entirely new export that re-makes (from scratch as if you had made this GUI from scratch) all the code for controls, size, placement etc and then also adds all the existing case code back as part of the code you then send (or manually copy/paste as I do) to Scite editor.
Is there any chance this could be implemented? I think this could help a lot of people with their own scripts and others'.
Buttons and labels in tabs
Hello I got problem with my form cause i got some buttons, labels, inputs and now i want organize this in tabs.
There is a problem, when i put new tab this tab is on bottom and this is above my buttons or button is show on whole form , not only in one tab.
How to deal with it
Open webpages by checking boxes
Hello everyone, don't even know how to ask. My code is:
#include <String.au3> #include <IE.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 700, 500, 192, 124) $Button1 = GUICtrlCreateButton("View", 576, 24, 89, 41) Global $oIE = _IECreate("https://www.youtube.com/playlist?list=PL4Jcq5zn02jKpjX0nqI1_fS7mEEb5tw6z", 1, 1, 0) Sleep(1000) Global $sHTML = _IEDocReadHTML($oIE) $FirstChunks = _StringBetween($sHTML, 'pl-video-title-link yt-uix-tile-link yt-uix-sessionlink', '<div class="pl-video-owner') $x = 16 For $a In $FirstChunks $actualdata = _StringBetween($a, '">', '</a>') ;$actualdata2 = _StringBetween($a, 'href="', '&') $Checkbox1 = GUICtrlCreateCheckbox($actualdata, 24, $x, 500, 17) $x = $x + 20 Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Somehow I need to open webpages where checkbox is checked by presing button view, I think I need somehow asign $actualdata with $actualdata2. Any ideas would be very appreciated
Custom Stream GUI Using Autoit Gui Wrap
Hey guys! I need to find a way to wrap an autoit gui around a game. I am planning on making a custom gui overlay for interacting with my stream, which will allow me to run giveaways and stuff like that. But I need to find a way to force the steam games to run inside my autoit gui... I have the following code so far credit to those I took code from and modified to suite my needs "can't remember who u are pls post if i owe ty to u" If I select notepad and launch it then it works great! and the notepad window is wrapped inside my gui. However if I try it with teamfortress 2 it won't work...
#include <Array.au3> #include <File.au3> #include <WinAPI.au3> #include <GUIConstants.au3> Local $msg, $hwnd, $WinHwnd ;===> UDV Start $pid = 0 $Hidden = 0 $exe = 0 $sDrive = 0 $sDir = 0 $sFileName = 0 $sExtension = 0 ;===> UDV End $hwnd = GUICreate("hello") $Open = GUICtrlCreateButton("Launch Game", 10, 30, 75, 25) $Select = GUICtrlCreateButton("Select Game", 10,60,75,25) GUISetState() ;===> UDF START Func _GetWinHwnd($pid) $aWinlist = WinList() For $i = 1 To $aWinlist If $pid = WinGetProcess($aWinlist[$i]) Then Return $aWinlist[$i] Next EndFunc ;==>_GetWinHwnd Func _SetParentWindow($pid) $WinInfo = _GetWinHwnd($pid) $WinHwnd = ControlGetHandle($WinInfo, "", "") _WinAPI_SetParent($WinHwnd, $hwnd) _WinAPI_SetWindowLong($WinHwnd, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) WinMove($WinHwnd, "", 0, 0) EndFunc ;==>_SetParentWindow Func RedrawGui($RedrawMe) If ProcessExists($pid) And $Hidden = 0 Then GUICtrlSetState($RedrawMe, @SW_HIDE) $Hidden = 1 sleep(50) _WinAPI_RedrawWindow($pid) Sleep(50) ElseIf $Hidden = 1 And Not ProcessExists($pid) Then GUICtrlSetState($RedrawMe, @SW_SHOW) $Hidden = 0 EndIf EndFunc ;===> UDF END While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE If ProcessExists($pid) Then ProcessClose($pid) GUICtrlSetState($Open, @SW_SHOW) Else Exit EndIf Case $Open GUICtrlSetState($Open, @SW_HIDE) Sleep(100) $pid = Run('"' & $exe & '" -game tf -steam') #cs This RUN CMD is custom made for testing with TF2 change to just $exe to select any exe you want to test with -game tf specifies to launch tf2 and -steam gets rid of insecure mode error #ce RedrawGui($Open) ProcessWait($pid) Sleep(5500) _GetWinHwnd($pid) _SetParentWindow($pid) Case $Select $exe = FileOpenDialog("Please select your game!", @ScriptDir, "Executable File (*.exe)", "1", "Process Selection") Sleep(50) FileChangeDir(@ScriptDir) _PathSplit($exe, $sDrive, $sDir, $sFileName, $sExtension) EndSwitch WEnd