Jump to content

argumentum

MVPs
  • Posts

    5,709
  • Joined

  • Last visited

  • Days Won

    194

argumentum last won the day on February 25

argumentum had the most liked content!

7 Followers

About argumentum

Profile Information

  • Member Title
    ✨Universalist ✨
  • Location
    I'm in your browser now =)
  • WWW
    https://www.youtube.com/watch?v=SjwX-zMRxO0&t=5s
  • Interests
    Relax

Recent Profile Visitors

14,538 profile views

argumentum's Achievements

  1. The menu drop down in SampleControls-Dark.au3 does not show dark as it did. Beta tester #1
  2. ... found a way. I'll have the new version tomorrow
  3. ..and, it works beautify in the latest StrelecPE ( a WinPE boot DVD ) ( with the small caveat that right now, it'll find "Func" but not "Return" or "EndFunc" )
  4. Exit test1() Func test1() Local $sType, $iCount = 0, $hTimer = TimerInit() Local $aData = FileReadToArray("C:\xampp_v8.2.12\htdocs\AutoitHelpDark\AutoitHelpDark05\AutoitHelpDark2\hh_toc.htm"), $u1 = UBound($aData) -1 ConsoleWrite('--- ' & $iCount & @TAB &TimerDiff($hTimer) & @CRLF) $hTimer = TimerInit() For $n = 0 To $u1 If Not StringInStr($aData[$n], 'target="right"') Then ContinueLoop $iCount += 1 $sType = "+ " If StringInStr($aData[$n], "%20") Then $sType = "! " ConsoleWrite($sType & $iCount & @TAB & $aData[$n] & @CRLF) Next ConsoleWrite('--- ' & $iCount & @TAB &TimerDiff($hTimer) & @CRLF) EndFunc The way I searched for the "CurrentWord" is slow. Making a map with the about 4000 words, keep it in a file ( that it would build itself on 1st run ) will be faster than the current strategy I implemented.
  5. This is a next step. There are things that we need to figure out, like what to do with the SciTE help file, take it apart and make a dark-mode one, it or call from our script ? The script runs from the AutoIt installation folder and that will be better for now ( or always ) since the help related files are there to start with. Most of the files are in "\AutoIt3\AutoIt3HelpWeb_UDFs\". There are only 2 files in the AutoIt's default folder: The launcher ( AutoIt3HelpWeb.au3 ) and the "help file selector / swapper" ( AutoIt3HelpWeb_SwapHandler.au3 ), and that is the easiest way to look at it ( is all there ). The file "AutoIt3HelpWeb.au3" will need to be edited and have your HTM files path declared in "$sHtmlIndexPath" because been in development I have copies of the whole help file structure ... everywhere. Once is all said and done we may end up using a relative path to "\AutoIt3\Extras\" and not declare anything, but we're still coding. The "AutoIt3HelpWeb_SwapHandler.au3" is the easiest thing to run: click-click and you change from the original to the script and vice-versa. Ok, that wrap's it up for now. Give it a try and let's share our ideas. P.S.: the example files used are the same as in the CHM. P.S.S.: ... the scripts in the UDF folder are not standard, but am sure that by the time we're done with this, @WildByDesign will have the dark-mode and Hi-DPI UDFs ready. Will use those then. Any questions, problems or wishes, post them here. I have a wish of my own: The link used to select the help page is "ugly". I Rather make the left iFrame click and load the right iFrame AutoIt3HelpWeb(2026.02.27).zip Edit: forgot about "while..wend", "For ...", etc.
  6. 10,000 ( ten thousand ) because : GUI_MAXCONTROLS - 65532 - Maximum number of controls in GUI box. That way you're unlikely to use anybody else's ID. My 2 cents, I was just passing by
  7. This is the "AHWD_WebServer.au3" as far as today. You can use it to serve the pages modified as per my last post example and play with it. In the end, I'll do something to not need FAR for building the extra goodies it brings, because all that is really needed are the JS files, and even that I may look at and change as needed ( long after is all functional ).
  8. These are the changes in the HTM files that I did so far: that go from "<!-- <argumentum start> -->" to "<!-- <argumentum end> -->" so it will be simple for you to add to your HTM files. The server side makes AHWD_Server_check() work by changing "AHWD-Server" from "false" to "true". And that check is done so the HTM files can be loaded on any browser without creating any chaos or expectations of functions when not running from our server. When a ".au3" link, the server knows where the example files are at, and loads them in the editor. Sharing all this so that we work together. If I don't tell you what's coming, how are you gonna know As a byproduct of this, the "my examples executes without loading on the editor" complain, will be a thing of the past.
  9. The browser I came up with is simpler ( not finished yet ) ..because all these GUI buttons are not going to be needed as the HTM will have all that it needs to run the examples ( also not finished, but the code works ) And with the server side ( also not finished ) once done, the examples will open in the editor of your choosing without any annoyances. P.S.: The OCD got me working on this 😅
  10. Q: What is going to serve the pages of the help file ? A: Looking around and thinking, I came to the idea of coding an HTTP daemon with AutoIt's TCP functions, because those I found in the WiKi have dependencies, and I wanted to have this be able to work in WinPE too. And it needs a "server" to have the ability to interact with the pages in a portable way. The code above looks enough for what it'll be needed.
  11. ConsoleWriteOut(FileRead(@ScriptFullPath) & @CRLF) ConsoleWriteOut() Func ConsoleWriteOut($sStr = Default, $iErr = @error, $iExt = @extended) Local Static $hGUI = 0, $idEdit = 0, $iSciTE = StringInStr($CmdLineRaw, "/ErrorStdOut"), $hTimer = TimerInit() If $sStr = Null Then $hGUI = 1 If Not $iSciTE And $hGUI = 0 Then Local $iW = 800, $iH = 400 $hGUI = GUICreate(@ScriptName, $iW, $iH, -1, -1, 0x80CF0000) ; BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP)) GUISetFont(10, 400, 0, "Courier New") GUISetIcon(StringTrimRight(@ScriptFullPath, 4) & ".ico") $idEdit = GUICtrlCreateEdit("", 1, 1, $iW - 1, $iH - 1) GUICtrlSetResizing(-1, 0x0066) ; $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) GUISetState() GUICtrlSetData($idEdit, @CRLF) EndIf Local $iRet = "" If $sStr == Default And IsHWnd($hGUI) Then GUICtrlSetData($idEdit, @CRLF & "== DONE == ( " & Round(TimerDiff($hTimer), 4) & " ms. )", 1) Do Until GUIGetMsg() = -3 GUIDelete($hGUI) Exit Else If $sStr <> Default And $iSciTE Then $iRet = ConsoleWrite($sStr) If $idEdit Then GUICtrlSetData($idEdit, $sStr, 1) EndIf Return SetError($iErr, $iExt, $iRet) EndFunc ;==>ConsoleWriteOut I use the script above to have a "Console out / debug" that echo to console while in SciTE, but popup a window if not in SciTE ( click-click in explorer ). I never used the included function so I can not help with that, but that is not the only way to do it and "my custom debug" does what I need. And this is a random "debug code" I use because at times I come up with different ideas. If you need a solution that does one thing or another, just write it one.
  12. ... #Region LABEL Local $idGreenLabel = _HiDpi_GUICtrlCreateLabel("Green" & @CRLF & "Label", 350, 165, 40, 40) GUICtrlSetTip(-1, '#Region LABEL') GUICtrlSetBkColor(-1, 0x006600) ; make the green color darker for the darker theme... ;GUICtrlSetBkColor(-1, 0x77FF77) ; ( lighter for the light theme looks better too ) #EndRegion LABEL ... ;~ GUICtrlSetColor($idGreenLabel, 0x000000) ; ..that way the text will be readable ... Looking good
  13. Q: How do we press F1 in SciTE and have our script do the helping ? A: #cs ---------------------------------------------------------------------------- The script does not need to be compiled and I think that it shouldn't be just for clarity. But it all depends on what's faster. I haven't tested yet. That below is what PatchTheExtensionProperites() does for you: # Commands to for Help F1 # ..look for this in "\SciTE\Properties\au3.properties", and change the default to the script, that in this case is in the same folder as Autoit3Help.exe command.help.$(au3)=$(SciteDefaultHome)\..\Autoit3Help.exe "$(CurrentWord)" #~ command.help.$(au3)=$(SciteDefaultHome)\..\Autoit3_x64.exe ..\Autoit3HelpWeb.au3 "$(CurrentWord)" #~ command.help.$(au3)=$(SciteDefaultHome)\..\Autoit3HelpWeb.exe "$(CurrentWord)" #ce ---------------------------------------------------------------------------- #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #Region Patch au3.properties ;~ Exit PatchTheExtensionProperites(0) ; default ; restore to original help handler ;~ Exit PatchTheExtensionProperites(1) ; this script will be the help handler Func PatchTheExtensionProperites($iProperty = 0) ; This function is to add/restore the help handler Local $sPropertyFilename = @ScriptDir & "\SciTE\Properties\au3.properties" If Not FileGetSize($sPropertyFilename) Then Exit MsgBox($MB_TOPMOST, @ScriptName, "File is not there or script not here. Bye.", 120) EndIf Local $sData = "", $iInx_Original = 0, $n, $aArray = FileReadToArray($sPropertyFilename) ; find the original entry For $n = 0 To UBound($aArray) - 1 If StringInStr($aArray[$n], 'command.help.$(au3)=$(SciteDefaultHome)\..\Autoit3Help.exe') Then $iInx_Original = $n ; remove the comment "#" if there $aArray[$n] = StringTrimLeft($aArray[$n], StringInStr($aArray[$n], "command.help.") - 1) ExitLoop EndIf Next ; if not found then... now what ?. Exit this and let the user figure it out =( If Not $iInx_Original Then Return SetError(1, 0, 1) ; remove others For $n = UBound($aArray) - 1 To 0 Step -1 If StringInStr($aArray[$n], 'command.help.$(au3)=') And $iInx_Original <> $n Then _ArrayDelete($aArray, $n) EndIf Next ; lets work on what this code does: Switch $iProperty Case 0 ; do nothing, leave it default Case 1 ; lets comment out the original $aArray[$iInx_Original] = '#~ ' & $aArray[$iInx_Original] ; and a new line $aArray[$iInx_Original] &= @CRLF ; add our command If StringRight(@ScriptName, 4) = ".exe" Then $aArray[$iInx_Original] &= 'command.help.$(au3)=$(SciteDefaultHome)\..\' & @ScriptName & ' "$(CurrentWord)"' Else $aArray[$iInx_Original] &= 'command.help.$(au3)=$(SciteDefaultHome)\..\Autoit3_x64.exe ..\' & @ScriptName & ' "$(CurrentWord)"' EndIf Case Else Exit MsgBox($MB_TOPMOST, @ScriptName, "Read the code. Bye.", 120) EndSwitch ; testing to see if it looks good ConsoleWrite(@CRLF) For $n = $iInx_Original - 1 To $iInx_Original + 1 If $iInx_Original = $n Then ConsoleWrite('>>>') EndIf ConsoleWrite($aArray[$n] & @CRLF) Next ConsoleWrite(@CRLF) ; ..yes, it looks good. ; Lets reassemble the file: For $n = 0 To UBound($aArray) - 1 $sData &= $aArray[$n] & @CRLF Next $sData = StringTrimRight($sData, 2) ; 1st, a backup FileCopy($sPropertyFilename, $sPropertyFilename & "Backup", $FC_NOOVERWRITE) ; and now we replace the old with the updated one Local $hFileOpen = FileOpen($sPropertyFilename, (FileGetEncoding($sPropertyFilename, $FE_PARTIALFIRST_UTF8) + $FO_OVERWRITE)) If $hFileOpen = -1 Then Local $iRet = FileCopy($sPropertyFilename & "Backup", $sPropertyFilename, $FC_OVERWRITE) MsgBox($MB_SYSTEMMODAL, "", "An error occurred on FileOpen for this file. " & _ ($iRet ? "Backup restored" : "Backup fail to restore") & ". Bye.", 120) Return SetError(2, 0, 2) EndIf FileWrite($hFileOpen, $sData) FileClose($hFileOpen) EndFunc ;==>PatchTheExtensionProperites #EndRegion Patch au3.properties ; Script Start - Add your code below here ; TODO: everything MsgBox(262144, @ScriptName, $CmdLine[$CmdLine[0]], 120) Looks like a long answer but is quite short. At least this part of the project was simple Q: I run the function and something is wrong 🥵 A: Either close and open SciTE again or, load au3.properties in SciTE and save it. By just saving the file in SciTE, it'll know that it should reload the values from the file even if there is nothing different. Q: Can't you just tell SciTE to do the "reloadproperties" with code ?! A: Yes 😅 #Region taken from SciteConfig.au3 Reload_Config() Func Reload_Config() Opt("WinSearchChildren", 1) Local $SciTE_hwnd = WinGetHandle("DirectorExtension") ;Send SciTE Director my GUI handle so it will report info back from SciTE SendSciTE_Command(0, $SciTE_hwnd, "reloadproperties:") EndFunc ;==>Reload_Config Func SendSciTE_Command($My_Hwnd, $SciTE_hwnd, $sCmd) Local $WM_COPYDATA = 74 Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']') ;ConsoleWrite('-->' & $sCmd & @lf ) DllStructSetData($CmdStruct, 1, $sCmd) Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr') DllStructSetData($COPYDATA, 1, 1) DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1) DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct)) DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $SciTE_hwnd, _ 'Int', $WM_COPYDATA, 'HWnd', $My_Hwnd, _ 'Ptr', DllStructGetPtr($COPYDATA)) EndFunc ;==>SendSciTE_Command #EndRegion taken from SciteConfig.au3
  14. I have an 16k monitor ( in the future, maybe in 2035 ) and will this work with such ? ( never too early to future proof ? ) To be fair, science may discover a way to use the fascia to neuro connect with the brain and a chip no bigger than a grain of rice will be the device and the body will be the interface riding the need of a battery or screen from the device. So AutoIt may need a port to run on a NLPU ( neuro linear processing unit ( that will be the name )) and there is no way to futureproof that 🤪
×
×
  • Create New...