Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/09/2022 in all areas

  1. Thanks @mLipok for your set of Include files. I have added them into a extra Standard include directory to he open.path= properties and now went up from: 14 extra includes and 369 extra UDFs: !-> Get_Std_UDFs time: 0.86 GlobalConstFiles:71 GlobalConstVars:13270 STDUDFIncludeFiles:82 STDUDFs:3178 USRUDFIncludeFiles:14 USRUDFs:369 Debugging:0-0-0 --> GetCFileUDFs time:0.11 lCache:0 IncludeFiles:3 UDFs:79 ConstVars:0 Debugging:0-0-0 C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3 --> GetCFileUDFs time:0.12 lCache:0 IncludeFiles:4 UDFs:192 ConstVars:39 Debugging:0-0-0 C:\Program Files (x86)\AutoIt3\SciTE\SciTE Jump\SciTE Jump.au3 to 93 extra include files and 1890 extra UDFs plus some 1500 extra Global Const variables: !-> Get_Std_UDFs time: 1.19 GlobalConstFiles:77 GlobalConstVars:14723 STDUDFIncludeFiles:82 STDUDFs:3178 USRUDFIncludeFiles:93 USRUDFs:1890 Debugging:0-0-0 --> GetCFileUDFs time:0.14 lCache:0 IncludeFiles:3 UDFs:79 ConstVars:0 Debugging:0-0-0 C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3 --> GetCFileUDFs time:0.15 lCache:0 IncludeFiles:4 UDFs:192 ConstVars:39 Debugging:0-0-0 C:\Program Files (x86)\AutoIt3\SciTE\SciTE Jump\SciTE Jump.au3 As you can see there was only a limited initial extra time required and this is without the cache files being build yet. Subsequent starts of SciTE will go faster as only the changed include files will be queried again: !-> Get_Std_UDFs time: 0.41 GlobalConstFiles:77 GlobalConstVars:14723 STDUDFIncludeFiles:82 STDUDFs:3178 USRUDFIncludeFiles:93 USRUDFs:1890 Debugging:0-0-0 --> GetCFileUDFs time:0.14 lCache:0 IncludeFiles:4 UDFs:192 ConstVars:39 Debugging:0-0-0 C:\Program Files (x86)\AutoIt3\SciTE\SciTE Jump\SciTE Jump.au3 Switching between files is going pretty fast for me on my 5 years old Laptop. It is also possible to enable caching for the File UDFs & Vars, but honestly think that won't be needed unless you have really many includes just in this project which aren't in the Standard set of Include files in the open.path properties. Still have made a list of changes and started to cleanup of the code as things were a bit to "Cut&Paste" all over the place. need another few days but am getting there.
    2 points
  2. Hi @kurtykurtyboy You are welcome Feedback always helps me know where to focus my efforts on a project So the most direct approach to your goal is not possible. AutoIt3 only accepts user functions with it's event functions. I tried setting a getter on the main object and giving the object itself as the second argument to GUICtrlSetOnEvent, to no avail. I did find a workaround though, let me know what you think #include "AutoItObject_Internal.au3" #include <GUIConstantsEx.au3> #include <WinAPISysWin.au3> Opt("GUIOnEventMode", 1) Global $hGUI = GUICreate("MyGUI", 400, 350, 763, 317) GUISetOnEvent($GUI_EVENT_CLOSE, "_onExitMain") Global $Button_1 = _objButton("Button 1", 140, 100, 91, 41) ;~ GUICtrlSetOnEvent($Button_1.hwnd, _button1ClickEvent) _main() Func _main() GUISetState(@SW_SHOWNORMAL) While 1 Sleep(100) WEnd EndFunc ;==>_main ;'traditional' event function Func _button1ClickEvent() $Button_1.click() EndFunc Func _onExitMain() $Button_1 = 0 GUIDelete() Exit EndFunc ;==>_onExitMain Func _objButton($sCaption, $iLeft, $iTop, $iWidth, $iHeight) Local $oIDispatch = IDispatch() $oIDispatch.caption = $sCaption $oIDispatch.hwnd = GUICtrlCreateButton($sCaption, $iLeft, $iTop, $iWidth, $iHeight) ConsoleWrite($oIDispatch.hwnd&@CRLF) ;$oIDispatch.__defineGetter("click", _objButton_click) GUICtrlSetOnEvent($oIDispatch.hwnd, _objButton_click2) _WinAPI_SetProp(GUICtrlGetHandle($oIDispatch.hwnd), "IDispatch", Ptr($oIDispatch)) Return $oIDispatch EndFunc ;event function built into the button object Func _objButton_click($oSelf) ConsoleWrite("Click Caption: " & $oSelf.parent.caption & @CRLF) EndFunc ;event function for the button object Func _objButton_click2() $pIDispatch = _WinAPI_GetProp(@GUI_CtrlHandle, "IDispatch"); Retrive IDispatch pointer If $pIDispatch = 0 Then Return; Pointer not available, return from function Local $oIDispatch = ObjCreateInterface($pIDispatch, $__AOI_IID_IDispatch, Default, True); Convert pointer back to object __AOI_AddRef($pIDispatch);When using ObjCreateInterface multiple times on the same ptr, AutoIt3 seems to not AddRef +1 (or it may be a bug in AutoItObject_Internal) ConsoleWrite("Click Caption: " & $oIDispatch.caption & @CRLF) EndFunc ;From https://www.autoitscript.com/forum/topic/207492-help-needed-image-viewer-with-zoom-and-translate/ Func _WinAPI_SetProp($hWnd, $sProp, $pData) Return DllCall("user32.dll", "bool", "SetPropW", "hwnd", $hWnd, "wstr", $sProp, "ptr", $pData)[0] EndFunc ;From https://www.autoitscript.com/forum/topic/207492-help-needed-image-viewer-with-zoom-and-translate/ Func _WinAPI_GetProp($hWnd, $sProp) Return DllCall("user32.dll", "ptr", "GetPropW", "hwnd", $hWnd, "wstr", $sProp)[0] EndFunc I did originally try to use _WinAPI_SetWindowLong with $GWL_USERDATA, but it seems AutoIt3 uses that itself 😡 edit: you COULD call $oIDispatch.click() within _objButton_click2, if you want custom functions associated with the click getter.
    1 point
  3. Sent on email. Hope you will find some spare time in next few days Michał
    1 point
  4. I notice that dynamic calltips contains duplicated backslashes
    1 point
  5. version: 4.0.0 changes Most notable changes: speed and readability. When testing speed i found a minimum increase in speed by ~20%
    1 point
×
×
  • Create New...