Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/22/2025 in all areas

  1. I have been creating few controls with round corners for awhile for my own needs and I felt it was time to make an UDF and share it with the community. The idea behind this UDF is to use essentially simple basic AutoIt GUI functions. I did not want to embark in GDI+ to create the controls. I wanted to be easy to use with enough features that it would answer most requirements. The functions contained in the UDF : _RGUI_RoundLabel _RGUI_RoundButton _RGUI_RoundInput _RGUI_RoundEdit _RGUI_RoundGroup _RGUI_RoundScrollBar _RGUI_ScrollBarSet _RGUI_ScrollBarDestroy _RGUI_RoundRect _RGUI_DrawLine _RGUI_ButtonPress _RGUI_ButtonReset Version 2025-04-06 * Solved an issue where scroll bar and control are not in the same GUI child * Added 4th example on how to use scrollbar with ListView over a background generated by GDI+ Version 2025-03-28 * Added support to auto-size label and button controls (by passing -1 for width and/or height) * Removed the requirement to pass handle of the GUI to _RGUI_RoundGroup * Added 3rd example on how to use scrollbar with RichEdit Version 2025-03-21 * Added support of round corner scrollbar * Added a 2nd example on how to use scrollbar with ListBox Version 2025-03-15 * Basic framework for the UDF Here an example of what could be done with the UDF : If you feel there should be new controls, I will consider adding them to the UDF. RoundGUI.zip
    2 points
  2. 1 point
  3. I have the same problem (Scite-Lite) . Unfortunately it will never be fixed, see this Track ticket closed 17years ago. I do same (more and more) using a personal function named _Doubleton , which prevents the script to be run twice : #include <MsgBoxConstants.au3> If _Doubleton("AutoIt - Clipboard Translate v14") Then Exit ; script already launched + user wants to quit ; ... Func _Doubleton($sTitle) If WinExists($sTitle) Then Local $iChoice = Msgbox(BitOr($MB_YESNO, $MB_DEFBUTTON2, $MB_ICONQUESTION, $MB_TOPMOST), $sTitle, _ "This script is already running. Launch another instance ?") If $iChoice = $IDNO Then Return True EndIf AutoItWinSetTitle($sTitle) ; remember the AutoIt window is always hidden EndFunc ;==>_Doubleton
    1 point
  4. Added to the wiki
    1 point
  5. From what I can dig up, its looking a bit grim hey... The WinMM mixer stuff looked like a possibility, but the only controls I could find on my VMs post win98 were volume and mute buttons. I did see this for WMP as part of the skinning API? not sure how helpful that is... https://learn.microsoft.com/en-us/previous-versions/windows/desktop/wmp/equalizersettings-element Then theres audiograph, which seems to incorperate an EQ object - but its WinRT again, so that could be a bit ambitious. I'll see what I can do with it during the week. https://learn.microsoft.com/en-us/uwp/api/windows.media.audio.audiograph?view=winrt-26100
    1 point
  6. Sorry to take a bit to reply. Still no luck. But a few things have occurred to me that may have some bearing on the issue. 1.) Zed has builtin GH Copilot prediction on keystrokes. I believe I've disabled it now and I'll see if that helps. I don't care about the copilot stuff for regression testing; I mean I'm just testing basic behaviors to ensure they work as expected. 2.) Sven you mentioned SendKeyDownDelay but in your sample code you have this: So I actually set both of them to 250. And I believe I'm now getting the keystrokes as I want them. The last test isn't passing but I did see the Theme Selector pop up so it's likely that it's my problem in picking the wrong pass/fail criteria. FWIW, here's the code I currently have (for reference): #cs------------------------------------ Zed Automated Regression Testing Suite Onorio Catenacci 21 March 2025 v 0.0.4 #ce------------------------------------ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #include-once Opt("MustDeclareVars",true) Opt("SendKeyDelay",250) Opt("SendKeyDownDelay",250) #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Const $zedWindowClass = "[CLASS:Zed::Window]" Func OutputResult($testName, $testResult) Local $resultString = "Test " & $testName $resultString &= " " $resultString &= $testResult ? "Passed" : "Failed" return $resultString EndFunc Func StartZed() Run("pwsh c:\users\public\zed.ps1") Local $HWnd = WinWaitActive($zedWindowClass) return $HWnd EndFunc Func CloseZed($keystrokesToClose = Default) if $keystrokesToClose = Default Then ;~ Standard Windows Close Key Combo Send("!{F4}") else Send($keystrokesToClose) endif EndFunc Func TestZedStartupAndShutdown_CtrlQ() StartZed() Sleep(1000) CloseZed("^q") Sleep(1000) # Test Local $actual = WinExists($zedWindowClass) Local $expected = 0 return ($actual = $expected) EndFunc Func TestZedStartupAndShutdown_StandardWindows() StartZed() Sleep(1000) CloseZed() Sleep(1000) # Test Local $actual = WinExists($zedWindowClass) Local $expected = 0 return ($actual = $expected) EndFunc Func TestOpenSettingsTab() StartZed() Sleep(1000) Send("^,") Sleep(100) Local $winTitle = WinGetTitle("[ACTIVE]") Local $positionOfSettingsInTitle = StringInStr($winTitle,"settings") Local $actual = $positionOfSettingsInTitle > 0 Local $expected = True CloseZed() return ($actual = $expected) EndFunc Func TestKeyboardMappings() StartZed() Sleep(1000) Send("{CTRLDOWN}") Send("k") Send("s") Send("{CTRLUP}") Sleep(1000) Local $winTitle = WinGetTitle("[ACTIVE]") Local $positionOfKeymapInTitle = StringInStr($winTitle,"keymap") Local $actual = $positionOfKeymapInTitle > 0 Local $expected = True CloseZed() return ($actual = $expected) EndFunc Func TestSelectTheme() StartZed() Sleep(1000) Send("{CTRLDOWN}") Send("k") Send("t") Send("{CTRLUP}") Sleep(1000) Local $winTitle = WinGetTitle("[ACTIVE]") Local $positionOfSelectThemeInTitle = StringInStr($winTitle,"Theme") Local $actual = $positionOfSelectThemeInTitle > 0 Local $expected = True CloseZed() return ($actual = $expected) EndFunc Func TestMouseBehavior() StartZed() Sleep(1000) Local $currentMouseCoordMode = Opt("MouseCoordMode") Opt("MouseCoordMode",0) MouseMove(16,14) MouseClick($MOUSE_CLICK_PRIMARY) Opt("MouseCoordMode",$currentMouseCoordMode) EndFunc Func RunAllTests() Local $testsToRun[] = ["TestZedStartupAndShutdown_CtrlQ", "TestZedStartupAndShutdown_StandardWindows", "TestOpenSettingsTab", "TestKeyboardMappings", "TestSelectTheme"] Local $resultOfTest[UBound($testsToRun)] For $i = 0 to UBound($testsToRun)-1 $resultOfTest[$i] = Call($testsToRun[$i]) Next For $i = 0 to UBound($testsToRun)-1 MsgBox($MB_ICONINFORMATION, "Zed Tests", OutputResult($testsToRun[$i],$resultOfTest[$i])) Next EndFunc ; TestMouseBehavior() RunAllTests() Since you both gave me excellent suggestions I incorporated all of them into my script. For now I think it was Sven's suggestion that solved this so I'll mark his answer as the solution. But I also think disabling copilot helped some and as I said I'll still want to do more testing. Regardless thanks for educating an AutoIt newbie a bit!
    1 point
×
×
  • Create New...