orbs Posted July 21, 2013 Share Posted July 21, 2013 hello all, what is the way to make ListView with the first column always being visible, even when you scroll horizontally - similar to Excel "Freeze Panes" option. my idea is to cancel the use of horizontal scroll bar, instead use 2 buttons: arrow left & arrow right. when you click arrow right, the script makes column #2 hidden (or zero width), another click makes column 3 hidden, and so back & forth. i have not yet coded it, i will unless someone can suggest a simpler way. thanks in advance, 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...
Moderators Melba23 Posted July 21, 2013 Moderators Share Posted July 21, 2013 orbs,My immediate thought is to use 2 ListViews - one with a single column and the other with all the rest. You would have to link them vertically - I imagine a handler to check for the WM_VSCROLL message would do the trick. I will see what I can come up with - if I can find the time today between the Open, the Test match and the TdF! 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...
orbs Posted July 21, 2013 Author Share Posted July 21, 2013 if it's http://www.letour.fr you're concerned with, i hear there's a smartphone cradle for your bicycle - you can code while you paddle from you i would expect no less... 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...
Moderators Melba23 Posted July 21, 2013 Moderators Share Posted July 21, 2013 orbs,Here is something to show the principle of what I suggested:expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GUIListView.au3> #include <GuiScrollBars.au3> $hGUI = GUICreate("Test", 500, 500) $cLV_0 = GUICtrlCreateListView(" ", 10, 10, 100, 200) _GUICtrlListView_SetColumnWidth($cLV_0, 0, 83) $hLV_0 = GUICtrlGetHandle($cLV_0) $cLV_Rest = GUICtrlCreateListView(" | | ", 110, 10, 380, 217) _GUICtrlListView_SetColumnWidth($cLV_Rest, 0, 200) _GUICtrlListView_SetColumnWidth($cLV_Rest, 1, 200) _GUICtrlListView_SetColumnWidth($cLV_Rest, 2, 200) $hLV_Rest = GUICtrlGetHandle($cLV_Rest) For $i = 0 To 20 GUICtrlCreateListViewItem("Col 0 Item " & $i, $cLV_0) GUICtrlCreateListViewItem("Col 1 Item " & $i & "|Col 2 Item " & $i & "|Col 3 Item " & $i, $cLV_Rest) Next _GUIScrollBars_ShowScrollBar($hLV_0, $SB_BOTH, False) GUISetState() $aRect = _GUICtrlListView_GetItemRect($cLV_0, 0) $iRow_Height = $aRect[3] - $aRect[1] ConsoleWrite($iRow_Height & @CRLF) $iTopIndex_Curr = _GUICtrlListView_GetTopIndex($hLV_Rest) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch If _GUICtrlListView_GetTopIndex($hLV_Rest) <> $iTopIndex_Curr Then $iIndex_Rest = _GUICtrlListView_GetTopIndex($hLV_Rest) ConsoleWrite("Rest: " & $iIndex_Rest & @CRLF) $iIndex_0 = _GUICtrlListView_GetTopIndex($hLV_0) ConsoleWrite("Zero: " & $iIndex_0 & @CRLF) $iScroll_Distance = ($iIndex_Rest - $iIndex_0) * $iRow_Height _GUICtrlListView_Scroll($cLV_0, 0, $iScroll_Distance) _GUIScrollBars_ShowScrollBar($hLV_0, $SB_BOTH, False) $iTopIndex_Curr = $iIndex_Rest EndIf WEndFor the moment I cannot find the message sent by the ListView scrollbars - once we have that then we can use a handler which should remove the ugly "catch up when finished scrolling" action. I will keep looking - but I hope you feel the overall effect is what you were looking for. As for the TdF - I have been a fan for years and am really delighted for Chris Froome! 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...
Moderators Melba23 Posted July 21, 2013 Moderators Share Posted July 21, 2013 orbs, Found it! expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GUIListView.au3> #include <GuiScrollBars.au3> $hGUI = GUICreate("Test", 500, 500) $cLV_0 = GUICtrlCreateListView(" ", 10, 10, 100, 200) _GUICtrlListView_SetColumnWidth($cLV_0, 0, 83) $hLV_0 = GUICtrlGetHandle($cLV_0) $cLV_Rest = GUICtrlCreateListView(" | | ", 110, 10, 380, 217) _GUICtrlListView_SetColumnWidth($cLV_Rest, 0, 200) _GUICtrlListView_SetColumnWidth($cLV_Rest, 1, 200) _GUICtrlListView_SetColumnWidth($cLV_Rest, 2, 200) $hLV_Rest = GUICtrlGetHandle($cLV_Rest) For $i = 0 To 20 GUICtrlCreateListViewItem("Col 0 Item " & $i, $cLV_0) GUICtrlCreateListViewItem("Col 1 Item " & $i & "|Col 2 Item " & $i & "|Col 3 Item " & $i, $cLV_Rest) Next _GUIScrollBars_ShowScrollBar($hLV_0, $SB_BOTH, False) GUISetState() $aRect = _GUICtrlListView_GetItemRect($cLV_0, 0) $iRow_Height = $aRect[3] - $aRect[1] GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $iIDFrom Case $cLV_Rest Switch $iCode Case $LVN_BEGINSCROLL $iIndex_Rest = _GUICtrlListView_GetTopIndex($hLV_Rest) $iIndex_0 = _GUICtrlListView_GetTopIndex($hLV_0) $iScroll_Distance = ($iIndex_Rest - $iIndex_0) * $iRow_Height _GUICtrlListView_Scroll($cLV_0, 0, $iScroll_Distance) _GUIScrollBars_ShowScrollBar($hLV_0, $SB_BOTH, False) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Much better! 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...
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