
eJan
Active Members-
Posts
96 -
Joined
-
Last visited
Everything posted by eJan
-
I'm sorry! I didnt't explain what and where to do. Case $msg = $btn2[0] Action()I would like this one to replace with $GUI_EVENT_PRIMARYUP, where $btn2[0] is HoverButton (Label). Maybe it's little complicated because there is GUICreateBiStateControl() function which maybe doesn't allow to capture event?
-
Thanks syberschmo, very close, unfortunately doesn't work everytime when the mouse is released.
-
ActiveX - NO, I have already use Labels which simulate Button - all I wanna do is: to use that label and capture mouse event when the mouse is released over Label - not clicked (because in Windows if user click on button and move cursor outside that button - nothing happen. Best explanation is HyperLink control where the action is taken when mouse is released inside HyperLink - not clicked)
-
I'd like to have "real" Hover Button which capture $GUI_EVENT_PRIMARYUP on desired control. GUIGetMsg should work when Button was released inside control - not (only) clicked. Please help. #include <GUIConstants.au3> $hGUI = GUICreate("GUI", 226, 88) $text = GUICtrlCreateLabel("Label", 8, 10, 209, 29, $SS_SUNKEN) GUICtrlSetColor($text, 0x737373) $progress = GUICtrlCreateProgress(8, 43, 209, 16, $PBS_SMOOTH) $btn2 = GUICreateBiStateControl(GUICtrlCreateLabel("", 83, 63, 60, 17), $hGUI, "OnHover", "OnLeave") $btnW = GUICtrlCreateLabel("", 84, 64, 58, 15, $SS_WHITEFRAME) ; Button (white) $btnG = GUICtrlCreateLabel("", 83, 63, 60, 17, $SS_GRAYFRAME) ; Button (gray) GUICtrlCreateLabel("", 2, 4, 221, 81, $SS_GRAYFRAME) ; Group (gray) $btn1 = GUICtrlCreateLabel("Button", 83, 63, 60, 17, $SS_CENTER) GUICtrlSetColor($btn1, 0x8C8C8C) HotKeySet("{ENTER}", "Action") GUISetState(@SW_SHOW) Func Close() GUISetState(@SW_HIDE) Exit EndFunc While 1 CheckBiStateControl($btn2) $msg = GUIGetMsg() Select Case $msg = $btn2[0] Action() Case $msg = $GUI_EVENT_CLOSE Close() EndSelect WEnd Func Action() HotKeySet("{ENTER}") MsgBox(0, "", "Clicked") For $i = 1 To 100 Step 20 Sleep(1) GUICtrlSetData($progress, $i, $i) Next GUICtrlSetData($btn1, "Close") GUICtrlDelete($progress) $text2 = GUICtrlCreateLabel("Complete", 8, 43, 209, 16, $SS_CENTER + $SS_SUNKEN) GUICtrlSetColor($text2, 0x737373) HotKeySet("{ENTER}", "Close") While 1 CheckBiStateControl($btn2) $msg = GUIGetMsg() Select Case $msg = $btn2[0] Or $msg = $GUI_EVENT_CLOSE Close() EndSelect WEnd EndFunc Func OnHover() GUICtrlSetColor($btn1, 0x4AAACA) EndFunc Func OnLeave() GUICtrlSetColor($btn1, 0x8C8C8C) EndFunc Func GUICreateBiStateControl($hControl, $hGUI, $hover_func, $leave_func) Local $cPos = ControlGetPos($hGUI, "", $hControl) Local $hBSControl[8] $hBSControl[0] = $hControl $hBSControl[1] = $cPos[0] $hBSControl[2] = $cPos[1] $hBSControl[3] = $cPos[0] + $cPos[2] $hBSControl[4] = $cPos[1] + $cPos[3] $hBSControl[5] = $hover_func $hBSControl[6] = $leave_func $hBSControl[7] = 0 Return $hBSControl EndFunc Func CheckBiStateControl(ByRef $hControl) Local $info = GUIGetCursorInfo() If $info[0] > $hControl[1] And $info[0] < $hControl[3] And _ $info[1] > $hControl[2] And $info[1] < $hControl[4] Then If $hControl[7] Then Return 0 $vCallData = $hControl[0] Call($hControl[5]) $hControl[7] = 1 ElseIf $hControl[7] Then $vCallData = $hControl[0] Call($hControl[6]) $hControl[7] = 0 EndIf EndFuncEdit: AutoIt 3.1.1.92
-
You can do skins with freeware SkinBuilder: http://www.skincrafter.com/skbuilder.html and lot of good skins can be found here: http://www.skincrafter.com/skingal.php
-
This is what I was looking for a long time for AutoIt. Thanks rysiora!! Small addition to func "Quit()" Func Quit() GUISetState(@SW_HIDE) DllCall($dll, "int", "DeInitDecoration") DllCall($dll, "int", "RemoveSkin") DllClose($dll) Exit EndFuncTo hide GUI before removing Skin and closing Dll (the GUI window is displayed "classic" for a few miliseconds).
-
How to set darken color to gradient control
eJan replied to eJan's topic in AutoIt GUI Help and Support
Thanks gafrost for interesting solution, I was thinking: it can be done, but C++ is more complex, I will add If statement for XP scheme Else for other schemes and thats O.K. -
How to set darken color to gradient control
eJan replied to eJan's topic in AutoIt GUI Help and Support
Actually I need math calculation to set gradient color darken than windows theme (button face). Where in XP style button face = 236, 233, 216 and gradient color = 198, 198, 188 __ In classic style button face = 212, 208, 199 and gradient color = 178, 177, 173 _GUICreateGradient("***", "0x" & $hexColor, 10, 10, 100, 100) In my case i need help to set math calculation for "***" to set gradient darken than color scheme. In first topic i've added picture to show differencies between button face and gradient color - where gradient color (cross) in color scheme is "moved" only vertically and all R, G, B values are changed. Maybe the solution is in _ColorGetRed, G, B but I don't know which color scheme users have ..maybe olive, green or ... COLORREF DarkenColor(COLORREF col,double factor) { if(factor>0.0&&factor<=1.0){ BYTE red,green,blue,lightred,lightgreen,lightblue; red = GetRValue(col); green = GetGValue(col); blue = GetBValue(col); lightred = (BYTE)(red-(factor*red)); lightgreen = (BYTE)(green-(factor*green)); lightblue = (BYTE)(blue-(factor*blue)); col = RGB(lightred,lightgreen,lightblue); } return(col); } I have added pics of same app in different color schemes: This is "***" gradient which I try to make it working with au3 EDIT: changed pic. location -
This is script which I'm trying to modify to work on all XP themes, it work fine on my comp with xp theme but on classic theme gradient is not visible. I don't undersand C++, this is CGradientStatic source CGradientStatic.rarwhich change the gradient color depending on GetSysColor(COLOR_BTNFACE) - maybe someone can help me to make this one working in au.3 _My BTNFACE _ Gradient Color #include "GUIConstants.au3" #include <Color.au3> $out = DllCall("user32", "long", "GetSysColor", "long", 15) $hColor = Hex($out[0], 6) $hexColor = StringRight($hColor, 2) & StringMid($hColor, 3, 2) & StringLeft($hColor, 2) GUICreate("Gradient", 120, 120) _GUICreateGradient("***", "0x" & $hexColor, 10, 10, 100, 100); "***" to be changed depending on color scheme GUISetState() Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Func _GUICreateGradient($nStartColor, $nEndColor, $nX, $nY, $nWidth, $nHeight) Local $color1R = _ColorGetRed($nStartColor) Local $color1G = _ColorGetGreen($nStartColor) Local $color1B = _ColorGetBlue($nStartColor) Local $nStepR = (_ColorGetRed($nEndColor) - $color1R) / $nHeight Local $nStepG = (_ColorGetGreen($nEndColor) - $color1G) / $nHeight Local $nStepB = (_ColorGetBlue($nEndColor) - $color1B) / $nHeight For $i = 0 To $nHeight $sColor = "0x" & StringFormat("%02X%02X%02X", $color1R + $nStepR * $i, $color1G + $nStepG * $i, $color1B + $nStepB * $i) $label = GUICtrlCreateLabel("", $nX, $nY + $i, $nWidth, 1) GUICtrlSetBkColor($label, $sColor) Next EndFunc EDIT: Changed pic. location
-
O.K. thanks for help.
-
Can be done to create graphic control over label? I have tried with GUICtrlSetStyle($gr1, $DS_SETFOREGROUND, $WS_EX_TRANSPARENT) but I cant find the working solution #include "GUIConstants.au3" #include "Color.au3" $out = DllCall("user32", "long", "GetSysColor", "long", 15) $hColor = Hex($out[0], 6) $hexColor = StringRight($hColor, 2) & StringMid($hColor, 3, 2) & StringLeft($hColor, 2) GUICreate("Gradient", 260, 140) _GUICreateGradient(0xC8C6B7, "0x" & $hexColor, 20, 20, 100, 100); To hide behind GuiCtrlCreateGraphic _GUICreateGradient(0xFFFFFF, 0x6AC4C8, 140, 20, 100, 100); To hide behind GuiCtrlCreateGraphic $gr1 = GuiCtrlCreateGraphic(10, 10, 120,120); To paint over _GUICreateGradient GUICtrlSetBkColor($gr1, 0xffffff) GUICtrlSetColor($gr1, 0) $gr2 = GuiCtrlCreateGraphic(130, 10, 120,120); To paint over _GUICreateGradient GUICtrlSetBkColor($gr2, 0xEDBCDE) GUICtrlSetColor($gr2, 0) GUISetState() Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Func _GUICreateGradient($nStartColor, $nEndColor, $nX, $nY, $nWidth, $nHeight) Local $color1R = _ColorGetRed($nStartColor) Local $color1G = _ColorGetGreen($nStartColor) Local $color1B = _ColorGetBlue($nStartColor) Local $nStepR = (_ColorGetRed($nEndColor) - $color1R) / $nHeight Local $nStepG = (_ColorGetGreen($nEndColor) - $color1G) / $nHeight Local $nStepB = (_ColorGetBlue($nEndColor) - $color1B) / $nHeight For $i = 0 To $nHeight $sColor = "0x" & StringFormat("%02X%02X%02X", $color1R + $nStepR * $i, $color1G + $nStepG * $i, $color1B + $nStepB * $i) $label = GUICtrlCreateLabel("", $nX, $nY + $i, $nWidth, 1) GUICtrlSetBkColor($label, $sColor) Next EndFunc
-
For Me too, thanks for quick and effective response!
-
I'm triyng to make script which randomly play wav file, but it doesn't work. Dim $avArray[6] $avArray[0] = @ScriptDir & "Wav\001.wav" $avArray[1] = @ScriptDir & "Wav\002.wav" $avArray[2] = @ScriptDir & "Wav\003.wav" $avArray[3] = @ScriptDir & "Wav\004.wav" $avArray[4] = @ScriptDir & "Wav\005.wav" $avArray[5] = @ScriptDir & "Wav\006.wav" $i = 0 Do $i = SoundPlay(Random($avArray[0], $avArray[5], 0), 0) $i = $i + 1 Until $i = 40 Script and wav files:Wav.rar
-
Can be done to display counter to MsgBox()
eJan replied to eJan's topic in AutoIt GUI Help and Support
Thanks Nuffilein805 but I need that only for Msgbox() - O.K. I will create gui for that purpose. If $shut = $GUI_CHECKED Then $ask0 = MsgBox(4, "USB Backup", "Backup complete." & @CRLF & "Shutdown computer?", 10) While 1 If $ask0 = -1 Or $ask0 = 6 Then; YES Shutdown(1) Else Exit EndIf WEnd ElseIf $shut = $GUI_UNCHECKED Then MsgBox(0, "USB Backup", "Backup was completed.", 10) Exit EndIf -
I'm trying to make MsgBox() which close after 10 seconds but to display remaining time to close, or I have to make GUI and update control with data. Global $i ;ProgressOn("Progress Meter", "Increments every second", "0 percent") $msg = MsgBox(0, "", "Time: " & $i, 10) For $i = 10 to 1 step -1 sleep(1000) GUICtrlSetData($msg, $i) ;ProgressSet( $i, $i & " percent") Next ;ProgressSet(100 , "Done", "Complete") ;sleep(500) ;ProgressOff()
-
How can add message for @error in DirCopy()
eJan replied to eJan's topic in AutoIt GUI Help and Support
O.K. thanks again, I will try in the morning with more If... - they killing me but ..that's only good way. -
How can add message for @error in DirCopy()
eJan replied to eJan's topic in AutoIt GUI Help and Support
Thanks Valuater Will try, but same thing if source dir doesn't exist. Maybe You can point me how to use @error flag correctly? -
I need help with failure or success in DirCopy() I'm tring to copy dir to removable HD but when the HD is unplugged it looks like coping were O.K. DirCopy("E:\Tweak", "G:\Local Disk E\Tweak", 1) If @error Then MsgBox(0, "", "Error") Exit EndIf
-
How to delete Ctrl created (inside) function
eJan replied to eJan's topic in AutoIt GUI Help and Support
Thanks psandu.ro, thats exactly what I need! -
I'm trying to change style or delete controls created inside function using variables, but error was "Error: Variable used without being declared" - see: ;If $msg = $delbtn Then DeleteLabel() #include <GUIConstants.au3> GUICreate("My GUI", 120, 170) GUISetState (@SW_SHOW) $btn = GUICtrlCreateButton("Create label", 25, 120, 70, 20) While 1 $msg = GUIGetMsg() If $msg = $btn Then _CreateLabel() ;If $msg = $delbtn Then DeleteLabel(); If enabled "Error: Variable used without being declared" If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Func _CreateLabel() $label = GUICtrlCReateLabel("Label", 10, 10, 100, 100, $SS_SUNKEN) $delbtn = GUICtrlCreateButton("Delete label", 25, 140, 70, 20) EndFunc Func DeleteLabel() GUICtrlDelete($label) EndFunc
-
I'm tring to make hottrack gradient tristate button, in the TriStateLabel_OK.au3 bistate function work O.K. when the button should be label but when I replace label with gradient label TriStateLabel_Wrong.au3 then hottrack work on whole GUI window - not only on gradient (label) button. EDIT: Solved
-
Try with few lines less #include <GUIConstants.au3> #include <IE.au3> HotKeySet("{ESC}", "Terminate") GUICreate("TRANSPOWER - Induction, Stage 1 Welcome.",899, 674) Opt("ExpandVarStrings", 1) $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 900,675) $oIE.navigate("@ScriptDir@\test.html") $oIE.document.body.scroll = "no" $oIE = 0 GUISetState() Func Terminate() Exit 0 EndFunc While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit Wend
-
Try with flag (1) $Drive_1 = "D:" $Folder_1 = "Profile" $User_1 = "My Name" DirCopy(@Mydocumentsdir, $drive_1 & "\" &$Folder_1 & "\" & $User_1, 1) DirCopy(@FavoritesDir, $drive_1 & "\" & $Folder_1 & "\" & $User_1, 1)
-
Make sure that You have set
-
Using AutoIt to click in specific link at website
eJan replied to Jaccus's topic in AutoIt General Help and Support
Follow link: http://www.autoitscript.com/forum/index.php?showtopic=8518 and download AutoItMacroGenerator > will do the job for You.