LarsJ Posted September 27, 2015 Share Posted September 27, 2015 (edited) Obsolete. Use Data display functions based on virtual listviews. I'm working on some code related to virtual ListViews. In this regard, I need to be able to show the contents of large arrays with the same ease as _ArrayDisplay can show the contents of smaller arrays. The arrays have to be shown as fast as possible. _ArrayDisplayEx is the answer. The most fundamental difference between _ArrayDisplayEx based on a virtual ListView and the official version of _ArrayDisplay is, that a virtual ListView is depending on WM_NOTIFY messages and needs a function to handle these messages. Advantages and disadvantages of _ArrayDisplayEx: Advantages No limitation on the number of rows as the ListView can display. The array itself is the limitation. The ListView shows up immediately. Because a virtual ListView is fed with data directly from the array, no time is spent on inserting rows in the ListView. Disadvantages _ArrayDisplayEx is depending on WM_NOTIFY message handlers registered with GUIRegisterMsg. Because you can't use two different WM_NOTIFY message handlers registered with GUIRegisterMsg at the same time, this makes it difficult to use a WM_NOTIFY message handler in your own code. This also makes it impossible to display two _ArrayDisplayEx windows side by side at the same time. Significantly more work is carried out by _ArrayDisplayEx than _ArrayDisplay. _ArrayDisplayEx must constantly feed the ListView with data for example when you scroll up or down. This is done in the WM_NOTIFY message handlers. Column widths are calculated based on the rows at the first page in the list view. This will not necessarily lead to correct column widths for all rows. Don't use _ArrayDisplayEx if the array contains less than 10,000 rows. The GUI Most of the GUI code is copied directly from the official version of _ArrayDisplay. Credit goes to ; #FUNCTION# =================================================================== ; Author ........: randallc, Ultima ; Modified.......: Gary Frost (gafrost), Ultima, Zedna, jpm, Melba23, AZJIO, UEZ ; ============================================================================== and especially Melba23, who has done most of the coding in the recent versions of the function. Changes compared to _ArrayDisplay (3.3.14) Changes in functionality and changes for parameters in function definition. A new "Goto row" control is added to the left of "Copy" buttons. If there are many rows in the array, it can be difficult to navigate to a specific row with the scroll bar. It's much easier to enter the row number. The dimensions label below the ListView that shows array dimensions is always shown. If a user function is specified the "Run User Func" button is always shown whether "Goto row" control or "Copy" buttons are shown or not. "Run User Func" button appears to the right of the dimensions label. $iFlags parameter (new/modified in bold): 0 = Left aligned text (default) 1 = Transposes the array 2 = Right aligned text 4 = Centered text 8 = Verbose: MsgBox on error, splash screen on lengthy commands 16 = No "Copy" buttons displayed (page 2 in Examples.au3) 32 = No "Exit Script" button displayed (page 2 in Examples.au3) 64 = No "Goto row" control displayed (page 2 in Examples.au3) 128 = No "Row" column displayed in ListView (header / page 5) 256 = Pass array and selection to user function (page 2) 512 = Show types of special data (page 3) 1024 = Half-height ListView (page 5) Flag values to hide controls and "Row" column. The meaning of the values 16, 32 and 64 is changed compared to the official version. 128 is a new value. When I specify a user function, it's rare that I need the array and selection. The default in _ArrayDisplayEx is not to pass array and selection to user function. If the array contains 100,000 rows the calculation of selected rows takes time. Set $iFlags = 256 to pass array and selection to user function. When array and selection is passed to user function ($iFlags = 256), "Run User Func" button works in the same way as "Copy" buttons according to the selection. If no rows are selected, all rows are passed to the user function. Else selected rows are passed to the function. If only rows 5 - 17 are visible in the ListView ($sArrayRange = "5:17"), you might only want to execute the user function for rows 5 - 17. For this purpose _ArrayDisplayEx settings can be passed to user function. Call _ArrayDisplayEx_LocalStorage (see below) to get the settings. Set $iFlags = 512 to show types of special data. Special data includes arrays, functions, objects and structures (DllStructCreate). When the flag is set, the corresponding cells in the ListView are shown with the following text strings: {Array}, {Function}, {Object} and {Struct}. Without this flag data is shown as empty cells. The flag is not set as default. For large arrays the control of special data types is time consuming. Because a lot of work is carried out in WM_NOTIFY functions to feed the ListView with data, you can set $iFlags = 1024 to use a half-height ListView. Then the ListView only have to be fed with half as many data. When you drag the scrollbar with the mouse, it's easier for the scrollbar to follow the mouse. A new parameter $hWM_NOTIFY_Function = 0 is added as the last parameter. Because _ArrayDisplayEx is based on a virtual ListView it's depending on WM_NOTIFY messages and functions. If you are using a WM_NOTIFY function in your own script, you can use the $hWM_NOTIFY_Function parameter to restore your function when the code returns from _ArrayDisplayEx. See page 4 in Examples.au3. Optimized for speed In this version the code is optimized for speed and nothing else. This means that as many control statements as possible are calculated before the repetitive and fast call of WM_NOTIFY functions in response to LVN_GETDISPINFO notifications to feed the ListView with data. The disadvantage is, that there is a fairly large number of WM_NOTIFY functions. The reason for the size of the script. Avoiding global variables To avoid globals a function _ArrayDisplayEx_LocalStorage and static locals are used to transfer information from _ArrayDisplayEx to WM_NOTIFY functions. _ArrayDisplayEx_LocalStorage can be called e.g. in a user function to get the same information. See page 2 in Examples.au3. Because of this usage of _ArrayDisplayEx_LocalStorage the keywords Const and ByRef can't be used in definition of _ArrayDisplayEx. Since _ArrayDisplayEx does not change the array this is not a problem. On the other hand it means that you can call the function in this way: _ArrayDisplayEx( StringSplit( "string", "delimiters" ) ) Examples Examples.au3 contains a bunch of small examples: Page 1 demonstrates the usage of the $sArrayRange parameter Page 2 shows the changes in relation to controls and user function Page 3 demonstrates how to show types of special data Page 4 shows how to restore a WM_NOTIFY function Page 5 is a summary of parameters and flags For the examples at page 1 (only page 1) you can click the "Run User Func" button to compare with the official version. To avoid influence of the WM_NOTIFY function (which would decrease performance significantly) _ArrayDisplay is executed in it's own process. The array is transferred to the new process through an object registered with AutoItObject (you can find a step-by-step demonstration of the technique here, and you can find a description in the AutoItObject thread). Run this code to test _ArrayDisplayEx with a large array: #include "ArrayDisplayEx.au3" ; One million rows, ten columns Global $iRows = 1000000, $iCols = 10 Global $aArray[$iRows][$iCols] ; This takes some seconds ; It'll use some memory For $i = 0 To $iRows - 1 For $j = 0 To $iCols - 1 $aArray[$i][$j] = $i & "/" & $j Next Next ConsoleWrite( "Array done ..." & @CRLF ) _ArrayDisplayEx( $aArray, "", "", 16, "", "", Default, 0xCCFFFF ) ; 16 => remove "Copy" buttons ; 0xCCFFFF => alternating row color Notice the "Array done ..." message in the console. The delay from the message shows up till you see the rows in the ListView, is the time it takes to create the GUI. Zip The zip contains four files: ArrayDisplayEx.au3 - contains the _ArrayDisplayEx UDF Examples.au3 - a bunch of small examples spread over five pages Examples\AutoItObject.au3 by the AutoItObject team - used in examples at page 1 Examples\Original.au3 - used in examples at page 1 You need AutoIt 3.3.10 or later. Tested on Windows 7 64 bit and Windows XP 32 bit. Comments are welcome. Let me know if there are any issues. Updated zip at bottom of post #4. Edited October 7, 2017 by LarsJ Obsolete Danyfirex and KaFu 2 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...
LarsJ Posted December 19, 2016 Author Share Posted December 19, 2016 (edited) Since this example is so popular, I've decided to make an update. And the UDF is needed in Accessing AutoIt Variables. There are two significant improvements in this update: Message handlers based on GUIRegisterMsg are replaced with message handlers based on subclassing. Instances of the array stored as local static variables are properly deleted. GUIRegisterMsg GUIRegisterMsg is an easy way to create a handler function for a Windows message eg. the WM_NOTIFY message. However, there are also some disadvantages associated with the use of GUIRegisterMsg. With GUIRegisterMsg you can create only one handler function for a specific Windows message. If a WM_NOTIFY message handler is used in a UDF, it's difficult to use a WM_NOTIFY message handler in your own code. A message handler registered with GUIRegisterMsg is a global message handler. In a GUI with two listviews where a WM_NOTIFY message handler is implemented for the first listview, but the message handler is not needed for the second listview, the message handler function will still be called for every WM_NOTIFY message from the second listview. And this cannot be prevented. If there are many rows in the second listview, this can be a serious performance issue. In the examples on page 1 (Examples.au3 in zip in bottom of first post) you can click the "Run User Func" button to compare with the official version of _ArrayDisplay. Several workarounds are needed to prevent the global WM_NOTIFY message handlers in _ArrayDisplayEx to be called for every single row in _ArrayDisplay (which would reduce the performance of _ArrayDisplay significantly). First, _ArrayDisplay is executed in its own process. Secondly, the array is passed to _ArrayDisplay by means of functionality of AutoItObject.au3 (necessary because _ArrayDisplay runs in its own process). In order to eliminate the drawbacks of WM_NOTIFY message handlers registered with GUIRegisterMsg the message handlers are implemented through subclassing. Subclassing Subclassing is implemented with the four functions SetWindowSubclass, GetWindowSubclass, RemoveWindowSubclass and DefSubclassProc (coded in WinAPIShellEx.au3). Note that subclassing implemented with these four functions is not comparable with subclassing implemented through _WinAPI_SetWindowLong. Subclassing with the four functions is easy and error-free. Subclassing with _WinAPI_SetWindowLong is simply not working properly. If you're very careful it's possible to implement subclassing through _WinAPI_SetWindowLong in simple situations. Message handlers based on subclassing can be created for a single control or window at a time. If you need to subclass several controls or windows you can use different message handlers and avoid messages being mixed together (separation of the messages takes place in ComCtl32.dll where the four functions are coded). You can find more information about subclassing in Colors and fonts in custom drawn ListViews. Replacing message handlers based on GUIRegisterMsg with message handlers based on subclassing is very simple as you can see by comparing the code in the new and the old zip. Subclassing eliminates the first three disadvantages mentioned in the list in top of first post. Static variables To avoid using a global variable the array is passed to the WM_NOTIFY message handler as a local static variable. Because it's a static variable it must be deleted when it's not needed any more. That is when _ArrayDisplayEx is closed. I forgot to delete the local static array in the first version, but I've done it in this version. ExamplesExamples0.au3 in the new zip is the same as Examples.au3 in the old zip, but page 4 in the old examples about the WM_NOTIFY message handler is omitted. And all the workarounds in the old zip needed to compare the examples on page 1 with the official version of _ArrayDisplay are omitted too. Because message handling in the new UDF is based on subclassing the workarounds are not needed. AutoItObject.au3 is not included in the new zip. Examples1.au3 shows that you can feed _ArrayDisplayEx directly with an array returned by a function. Examples2.au3 shows that it's possible to display two _ArrayDisplayEx windows side by side at the same time if you click the "Run User Func" button. Examples3.au3 - Examples5.au3 are examples with large arrays with 16,000,000 elements and 1, 4, and 16 columns, respectively. Examples3.au3 also demonstrates that even if the local static versions of the array are deleted when _ArrayDisplayEx is closed, the original array is not deleted. This is demonstrated by showing the array once more. New zip You need AutoIt 3.3.10 or later. Tested on Windows 10/7 32/64 bit and Windows XP 32 bit. Comments are welcome. Let me know if there are any issues. Updated zip at bottom of post #4. Edited March 2, 2017 by LarsJ Updated zip argumentum 1 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...
LarsJ Posted December 21, 2016 Author Share Posted December 21, 2016 In the update monday WM_NOTIFY message handlers are implemented through subclassing. If you click "Run User Func" button in Examples2.au3 two _ArrayDisplayEx windows are displayed at the same time and two WM_NOTIFY message handlers are running at the same time through two subclasses. If you click "Exit Script" button in the window opened with "Run User Func" button, it's important that both subclasses are properly removed before the entire script exits. I forgot to do that in the monday update, and that's the reason for this new update. To remove the subclasses two variables are needed for each subclass: $hGUI and $pNotifyFunc. Then a subclass can be removed in this way: _ArrayDisplayEx_RemoveWindowSubclass( $hGUI, $pNotifyFunc, 1000 ) I can store all occurrences of $hGUI and $pNotifyFunc as local static variables in _ArrayDisplayEx_LocalStorage or I can store them in a global array. Since accessing variables through a function takes much longer time than accessing variables through an array, I've decided to remove _ArrayDisplayEx_LocalStorage completely and use an array to store all variables that are used globally. In the new update the global array $aArrayDisplayEx_Info is introduced. Because this example is all about displaying array data as fast as possible in a virtual listview, it seems to be a good idea to use an array instead of a function to store the global variables. Even if it's at the cost of a single global array. In Examples6.au3 you can click "Run User Func" to open the official version of _ArrayDisplay. If you click "Exit Script" in _ArrayDisplay GUI, the subclass in _ArrayDisplayEx is properly removed and Examples6.au3 exits nicely. Zip in post above updated. argumentum 1 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...
LarsJ Posted March 2, 2017 Author Share Posted March 2, 2017 (edited) Transpose flag Transposing a 2D array means to swap rows and columns. Transposing a 1D array seems not to make much sense. In a 1D array it makes not much sense to talk about rows or columns. It makes more sense to talk about elements. In this version the transpose flag is always set to zero (false) if the array is a 1D array. The array is always shown in the listview as one column with many rows. In previous versions the transpose flag for a 1D array meant that the array was shown in the listview as one row with many columns. But this was merely a visual effect in the listview. It was not really a transposed array. The reason for this change is that a listview is much better to display many rows than many columns. And a lot of code in WM_NOTIFY message handlers for the virtual listview can be avoided. For a 2D array the transpose flag is especially useful if the source array for one reason or another is transposed in itself (rows and columns are swapped directly in the source). Divided UDF UDFs with a lot of functionality usually also contains a lot of code. In most cases there is only need for a minor part of the functionality. It would be nice if it was enough to include a minor part of the code. The solution is a divided UDF: The UDF is divided into a main include file and a number of sub-includes. Because names and functionality of the includes are known, it's possible to add a few lines of code to the top of each file to check if a needed file is included. In the main include, ArrayDisplayEx.au3, it's checked whether needed files are included. The check is performed by examining parameters and flags for requested functionality. A missing include file will not result in any AU3Check, Compile or Runtime errors. If verbose mode is enabled (flag 0x0008) a MsgBox will show the names of missing includes. Else @error is set to 3 and @extended contains the indices (see top of ArrayDisplayEx.au3 or ArrayDisplayEx_AllFuncs.au3) of missing files. The include files are completely independent and can be included in any order and in any number. The main file is included in top of all sub-includes just below the #include-once keyword. A missing include file is checked. An unused include file is not checked. ArrayDisplayEx_Basic1D2Dfuncs.au3 (5 KB) is as the only file included in ArrayDisplayEx.au3. If you only need basic functionality for 1D/2D arrays it's enough to include ArrayDisplayEx.au3. Or ArrayDisplayEx_Basic1D2Dfuncs.au3 because ArrayDisplayEx.au3 is also included in the very top of the former. Include ArrayDisplayEx_AllFuncs.au3 to use all functionality. This file also contains information about the include files. Column alignment _ArrayDisplayEx can be used for development, troubleshooting and debugging. But it can also be used as a simple GUI to display a 1D/2D array for end users. This section and the next two sections is about improvements that are helpful when _ArrayDisplayEx is used to display arrays for end users. $aAlignment is a new parameter to pass a 2D array of column index/alignment pairs to _ArrayDisplayEx to specify alignment for individual columns. This example from the zip file below shows how to use the $aAlignment parameter: #include "..\..\Includes\ArrayDisplayEx.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() Local $iRows = 10000 Local $aArray[$iRows][10] For $i = 0 To $iRows - 1 For $j = 0 To 9 $aArray[$i][$j] = $i & "/" & $j Next Next Local $aAlignment = [ _ [ -1, 2 ], _ ; Unspecified columns: Right aligned [ 2, 0 ], _ ; Column 2: Left aligned [ 3, 4 ] ] ; Column 3: Centered text _ArrayDisplayEx( $aArray, "Column alignment: Array", "", 0x0010, $aAlignment, "", "", 75 ) ; 0x0010 = No "Copy" buttons EndFunc Minimum column widths In a virtual ListView column widths are calculated based on the rows at the first page in the ListView. This will not necessarily lead to correct column widths for all rows. $aMin_ColWidth is a new parameter to specify minimum column widths. Supply a number to set a minimum width for all columns. Use a 2D array of column index/width pairs to specify widths for individual columns. This example from the zip file shows how to use the $aMin_ColWidth parameter: #include "..\..\Includes\ArrayDisplayEx.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() Local $iRows = 10000 Local $aArray[$iRows][10] For $i = 0 To $iRows - 1 For $j = 0 To 9 $aArray[$i][$j] = $i & "/" & $j Next Next Local $aColWidths = [ _ [ -2, 65 ], _ ; Width for row-number column [ -1, 75 ], _ ; Width for unspecified columns [ 0, 55 ], _ ; Column 0, first col in array [ 1, 100 ], _ [ 2, 150 ], _ [ 3, 55 ] ] _ArrayDisplayEx( $aArray, "Minimum column widths: Array", "", 0x0012, "", "", "", $aColWidths ) ; 0x0012 = Right aligned text + No "Copy" buttons EndFunc Localized texts When _ArrayDisplayEx is used to display arrays for end users it's usually appreciated to display texts in the local language. $aLocal_Texts is used to pass to the function a translation of the english texts (error messages, control texts, listview header, tooltip and splash texts) into the local language. See top of ArrayDisplayEx.au3 for the format of $aLocal_Texts array. Internally $aLocal_Texts is stored as a static variable. This means that you can call _ArrayDisplayEx several times in the same script and only pass $aLocal_Texts to the function once. $aLocal_Texts also accepts a single string as parameter value. In this case the name of "Run User Func" button is replaced. The ability to specify a meaningful name makes the button more useful. Other updates Dokumentation in top of ArrayDisplayEx.au3 Among other things a list of parameters and flags Information about include files in ArrayDisplayEx_AllFuncs.au3 A number of smaller and a few bigger updates and bug fixes Examples The examples are grouped in folders by subject. 1) Functionality\ contains the GUI with 4 pages which demonstrates general functionality. This example has been included in all previous zip files. The other folders contains examples to demonstrate the new features. It's very small examples as the examples above. 3) Divided UDF\ contains scripts that shows how it's checked if a needed file is included or missing. There are three scripts. This is the first: expandcollapse popup#include "..\..\Includes\ArrayDisplayEx.au3" ;#include "..\..\Includes\ArrayDisplayEx_CopyFuncs.au3" ;#include "..\..\Includes\ArrayDisplayEx_UserFuncs.au3" ;#include "..\..\Includes\ArrayDisplayEx_ColorBasic.au3" Opt( "MustDeclareVars", 1 ) Global $aArray Example() Func Example() Local $iRows = 10000 Dim $aArray[$iRows][10] For $i = 0 To $iRows - 1 For $j = 0 To 9 $aArray[$i][$j] = $i & "/" & $j Next Next _ArrayDisplayEx( $aArray, "Missing includes", "", 0x0008, "", "", "", 55, 350, 0x000000, UserFunc ) ; 0x0008 = Verbose mode ConsoleWrite( "@error = " & @error & @CRLF & _ ; Don't exit script if you want to "@extended = " & BitsToStr( @extended ) & @CRLF ) ; see these lines in SciTE console. EndFunc Func UserFunc( $p1, $p2 ) ; 0x1818 = Verbose mode + No "Copy" buttons + No grid lines + Three alternating rows _ArrayDisplayEx( $aArray, "Click here button", "", 0x1818, "", "", "", 55, 350, 0xCCFFFF ) #forceref $p1, $p2 EndFunc Func BitsToStr( $iInt ) Local $sBits = "" For $i = 7 To 0 Step -1 $sBits &= BitAND( $iInt, 2^$i ) ? "1" : "0" Next Return $sBits EndFunc ArrayDisplayEx_CopyFuncs.au3 and ArrayDisplayEx_UserFuncs.au3 are needed to support Copy buttons and "Run User Func" button. Because the files are commented out, an error is generated when the script is run. Since Verbose mode is enabled the error will be shown in a MsgBox. In next script the comment symbol in front of these two files is deleted. There is still a comment in front of the third include to support alternating row colors. Now the script runs without errors, but clicking "Run User Func" button (renamed to "Click here" in example) will generate an error. In third script the last comment symbol is also deleted and the script runs completely without errors. Updated zip at bottom of next post. Edited March 10, 2017 by LarsJ Transpose flag: Added two lines KaFu 1 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...
LarsJ Posted March 10, 2017 Author Share Posted March 10, 2017 (edited) I can see that this example has achieved some popularity since the updates that started in December. Thank you very much. Divided UDF In the previous update the UDF is divided into a set of smaller include files: A main include and a number of sub-includes. The main include takes care of the overall functionality while the sub-includes updates the listview. Because it's a virtual listview these updates is first and foremost about feeding the listview with data from the data source (the array). Depending on features requested through function parameters and flags the sub-includes also takes care of displaying the leftmost row-number column, displaying the array as a transposed array, displaying alternating row colors and displaying special data with specific text strings. (Special data: An AutoIt array can contain all kinds of different data types in the array elements. This includes arrays (arrays of arrays or embedded arrays) function handles, objects and structures. But a listview can only display text strings in the listview cells. If you feed a listview with these special data, they'll be shown as empty cells. If you add 0x0200 (512) to $iFlags, special data will be shown as the text strings {Array}, {Function}, {Object} and {Struct}.) The code to copy data or run a user defined function by clicking the Copy buttons or the "Run User Func" button is also implemented in sub-includes. ArrayDisplayEx_Basic1D2Dfuncs.au3 (5 KB) is as the only file included in ArrayDisplayEx.au3. If you only include ArrayDisplayEx.au3 in your script, you can only use the functionality implemented in ArrayDisplayEx_Basic1D2Dfuncs.au3 which is basic functionality for 1D and 2D arrays. There are many advantages of a divided UDF: You don't have to include all the code in your script. It's enough to include the code you need. It's much easier to maintain the UDF. If eg. a new map data type (special data) is added only ArrayDisplayEx_BasicSpecial.au3 and ArrayDisplayEx_ColorSpecial.au3 needs to be updated. It's easy to add new functionality: Add a few code lines to the main include and implement the new functionality in a new sub-include. It's easy to implement ArrayDisplayEx functionality (GUI and virtual listview) for a completely new data source (a data source which is not an array): Make copies of ArrayDisplayEx.au3 and ArrayDisplayEx_Basic1D2Dfuncs.au3 and modify the files to support the new data source. Column colors As an example new functionality (point 3 above) is added to the UDF: Column colors. A feature which is particularly relevant when _ArrayDisplayEx is used to display data for end users. Pass a 2D array of column index/color pairs to the existing $iAlt_Color parameter to specify colors for individual columns. Example from the zip file: #include "..\..\Includes\ArrayDisplayEx.au3" #include "..\..\Includes\ArrayDisplayEx_ColumnColors.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() Local $iRows = 10000 Local $aArray[$iRows][10] For $i = 0 To $iRows - 1 For $j = 0 To 9 $aArray[$i][$j] = $i & "/" & $j Next Next Local $aColColors = [ _ [ 2, 0xF5F5F5 ] ] ; Column 2: WhiteSmoke _ArrayDisplayEx( $aArray, "Column two", "", 0x0010, "", "", "", 55, 350, $aColColors ) ; 0x0010 = No "Copy" buttons EndFunc Zip file New zip file below. Previous zip files in posts above removed. You need AutoIt 3.3.10 or later. Tested on Windows 10/7 32/64 bit and Windows XP 32 bit. Comments are welcome. Let me know if there are any issues. Obsolete. Use Data display functions based on virtual listviews. Edited October 7, 2017 by LarsJ Obsolete. Zip removed. argumentum 1 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...
LarsJ Posted March 18, 2017 Author Share Posted March 18, 2017 The update March 2 introduced a divided UDF. The large include file was divided into a set of smaller files. A main include and a number of sub-includes. Code was added in the main include to check if necessary sub-includes actually were included. This check code provides an Au3Check error in AutoIt 3.3.10 if you run the code (through a script that includes ArrayDisplayEx.au3) in SciTE by pressing F5. The error prevents the code from running. The error is only related to Au3Check. If you execute the code by double clicking the script, the code will run without errors. The version of Au3Check which belongs to AutoIt 3.3.12 is updated and does not provide any errors. If you want to use _ArrayDisplayEx in AutoIt 3.3.10, you can simply replace the Au3Check files (Au3Check.dat and Au3Check.exe) with the files that belongs to AutoIt 3.3.12. 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