Leaderboard
Popular Content
Showing content with the highest reputation on 05/09/2025 in Posts
-
_StringToTable
WildByDesign and 3 others reacted to ioa747 for a topic
I agree with argumentum above, it's easier to do everything with double lines, than just the outline. Adding more frame types, requires more nested if, then , which has implications for all frame types. I'm thinking of removing frame =2 as well, right now it doesn't seem appealing to me, it will reduce both response time and readability of the script. as well However, the idea is not bad, and it's nice to get what you want. For this (and for the coding challenge) in the next version I will put a helper function that will do it. Which, (those reading) can have by now #include <Array.au3> #include <String.au3> _test() ;--------------------------------------------------------------------------------------- Func _test() Local $sTxt, $sOut Local $sData = _ "Company" & @TAB & "Contact" & @TAB & "Revenue" & @CRLF & _ "Alfreds Futterkiste" & @TAB & "Maria Anders" & @TAB & "1200" & @CRLF & _ "Centro Moctezuma" & @TAB & "Francisco Chang" & @TAB & "950" & @CRLF & _ "Island Trading" & @TAB & "Helen Bennett" & @TAB & "15800" $sOut = _DblFrame($sData, @TAB, "L,C,R") ConsoleWrite($sOut & @CRLF & @CRLF) EndFunc ;==>_test ;--------------------------------------------------------------------------------------- Func _DblFrame($vString, $sSeparator = @TAB, $sAlign = "") Local $sData = _StringToTable($vString, 3, $sSeparator, $sAlign) Local $aData = StringSplit($sData, @LF, 3) Local $iCnt = UBound($aData) -1 Local $sOut For $i = 0 To $iCnt Switch $i Case 0 $aData[$i] = StringReplace($aData[$i], "┌", "╔", 1, 2) $aData[$i] = StringReplace($aData[$i], "─", "═", 0, 2) $aData[$i] = StringReplace($aData[$i], "┬", "╤", 0, 2) $aData[$i] = StringReplace($aData[$i], "┐", "╗", -1, 2) Case 2 $aData[$i] = StringReplace($aData[$i], "├", "╟", 1, 2) $aData[$i] = StringReplace($aData[$i], "┤", "╢", -1, 2) Case $iCnt $aData[$i] = StringReplace($aData[$i], "└", "╚", 1, 2) $aData[$i] = StringReplace($aData[$i], "─", "═", 0, 2) $aData[$i] = StringReplace($aData[$i], "┴", "╧", 0, 2) $aData[$i] = StringReplace($aData[$i], "┘", "╝", -1, 2) Case Else $aData[$i] = StringReplace($aData[$i], "│", "║", 1, 2) $aData[$i] = StringReplace($aData[$i], "│", "║", -1, 2) EndSwitch $sOut &= $aData[$i] & @CRLF Next Return $sOut EndFunc ;==>_DblFrame4 points -
Listview replacing, coloring, doubleclick
argumentum and one other reacted to pixelsearch for a topic
Ok, I'll finally post something in this thread, though we had a solution for 2 days ("we" = me and a helpful tester via PM, for confirmation on a different OS) But the sentence "Back to your issue, I will not give you the answer." refrained us for posting anything, to avoid creating new tensions. Just have a look at this post above, then 1) Change this line... For $i = 1 To 10 ...to For $i = 1 To 500 Now the script throws the error you reported : $tCustDraw.clrTextBk = ($mColor[$tCustDraw.IDFrom])[$iItem][$iSubItem] ? ($mColor[$tCustDraw.IDFrom])[$iItem][$iSubItem] : 0xFFFFFF $tCustDraw.clrTextBk = ($mColor[$tCustDraw.IDFrom])^ ERROR 2) Then move this block of 3 lines... GUIRegisterMsg($WM_NOTIFY, WM_NOTIFY) GUIRegisterMsg($WM_LBUTTONUP, WM_LBUTTONUP) GUISetState() ...and place it just before While True : GUIRegisterMsg($WM_NOTIFY, WM_NOTIFY) GUIRegisterMsg($WM_LBUTTONUP, WM_LBUTTONUP) GUISetState() While True ...now everything should work fine. It seems that after a few hundreds of list items added, then WM_NOTIFY is always triggered (the listview needs to be redrawn). So if you place the block of 3 lines too early, then the script will crash because the array $aColor is not defined (when map is encountered within the WM_NOTIFY function) Moving the 3 lines just before the main loop should fix it. Please tell us if this solution works for you.2 points -
_StringToTable
Musashi and one other reacted to SOLVE-SMART for a topic
First of all and to clarify: I don't see this as a competition - just in case you folks would think of this regarding @ioa747 and me 😆 . I agree. I guess extending the border styles (frame types) is just a gimmick. Nevertheless, I played a bit with my version of DataToTable.au3 which lead to v0.2.0. In the README.md section output-result you can see a fourth border style "4=BorderAndHeaderEdgesWithAccent" as a example. In the CHANGELOG.md you will find how I changed it. To achieve the styling above (shared by @argumentum) it would lead to some more code adjustments, but at the moment I don't have the desire to implement it - sorry @WildByDesign 😅 . Best regards Sven2 points -
Win 11 - My own border color ( Help area )
argumentum reacted to WildByDesign for a topic
Those are all great points. And you are right, if Microsoft already has that implemented than there is no purpose to spend more time coding it.1 point -
_StringToTable
WildByDesign reacted to SOLVE-SMART for a topic
Hi folks 👋 , I spend a bit freetime and created version v0.3.0 of data-to-table.au3 UDF. 8 different border styles a flexible way of adding more border styles (tiny how-to follows in the next days (I hope)) what has changed ==> CHANGELOG how it looks ==> output-result Once again, kudos to @ioa747 for his idea and main logic behind it. I changed your version drastically, but you approach is still in my coding heart 🤭 . 💡 For now, I am temporary done with this library, until I will have more time for this. If you guys find BUGs or do have suggestions, I really appreciate your feedback - thanks 🤝 . Btw. @WildByDesign, your style request from @argumentums post here, is border style variant 8 "double-outter-border-and-header-with-single-inner-border" 😀 . ╔════════════╤════════════════╤═════════════════╤═════════════════════════════════════════╗ ║ Language │ Popularity (%) │ Job Demand │ Typical Use ║ ╟────────────┼────────────────┼─────────────────┼─────────────────────────────────────────╢ ║ JavaScript │ 62.3 │ Very High │ Web Development, Frontend/Backend ║ ║ C# │ 27.1 │ High │ Game Development, Windows Apps, Web Dev ║ ║ Go │ 13.8 │ Growing │ Cloud Services, System Programming ║ ║ PowerShell │ 13.5 │ Low to Moderate │ Task Automation, DevOps, System Admin ║ ║ AutoIt │ 0.5 │ Low │ Windows GUI Automation, Scripting ║ ╚════════════╧════════════════╧═════════════════╧═════════════════════════════════════════╝ If you like the UDF, consider to star the project on GitHub, thanks. Best regards Sven1 point -
Win 11 - My own border color ( Help area )
WildByDesign reacted to argumentum for a topic
That is baked in Windows 11. No need to code for that. This is when you'd like every window to have a well defined border on every window, that in my case is because my eyesight sucks. hmm, this is not a fix for ADHD c'mon !, if the user don't know what window/app he/she is working on, is time to take a break I have 2 big monitors and seeing the borders ( in dark mode ) is a blessing compared with many windows only defined by the X at the end of the caption bar. Again, all this in dark mode, because in light mode what you claim is understandable. PS: For those out in the open, under the sun or well lit office, dark mode would be a pain to see anything in. Dark mode is in my view when the ambient lighting is not that bright and you spend all day looking at it. Then again, we ( humans ) are all mutants/mutations ( because that is what "male-female" reproduction does ( I should say that that is the reason for sex )), and that make us so different, that we can agree to call a color the same name, but not that we see the same or are affected in the same way hence, coloring is very personal. There is not a one-fit-all coloring scheme. Expand/open the "hidden contents" in this post and you'll get a feeling on how every coloring scheme hits you. If none of these "hit you", then your eyesight is enviable1 point -
_StringToTable
ioa747 reacted to WildByDesign for a topic
I've tested your _DblFrame function this morning and it works great and looks really nice.1 point -
Listview replacing, coloring, doubleclick
pixelsearch reacted to albertmaathuis for a topic
Thank you very much, it works. I have put the version I will continue with in my project below. #include <GUIConstants.au3> #include <GuiListView.au3> #include <WinAPISysWin.au3> Opt("MustDeclareVars", True) Global $mColor[], $bDragging, $tDragItem = DllStructCreate($tagNMHDR) Example() Func Example() Local $MainGui = GUICreate("Colored ListView", 1700, 800) local $idListview_secties[24]; local $left $left =5 for $i_listview_number= 0 to 23 $idListview_secties[$i_listview_number] = GUICtrlCreateListView("Number|Number", $left, 30, 60, 480) _GUICtrlListView_SetColumnWidth($idListview_secties[$i_listview_number], 0, 50) _GUICtrlListView_SetColumnWidth($idListview_secties[$i_listview_number], 1, 1000) $left=$left+65 next Local $idButton = GUICtrlCreateButton("Change", 5, 550, 100, 20) global $idLV_start=0 For $i_listview_number = 2 To 25; for $i_positie=0 to 29 GUICtrlCreateListViewItem($i_positie & '|' & "y" , $idListview_secties[$idLV_start]) next Local $aColor[ControlListView($MainGui, "", $idListview_secties[$idLV_start], "GetItemCount")][ControlListView($MainGui, "", $idListview_secties[$idLV_start], "GetSubItemCount")] $aColor[0][0] = 0xFFFF00; $aColor[29][0] = 0xFFFF00; $mColor[$idListview_secties[$idLV_start]] = $aColor $idLV_start=$idLV_start+1 Next GUIRegisterMsg($WM_NOTIFY, WM_NOTIFY) GUIRegisterMsg($WM_LBUTTONUP, WM_LBUTTONUP) GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $idButton $aColor = $mColor[$idListview_secties[1]] $aColor[5][0] = 0xFF $mColor[$idListview_secties[1]] = $aColor _WinAPI_RedrawWindow(GUICtrlGetHandle($idListview_secties[1])) $aColor = $mColor[$idListview_secties[2]] $aColor[6][0] = 0xFF $mColor[$idListview_secties[2]] = $aColor _WinAPI_RedrawWindow(GUICtrlGetHandle($idListview_secties[2])) EndSwitch WEnd EndFunc ;==>Example Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) If _WinAPI_GetClassName($tNMHDR.hWndFrom) <> "SysListView32" Then Return $GUI_RUNDEFMSG Switch $tNMHDR.Code Case $NM_CUSTOMDRAW Local $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) Local $iDrawStage = $tCustDraw.dwDrawStage If $iDrawStage = $CDDS_PREPAINT Then Return $CDRF_NOTIFYITEMDRAW If $iDrawStage = $CDDS_ITEMPREPAINT Then Return $CDRF_NOTIFYSUBITEMDRAW ; Paint item and subitem Local $iSubItem = $tCustDraw.iSubItem Local $iItem = $tCustDraw.dwItemSpec If ControlListView($hWnd, "", $tNMHDR.hWndFrom, "IsSelected", $iItem) Then Return $CDRF_DODEFAULT $tCustDraw.clrTextBk = ($mColor[$tCustDraw.IDFrom])[$iItem][$iSubItem] ? ($mColor[$tCustDraw.IDFrom])[$iItem][$iSubItem] : 0xFFFFFF Return $CDRF_NEWFONT Case $NM_DBLCLK Local $tItem = DllStructCreate($tagNMITEMACTIVATE, $lParam) ConsoleWrite("Double click for ListView : " & $tItem.IDFrom & " on item : " & $tItem.Index & " on subitem : " & $tItem.SubItem & @CRLF) Case $LVN_BEGINDRAG Local $tDrag = DllStructCreate($tagNMLISTVIEW, $lParam) $tDragItem.hWndFrom = $tDrag.hWndFrom $tDragItem.IDFrom = $tDrag.IDFrom $tDragItem.Code = $tDrag.Item $bDragging = True EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func WM_LBUTTONUP($hWnd, $iMsg, $wParam, $lParam) If Not $bDragging Then Return $GUI_RUNDEFMSG $bDragging = False Local $tPoint = _WinAPI_GetMousePos() Local $hPoint = _WinAPI_WindowFromPoint($tPoint) If Not $hPoint Then Return $GUI_RUNDEFMSG If _WinAPI_GetClassName($hPoint) <> "SysListView32" Then Return $GUI_RUNDEFMSG If $hPoint = $tDragItem.hWndFrom Then Return $GUI_RUNDEFMSG Local $aColorSrc = $mColor[$tDragItem.IDFrom] Local $idDest = _WinAPI_GetDlgCtrlID($hPoint) Local $aColorDest = $mColor[$idDest] If UBound($aColorSrc, 2) <> UBound($aColorDest, 2) Then Return $GUI_RUNDEFMSG _GUICtrlListView_CopyItems($tDragItem.hWndFrom, $hPoint, True) Local $nDest = UBound($aColorDest) + 1 ReDim $aColorDest[$nDest][UBound($aColorDest, 2)] For $i = 0 To UBound($aColorSrc, 2) - 1 $aColorDest[$nDest - 1][$i] = $aColorSrc[$tDragItem.Code][$i] Next _ArrayDelete($aColorSrc, $tDragItem.Code) $mColor[$tDragItem.IDFrom] = $aColorSrc $mColor[$idDest] = $aColorDest Return $GUI_RUNDEFMSG EndFunc ;==>WM_LBUTTONUP1 point -
I'm closing this topic as I have found a solution. Basically, in the app I'm flipping between my regular domain, and the global domain, and the flipping action was not properly setting things up in the initial go-from-regular-to-global-domain action. This was causing the AD query to fail. Thanks to everyone who may have already looked at this issue, and I'm now sorry that I brought this up. Bob1 point
-
_StringToTable
Musashi reacted to argumentum for a topic
╔══════════════════════╦══════════╦════════╦══════════╦═══════════╦════════╦═════════╦════════╗ ║ name ║ time[ms] ║ factor ║ Std. Dev ║ Std. Err. ║ min ║ max ║ range ║ ╠══════════════════════╬══════════╬════════╬══════════╬═══════════╬════════╬═════════╬════════╣ ║ StringRegExp only ║ 1.691 ║ 1.00 ║ 0.351 ║ 0.035 ║ 1.304 ║ 3.167 ║ 1.863 ║ ║ jq UDF ║ 32.933 ║ 19.48 ║ 2.929 ║ 0.293 ║ 29.308 ║ 43.169 ║ 13.861 ║ ║ JsonC-UDF ║ 51.086 ║ 30.21 ║ 3.205 ║ 0.321 ║ 45.625 ║ 63.460 ║ 17.835 ║ ║ pure AutoIt JSON-UDF ║ 97.916 ║ 57.90 ║ 5.685 ║ 0.569 ║ 86.362 ║ 113.467 ║ 27.105 ║ ║ JSMN-based JSON-UDF ║ 108.248 ║ 64.01 ║ 5.512 ║ 0.551 ║ 99.029 ║ 130.864 ║ 31.835 ║ ╚══════════════════════╩══════════╩════════╩══════════╩═══════════╩════════╩═════════╩════════╝ ... ... Local Const $TL = "╔", $TR = "╗", $BL = "╚", $BR = "╝" Local Const $H = "═", $V = "║", $C = "╬" Local Const $TH = "╦", $CH = "╩", $LH = "╠", $RH = "╣" ... ...1 point -
_StringToTable
Musashi reacted to WildByDesign for a topic
My initial thought with this was to make some elegant and beautiful MsgBox's, particularly About dialogs, etc. But I realized that the output from _stringtotable simply wasn't lining up properly in a MsgBox. So I decided try it with the ExtMsgBox UDF since it has more customizing options. That also came up all scrambled. Until... I realized that I would need to use a monospaced font like in other projects. Cascadia Mono didn't look as nice. So I did Consolas and it looked great. Basically, the following code was added: #include "ExtMsgBox.au3" _ExtMsgBoxSet(1, 4, 0x202020, 0xe0e0e0, -1, "Consolas", 1200, 1200) _ExtMsgBox (0, 0, "_ExtMsgBox", $sOut) The _ExtMsgBox (0, 0, "_ExtMsgBox", $sOut) just needed to be adapted into the right area of examples, of course. Screenshots: So this opens up some nice possibilities for my usage of it. Thanks again for sharing this. Also, @SOLVE-SMART I am going to follow your progress on this as well.1 point -
is this close to the difference you are seeing? #include <APIGdiConstants.au3> #include <Array.au3> #include <FontConstants.au3> #include <WinAPIGdi.au3> Local $aData = _WinAPI_EnumFontFamilies(0, '', $OEM_CHARSET, $TRUETYPE_FONTTYPE , '@*' , 1) If Not @error Then _ArrayDisplay($aData, '_WinAPI_EnumFontFamilies' , "|1") EndIf Local $aData = _WinAPI_EnumFontFamilies(0, '', Default, BitOR($DEVICE_FONTTYPE, $TRUETYPE_FONTTYPE), '@*' , 1) If Not @error Then _ArrayDisplay($aData, '_WinAPI_EnumFontFamilies' , "|1") EndIf1 point