LarsJ Posted September 11, 2015 Share Posted September 11, 2015 (edited) With the $hUser_Function parameter you can show two _ArrayDisplay windows side by side. How do you make a proper header in the _ArrayDisplay list view to the right? The entire header is shown in "Col 0". How do you transfer the header parameter in the proper way through the user function?I'm running the code directly in SciTE.#include <Array.au3> ; _ArrayDisplay( $aArray, "ArrayDisplay", "", 0, Default, $sHeader = "", Default, Default, $hUser_Function = 0 ) Global $aArray = [ [ "0/0", "0/1", "0/2", "0/3", "0/4" ], _ [ "1/0", "1/1", "1/2", "1/3", "1/4" ], _ [ "2/0", "2/1", "2/2", "2/3", "2/4" ], _ [ "3/0", "3/1", "3/2", "3/3", "3/4" ], _ [ "4/0", "4/1", "4/2", "4/3", "4/4" ], _ [ "5/0", "5/1", "5/2", "5/3", "5/4" ], _ [ "6/0", "6/1", "6/2", "6/3", "6/4" ], _ [ "7/0", "7/1", "7/2", "7/3", "7/4" ], _ [ "8/0", "8/1", "8/2", "8/3", "8/4" ], _ [ "9/0", "9/1", "9/2", "9/3", "9/4" ] ] _ArrayDisplay( $aArray, "Click ""Run User Func""", "", 0, Default, "A/0|B/1|C/2|D/3|E/4", Default, Default, UserFunc ) Func UserFunc( $p1, $p2 ) Local $hWnd = WinGetHandle( "Click ""Run User Func""" ) Local $aPos = WinGetPos( $hWnd ) WinMove( $hWnd, "", $aPos[0]-400, $aPos[1] ) _ArrayDisplay( $aArray, "ArrayDisplay right window (header?)", "", 0, Default, "A/0|B/1|C/2|D/3|E/4" ) WinClose( $hWnd ) EndFuncI hope there is someone who can give me the answer before I get to spend the entire weekend on this annoying problem.Regards Lars. Edited September 11, 2015 by LarsJ window --> list view Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
KaFu Posted September 11, 2015 Share Posted September 11, 2015 How about this?_ArrayDisplay( $aArray, "ArrayDisplay right window (header?)", "", 0, "", "A/0|B/1|C/2|D/3|E/4" ) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
LarsJ Posted September 11, 2015 Author Share Posted September 11, 2015 It doesn't work for me in 3.3.10. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
BrewManNH Posted September 11, 2015 Share Posted September 11, 2015 The problem is in the _ArrayDisplay function. When you use "" or Default, the default DataSeparatorChar is reset to "?" instead of "|". When the function ends, it resets it back to "|", but because you're using _ArrayDisplay inside the user function, it jumps out of the function before it's reset back, so the separator character is set to "?" and your _ArrayDisplay doesn't separate the column headers correctly. Even when you specify the separator character, the stringsplit function inside the _ArrayDisplay function is still using "?" as the separator. LarsJ 1 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
iamtheky Posted September 11, 2015 Share Posted September 11, 2015 (edited) so just drop the opt in the func? and $aArray in the func should be $p1, right?Func UserFunc($p1, $p2) Opt("GUIDataSeparatorChar", "|") Local $hWnd = WinGetHandle( "Click ""Run User Func""" ) Local $aPos = WinGetPos( $hWnd ) WinMove( $hWnd, "", $aPos[0]-400, $aPos[1] ) _ArrayDisplay($p1, "ArrayDisplay right window (header?)", "", 0, Default, "A/0|B/1|C/2|D/3|E/4" ) WinClose( $hWnd ) EndFunc Edited September 11, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
LarsJ Posted September 11, 2015 Author Share Posted September 11, 2015 KingBob, Thank you. You are completely right. A solution is to change this line in _ArrayDisplay function:;Local $sAD_Separator = ChrW(0xFAB1) Local $sAD_Separator = "|" Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
jchd Posted September 11, 2015 Share Posted September 11, 2015 Honestly I wonder how that CJK compatibility character found its way as a delimiter. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
BrewManNH Posted September 11, 2015 Share Posted September 11, 2015 (edited) CJK?Never mind, I looked it up. I hadn't realized that it wasn't actually "?" being used, because my SciTE console window wasn't set to display non-ASCII. Edited September 11, 2015 by KingBob If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
jchd Posted September 11, 2015 Share Posted September 11, 2015 Ha, sorry for being cryptic. I just looked up my Unicode SQL table to check that my guess was right. This poor 0xFBA1 character has no use here, there exist a much more sensible ASCII and ANSI and Unicode codepoint well suited for that purpose: unit separator 0x1F even if its primary use was for punched card devices...Anyway, not resetting the changed separator before invokation of the callback was indeed the culprit. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 12, 2015 Moderators Share Posted September 12, 2015 (edited) jchd,Honestly I wonder how that CJK compatibility character found its way as a delimiterBecause you suggested it! We needed to make sure that you could display whatever character was selected as the current delimiter if it occurred inside the array being displayed, so the actual delimiter needed to be set to something unlikely to be used and you proposed a "user-defined Unicode character" -the specific choice of "0xFAB1" was a personal joke that met the requirements you set.If you now feel that "0x1F" is more suitable, I will change the UDF accordingly.M23Edit: It was discussed in this and subsequent posts. Edited September 12, 2015 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jchd Posted September 12, 2015 Share Posted September 12, 2015 Sorry, memory didn't serve when previously mentionned 0xFBA1 (ARABIC LETTER RNOON FINAL FORM) instead of 0xFAB1 (CJK COMPATIBILITY IDEOGRAPH-FAB1).Anyway, the private use area in the BMP (basic multilingual plane, the only range we can use since AutoIt use UCS-2 limited to 0x0000..0xFFFF) is 0xE000..0xF8FF.If I indeed suggested 0xFAB1 then it must be because I was out of myself at that time, I plead guilty for that and beg all the pardon I can get, if any. (I've since stopped mayonnaise injections.) Note that it's still pretty unlikely that anyone would be seriously affected after all.What can be inconvenient about a control character like 0x1E (RECORD SEPARATOR) or 0x1F (UNIT SEPARATOR) is that it may not be visible if misused:MsgBox(0, "", "abc" & Chr(0x1F) & "def" & ChrW(0xEDDA) & "ghi") This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
JohnOne Posted September 12, 2015 Share Posted September 12, 2015 because my SciTE console window wasn't set to display non-ASCII.Anyone remember how do you set it to do this? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jchd Posted September 12, 2015 Share Posted September 12, 2015 I don't remember which line works, but put both in user properties:code.page=65001 output.code.page=65001 JohnOne 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
LarsJ Posted September 12, 2015 Author Share Posted September 12, 2015 (edited) Melba23, If you are going to update the code, you should reset the original separator character before the user function is called, and set it again when the user function returns. This would solve the issue in first post.This has the advantage that when the code in the user function is being executed, it's executed in the user's original AutoIt environment. And not with a special separator character which the user is not aware of.Lars. Edited September 12, 2015 by LarsJ Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 12, 2015 Moderators Share Posted September 12, 2015 LarsJ,I was already intending to do just that.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
LarsJ Posted September 12, 2015 Author Share Posted September 12, 2015 Thank you. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now