Jump to content

BugFix

Active Members
  • Posts

    380
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by BugFix

  1. A way to do this: - mouse click on the label you want to edit - mouse click event checks if control under mouse is one of table-label - if true: get position, size and text from label - create child window including only an input in size of the label, move it over the label - set label text into the input - now you can edit the label text - with hitting <Enter> read input value, set it to label and hide/delete the child - with hitting <Esc> only hide/delete the child
  2. As commandline tool try this version (not tested). #AutoIt3Wrapper_UseX64=N ; == Syntax: "QR_Creator_CmdLine.exe sOutputPath.type sText" ; == i.e.: '"C:\Program Files (x86)\QR_Creator_CmdLine.exe" "C:\Users\USER\QR_new.bmp" "Text to encode"' -- output type *.bmp or *.png If $CmdLine[0] <> 2 Then Exit OnAutoItExitRegister("_DelBinaryTempFiles") Global $sDllQR = @ScriptDir & "\quricol32.dll" _CreateDll() Func _CreateDll() Local $bData ; string with binary data from: quricol32.dll $bData &= "0x4D5A90000300000004000000FFFF0000B80000000000000.........." ;.... ;... Local $hFileOut = FileOpen($sDllQR, 2+8+16) FileWrite($hFileOut, Binary($bData)) FileClose($hFileOut) EndFunc Func _DelBinaryTempFiles() If FileExists($sDllQR) Then FileDelete($sDllQR) EndFunc Global $sPathOut = $CmdLine[1], $sType = StringRight($sPathOut, 3), $sText = $CmdLine[2] Global $hDll = DllOpen($sDllQR) If $sType = 'bmp' Then DllCall($hDll, "none", "GenerateBMPW", "str", $sPathOut, "str", $sText, "int", 4, "int", 2) Else DllCall($hDll, "none", "GeneratePNGW", "str", $sPathOut, "str", $sText, "int", 4, "int", 2) EndIf DllClose($hDll)
  3. Hi, i have a problem with I want to call a methode with one or more parameter as ByRef. Inside the methode it works properly, but the ByRef-variable itself will not change value. Any ideas? #include <AutoItObject.au3> _AutoItObject_Startup() $oTest = _CreateObjFunc('Test') $a1 = 5 ConsoleWrite('Return Methode = ' & $oTest.Meth($a1, 3, 5) & ' [OK]' & @LF) ConsoleWrite('ByRef "$a1" after methode-call = ' & $a1 & ' [FAIL]' & @LF) ; == parameter $a1 was changed inside methode - but $a1 is'nt changed after call ;------------------------------------- OBJECT ------------------------------------------------------ Func _CreateObjFunc($_sName) Local $oSelf = _AutoItObject_Create() _AutoItObject_AddMethod($oSelf, 'Meth', "_Meth") Return $oSelf EndFunc Func _Meth(ByRef $oSelf, ByRef $A, $B, $C) $A += $B + $C Return $A EndFunc ;---------------------------------------------------------------------------------------------------
  4. Take a look at this site: http://qrcode.sourceforge.jp/, may be that it helps.
  5. In the current SciTE version, all words that are identical to a selected word, also highlighted. But I do not like this behavior. I've searched in "SciTEGlobal.properties" an parameter to disable this. I've found "selection.multiple=0". It was commented out, so i've deleted the comment sign. But it takes no effect. In my "SciTEUser.properties" is this parameter not containing. How can i disable this behavior?
  6. Here my results: The parameter for ErrorCorrectionLevel is only available in the quiricol64.dll. It makes no sense to me to use features that are not run under 32-bit. Therefore, I will omit this parameter. The function DestroyBuffer() is only needed for GetPNGW() / GetPNGA(). After call, the last parameter in this function contains the pointer to a buffer. (Thanks to Andy for his testing.)
  7. Thanks for your reply. Now I have something to do during the Christmas season.
  8. Thanks for your efforts. I have included your advice now.
  9. OK, that means, that the dll-call has failed. I've added an failure handling that gives a message with the detected error from dll call. Also I've changed the dll using - instead file name, call with dll handle. Please try again.
  10. Inspired by i've made a little tool for simply QR-Code creation with all required stuff in the au3-file (dll included as binary string, because that, the au3 has 447kB and can not attached directly). By testing on my system the max. possible count of chars to encode are: $__QR_MAX_LEN = 3049. But on other systems it was round 2000 chars. Also on another computer the creation of QR-Code fails generally. But ist was the same system that i have (Win 7, 64 bit). I do not know the reason for this behavior. Would be interesting, how this script runs on other machines. You can store the QR-Image as *.png and/or *.bmp and/or copy it to clipboard. Here you can download QR_Creator.au3 Have a look:
  11. What says the parameter description? May be, you need a nul-termination for this string: DllStructSetData($FNStruct, "fns", "test123456" & Chr(0))
  12. A short reply: I've tried to use mouse gestures. But it is not stable to use. I can get mouse position only as combination column-row, not with pixel. So it is not easy to match the current variable and additional a predefined movement. At the moment its faster to use context menu instead of this. But I'll see, if i can use functions from other libraries to reach it. Will post it here, if successful.
  13. Oops, thank you funkey. The function has worked before with diameter. Than i've changed it to radius, but i've forgotten to make the change in example too.
  14. _MouseTrapCircle works similar like _MouseTrap, but with trapping inside a circle. Two additional features: • With parameter for GUI-handle the given coordinates are used as relative in GUI. By default are absolute coordinates used. • You can set an timeout to ends trapping without function call. Default ends by call function without parameters. It's not perfect. Can be pulled out of the circle with a very fast mouse movement. Edit: Bug fixed in example (diameter instaed radius has used in _PointInCircle) #Region - TimeStamp ; 2012-07-23 16:52:11 v 0.3 #EndRegion - TimeStamp #include-once #Include <WindowsConstants.au3> #Include <WinAPI.au3> OnAutoItExitRegister('__MouseTrapCircle_ShutDown') If Not IsDeclared('$__HC_ACTION') Then Global Const $__HC_ACTION = 0 Global $__hSTUB__MouseProcTrap, $__hMOD_TRAP, $__hHOOK_MOUSE_TRAP Global $__iXCtr_Trap, $__iYCtr_Trap, $__iRadius_Trap, $__hWND_Trap Global $__MouseTrapCircle_Started = False, $__Timer_Trap = -1, $__iTimeout_Trap Global $__iTopBorder, $__iSideBorder _SystemGetWindowBorder($__iTopBorder, $__iSideBorder) ;=============================================================================== ; Function Name....: _MouseTrapCircle ; Description......: Hold the mouse trapped in a circle ; .................: Call without parameters, ends trapping. ; Parameter(s).....: $_iXCentre x-coordinate of the circle center ; .................: $_iYCentre y-coordinate of the circle center ; .................: $_iRadius Radius of the circle ; ........optional.: $_iTimeout Time in ms after trapping ends, without an function call (Default=-1, no timeout) ; ........optional.: $_hWnd If given: $_iXCentre and $_iYCentre are used as relative to this window. ; .................: Default: Coordinates are absolut on screen ; Return Value(s)..: Nothing ; Author(s)........: BugFix ( [email protected] ) ;=============================================================================== Func _MouseTrapCircle($_iXCentre=-1, $_iYCentre=-1, $_iRadius=-1, $_iTimeout=-1, $_hWnd=-1) If $_iXCentre = -1 Or $_iYCentre = -1 Or $_iRadius = -1 Then __MouseTrapCircle_ShutDown() Else __MouseTrapCircle_StartUp($_iXCentre, $_iYCentre, $_iRadius, $_iTimeout, $_hWnd) EndIf EndFunc ;==>_MouseTrapCircle #region - Internal functions ;=============================================================================== ; Function Name....: __MouseTrapCircle_StartUp ; Description......: Initialize functions ;=============================================================================== Func __MouseTrapCircle_StartUp($_iXCentre, $_iYCentre, $_iRadius, $_iTimeout, $_hWnd) $__MouseTrapCircle_Started = True $__iXCtr_Trap = $_iXCentre $__iYCtr_Trap = $_iYCentre $__iRadius_Trap = $_iRadius $__hWND_Trap = $_hWnd If IsHWnd($__hWND_Trap) Then Local $aWin = WinGetPos($__hWND_Trap) $__iXCtr_Trap = $aWin[0] + $__iSideBorder + $__iXCtr_Trap $__iYCtr_Trap = $aWin[1] + $__iTopBorder + $__iYCtr_Trap EndIf If $_iTimeout > 0 Then $__Timer_Trap = TimerInit() $__iTimeout_Trap = $_iTimeout EndIf ; == initialize Callback Function to analyze MOUSE-Message $__hSTUB__MouseProcTrap = DllCallbackRegister("__MouseProcTrap", "long", "int;wparam;lparam") $__hMOD_TRAP = _WinAPI_GetModuleHandle(0) $__hHOOK_MOUSE_TRAP = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($__hSTUB__MouseProcTrap), $__hMOD_TRAP) EndFunc ;==>__MouseTrapCircle_StartUp ;=============================================================================== ; Function Name....: __MouseTrapCircle_ShutDown ; Description......: Close ressources ;=============================================================================== Func __MouseTrapCircle_ShutDown() If $__MouseTrapCircle_Started Then _WinAPI_UnhookWindowsHookEx($__hHOOK_MOUSE_TRAP) DllCallbackFree($__hSTUB__MouseProcTrap) EndIf EndFunc ;==>__MouseTrapCircle_ShutDown ;=============================================================================== ; Function Name....: __MouseProcTrap ; Description......: Callback mouse procedure ;=============================================================================== Func __MouseProcTrap($nCode, $wParam, $lParam) If $__Timer_Trap <> -1 And TimerDiff($__Timer_Trap) >= $__iTimeout_Trap Then Return __MouseTrapCircle_ShutDown() If $nCode <> $__HC_ACTION Then Return _WinAPI_CallNextHookEx($__hHOOK_MOUSE_TRAP, $nCode, $wParam, $lParam) Local Static $iXComp = -1, $iYComp = -1 Local $iX, $iY, $iXMove, $iYMove, $oldOpt Local $iDirX = 0, $iDirY = 0 Local $tMSLLHOOKSTRUCT = DllStructCreate("int X;int Y;dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo", $lParam) Local $tPoint = DllStructCreate('int;int') $iX = DllStructGetData($tMSLLHOOKSTRUCT, 1) $iY = DllStructGetData($tMSLLHOOKSTRUCT, 2) DllStructSetData($tPoint, 1, $iX) DllStructSetData($tPoint, 2, $iY) If $iXComp = -1 Then $iXComp = $iX $iYComp = $iY EndIf Switch $wParam Case $WM_MOUSEMOVE If $iX > $iXComp Then $iDirX = -1 ElseIf $iX < $iXComp Then $iDirX = 1 EndIf If $iY > $iYComp Then $iDirY = -1 ElseIf $iY < $iYComp Then $iDirY = 1 EndIf If Not _PointInCircle($iX, $iY, $__iXCtr_Trap, $__iYCtr_Trap, $__iRadius_Trap) Then $oldOpt = Opt('MouseCoordMode', 1) MouseMove($iX +($iDirX), $iY +($iDirY), 0) If IsHWnd($__hWND_Trap) Then Local $tRect = _WinAPI_GetWindowRect($__hWND_Trap) If Not _WinAPI_PtInRect($tRect, $tPoint) Then MouseMove($__iXCtr_Trap, $__iYCtr_Trap, 0) EndIf Opt('MouseCoordMode', $oldOpt) Return -1 EndIf EndSwitch Return _WinAPI_CallNextHookEx($__hHOOK_MOUSE_TRAP, $nCode, $wParam, $lParam) EndFunc ;==>__MouseProcTrap ;=============================================================================== ; Function Name....: __PointInCircle ; Description......: Calculates whether given position within a circle ; Author(s)........: BugFix ( [email protected] ) ;=============================================================================== Func _PointInCircle($_iXPt, $_iYPt, $_iXCircle, $_iYCircle, $_iRadius) Return ((Sqrt(($_iXCircle-Abs($_iXPt))^2 + ($_iYCircle-Abs($_iYPt))^2)) < $_iRadius) EndFunc ;==>__PointInCircle ;=============================================================================== ; Function Name....: __SystemGetWindowBorder ; Description......: Calculates side and top border of window ; Author(s)........: BugFix ( [email protected] ) ;=============================================================================== Func _SystemGetWindowBorder(ByRef $_iTopBorder, ByRef $_iSideBorder) Local Const $SM_CYCAPTION = 4, $SM_CYEDGE = 46, $SM_CYBORDER = 6, $SM_CXBORDER = 5, $SM_CXEDGE = 45 Local $aMetrics[5][2] = [[$SM_CYCAPTION], [$SM_CYEDGE], [$SM_CYBORDER], [$SM_CXBORDER], [$SM_CXEDGE]] Local $dll = DllOpen("user32.dll"), $aRet For $i = 0 To 4 $aRet = DllCall($dll, "int", "GetSystemMetrics", "int", $aMetrics[$i][0]) If IsArray($aRet) Then $aMetrics[$i][1] = $aRet[0] Next DllClose($dll) $_iTopBorder = $aMetrics[0][1] + $aMetrics[1][1] + $aMetrics[2][1] $_iSideBorder = $aMetrics[3][1] + $aMetrics[4][1] EndFunc ;==>__SystemGetWindowBorder #endregionMouseTrapCircle0.3.au3 MouseTrapCircle_Example.au3
  15. New Version v0.9 Creating submenu is possible. See post #1
  16. Nice, i like this. Good work. One point: I think it may be better to hook WM_NOTIFY with an own Callback windows procedure. So it's not required to use the special function __GUICtrlTreeViewTab_WM_NOTIFY for this. And so the usage of GUIRegisterMsg is like known.
  17. Oops The Include must be renamed, have changed it in example now. Thanks for your report.
  18. I've now taken your advices. See changes in my first post.
  19. Thanks for testing and your replys. @funkey I'll change it with next version. (both points) @MrCreatoR * The hover is slow. I'll decrease the Adlib-time to 10 ms. Than it should be fast enough. (atm i use 50 ms) * If you right click on the gui after menu is shown, the menu is still there and hovering does not working. I've never used right click if the menu is shown. So i have not seen this behavior. Thanks, that you've found this bug. I'll fix this with next version.
  20. With this UDF you can create own context menus with following features: - Show menu only, if an condition is TRUE (ie: number of entries in an listview must be greater than zero) - Item types: Label, Checkbox, Radio, Image (jpg,bmp,gif), Icon (from Icon file, DLL), Shape --- Image files should be (nearly) quadratic. It is scaled to 16 x 16 pixel. - The menu width is selectable. (Default 200 px) - Left margin for general and additional for each menu item can be set (Indents are thus possible) - The Items are default controls. You can Disable/Enable them, change text color, set state. But don't change background color. The background color is changed when the mouse is over the entry. - If you like an other hover color, you can change it during the menu creation. Or later with an own function. Edit: Now I've made some changes: - more speed during hover (decrease adlib time from 50 to 10 ms) - if menu is shown and you click with right: on menu - nothing happens, outside menu - menu will closed - renamed functions to _GUICtrlOwnContext_... - used funkeys tip for Bkcolor - In my Win 7 the hover color is clearly to see. If you've a problem with this, change color during creation of menu or general with changing the declaration: Global $__iMNU_DEF_HOVERCOLOR = 0xEFFFFF Edit 2: - Added: For each entry you can create an submenu (1 level depth). Important: First, create all entries to the menu. Only then can sub-menus and their entries are created. See the example. - Changed:Now the entire area of the entry is detected as an control. Also used Images. - Changed: No more Adlib function, all processing inside window- and mouse- procedures. - New Example for v0.9 (dont works with older version) Current version: v0.9 So it looks: v0.8 v0.9 OwnContext.au3 OwnContext_Example.au3 OwnContext0.9.au3 OwnContext_Example0.9.au3
  21. New version v0.6 Added: Tip for functions, that have created in your script.
  22. Thanks for you reply. Was a copy&paste error - lost one char. Now i'v fixed it.
  23. Added: Installer.au3 Easy to install and to configure now. You can configure a context menu entry too. see post #1
×
×
  • Create New...