HurleyShanabarger Posted June 18, 2020 Share Posted June 18, 2020 (edited) Hello, in the last 15 year there was not one programming tasks that I could not get done with AutoIt. Research within this forum always helped me to get a good solution for the actual tasks. I have a new project upcoming and it will be heavily GUI related - and I think will need to implement a modern DataGridView and this is missing in AutoIt. I think DataGridView is an element from C# and I am wondering what would be the best approach - is Visual Studio a good way to create a program that is using a DataGridView or is there an easier way for someone that is just used to AutoIt? Thanks for any suggestions Edited June 18, 2020 by HurleyShanabarger Link to comment Share on other sites More sharing options...
BigDaddyO Posted June 18, 2020 Share Posted June 18, 2020 is there a reason you can't use ListView? I know there are some udf's I've used in the past that allow inline edits of a listview item. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 18, 2020 Moderators Share Posted June 18, 2020 HurleyShanabarger, Take a look at my GUIListViewEx UDF (the link is in my sig) which allows you to have ListViews with editable cells (plain text, combos, date controls), drag'n'drop, colours and much more. It might allow you to stay with AutoIt for your upcoming project. 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...
HurleyShanabarger Posted June 22, 2020 Author Share Posted June 22, 2020 Well, currently the data is handled within and excel document and there is a lot of logic put into the macro behind. So basically the DataGridView would represent the contents of the sheet and the GUI around it would be for handling data import/export/verification. One of the main features would be to show/hide columns, but the one feature that I have to seen with a ListView is to freeze a column. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 22, 2020 Moderators Share Posted June 22, 2020 HurleyShanabarger, What exactly do you mean by "freezing" a column? Making it uneditable? Making it a fixed width? 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...
HurleyShanabarger Posted June 22, 2020 Author Share Posted June 22, 2020 I think you see it best in this video; the first column of the upper listview is fixed and will be scrolled horizontally. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 22, 2020 Moderators Share Posted June 22, 2020 (edited) HurleyShanabarger, You can always use 2 synchronized ListViews like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiTreeView.au3> #include <GuiListView.au3> #include <Misc.au3> #include <GuiScrollBars.au3> Global Const $iMax = 40 Global $iPos_1 = 0, $iPos_2 = 0 $hGUI = GUICreate("Synchro Pair", 255, 240, -1, -1) $cLV_2 = GUICtrlCreateListView("Col 1|Col 2|Col 3|Col 4", 60, 5, 185, 220) $hLV_2 = GUICtrlGetHandle($cLV_2) GUISetState(@SW_SHOW) $hGUI_Child = GUICreate("", 50, 220, 10, 5, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) $cLV_1 = GUICtrlCreateListView("Frozen", 0, 0, 85, 220) $hLV_1 = GUICtrlGetHandle($cLV_1) GUISetState() For $i = 1 To $iMax GUICtrlCreateListViewItem("Item " & $i, $cLV_1) GUICtrlCreateListViewItem("Item " & $i, $cLV_2) Next Global $aRect = _GUICtrlListView_GetItemRect($hLV_2, 0) Global Const $iDeltaY = $aRect[3] - $aRect[1] GUIRegisterMsg($WM_NOTIFY, "_WM_Notify") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_Notify($hWnd, $Msg, $wParam, $lParam) Local $iLines_1 = _SendMessage($hLV_1, $LVM_GETTOPINDEX) Local $iLines_2 = _SendMessage($hLV_2, $LVM_GETTOPINDEX) If $iLines_1 <> $iLines_2 Then _SendMessage($hLV_1, $LVM_SCROLL, 0, ($iLines_2 - $iLines_1) * $iDeltaY) EndIf Return "GUI_RUNDEFMSG" EndFunc ;==>_WM_Notify That seems to give you the same sort of effect. Worth pursuing? M23 Edited June 22, 2020 by Melba23 Better example script 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...
HurleyShanabarger Posted June 23, 2020 Author Share Posted June 23, 2020 In general this might work; but it might be a pain in the a** to keep the data in both synchronized. Also I don't thing that end-user will like the flickering while scrolling. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 23, 2020 Moderators Share Posted June 23, 2020 HurleyShanabarger, I cannot see why keeping the data synchronised in the pair would be any more difficult than keeping a single ListView up to date - but only you know exactly what is required. And I see no flickering when the pair are scrolled. 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...
argumentum Posted June 25, 2020 Share Posted June 25, 2020 (edited) @HurleyShanabarger, that video is of a web thing. If you give me the html, I'll give it a try at having it as a "control" in AutoIt via embedded IE. Just have all the web interaction via AJAX, where you have the event you'd handle in au3 and i'll pass it back as JSON for the JS to handle. Is not impossible, just somewhat cumbersome. or try Edited February 10 by argumentum replaced image provider (need the space) Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
orbs Posted June 26, 2020 Share Posted June 26, 2020 (edited) regarding the synchronized ListViews example by @Melba23 above: there is a bug when you scroll all the way down - then the last rows do not remain paired. this is because the frozen listview allows for one extra scroll, because the data area height is greater, because the dynamic listview has an horizontal scrollbar. a crude solution would be to set the height of the frozen listview minus the height of the horizontal scrollbar, which is roughly 18px, so instead of 220 it should be 202. EDIT: or perhaps there is a way to calculate the height of the horizontal scrollbar at run-time? i did not find such method, but i guess there must be... Edited June 26, 2020 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
HurleyShanabarger Posted June 26, 2020 Author Share Posted June 26, 2020 On 6/23/2020 at 4:37 PM, Melba23 said: HurleyShanabarger, I cannot see why keeping the data synchronised in the pair would be any more difficult than keeping a single ListView up to date - but only you know exactly what is required. And I see no flickering when the pair are scrolled. M23 If you scroll in the first Listview you will have this flickering: Thanks for the other ideas, I will look into it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 26, 2020 Moderators Share Posted June 26, 2020 orbs, Quote perhaps there is a way to calculate the height of the horizontal scrollbar at run-time? Indeed there is: _WinAPI_GetSystemMetrics(2) ; Width of VScrollbar: SM_CXVSCROLL _WinAPI_GetSystemMetrics(3) ; Height of HScrollbar: SM_CYHSCROLL 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...
FrancescoDiMuro Posted June 27, 2020 Share Posted June 27, 2020 (edited) @HurleyShanabarger Did you try to set the extended style $LVS_EX_DOUBLEBUFFER to the ListViews? It should reduce the flickering during scroll, as it is stated in the Help file about ListView control Edited June 29, 2020 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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