randallc Posted January 31, 2008 Posted January 31, 2008 (edited) Hi, There is "_GUICtrlListView_GetTopIndex" and "_GUICtrlListView_GetCounterPage" for height and number of items start/ visible; I need the same for width and number of columns start/ visible. Can it be done? Am I missing a function? best, Randall Edited February 11, 2008 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
GaryFrost Posted January 31, 2008 Posted January 31, 2008 Hi,There is "_GUICtrlListView_GetTopIndex" and "_GUICtrlListView_GetCounterPage" for height and number of items start/ visible; I need the same for width and number of columns start/ visible.Can it be done? Am I missing a function?best, Randall_GUICtrlListView_GetColumnWidth and _GUICtrlListView_GetItemRect SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
randallc Posted January 31, 2008 Author Posted January 31, 2008 _GUICtrlListView_GetColumnWidth and _GUICtrlListView_GetItemRectHi, thanks,I'll look again; they looked more complicated than that, I thought to do with pixel counts; I'll check examples again.(Does either give the number of the first visible column, or a way to calculate that?)Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
Siao Posted January 31, 2008 Posted January 31, 2008 Like I said, #469383 "be smart, drink your wine"
randallc Posted January 31, 2008 Author Posted January 31, 2008 (edited) Like I said, #469383Thanks again!As I said, it all looked too hard with pixel counts when I looked before, but maybe it is not.Best, Randall Edited January 31, 2008 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
GaryFrost Posted January 31, 2008 Posted January 31, 2008 Thanks again!As I said, it all looked too hard with pixel counts when I looked before, but maybe it is not.Best, RandallYep what he told you should work and pretty easy at that. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
randallc Posted February 1, 2008 Author Posted February 1, 2008 Yep what he told you should work and pretty easy at that.Hi,Yes, easy for you! oh well.. maybe 5 hours later.@Gary, do you think there is any place for using the virtual listview seeing it can be so quick?Best, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
randallc Posted February 11, 2008 Author Posted February 11, 2008 _GUICtrlListView_GetColumnWidth and _GUICtrlListView_GetItemRectHi, best I can do is this; Can you show me how to do it with _GUICtrlListView_GetColumnWidth and _GUICtrlListView_GetItemRect? [As HitTest does other things to GUI, I think...] expandcollapse popup; _GUICtrlListView_GetTopColumn #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GuiConstantsEx.au3> #include <GuiListView.au3> Opt('MustDeclareVars', 1) $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work Global $hGui,$hListView _Main() Func _Main() Local $hListView $hGui=GUICreate("ListView Get Selected Column", 400, 300) $hListView = GUICtrlCreateListView("Column 1|Column 2|Column 3", 2, 2, 394, 268) GUICtrlCreateListViewItem("line1|data1|more1", $hListView) GUICtrlCreateListViewItem("line2|data2|more2", $hListView) GUICtrlCreateListViewItem("line3|data3|more3", $hListView) GUICtrlCreateListViewItem("line4|data4|more4", $hListView) GUICtrlCreateListViewItem("line5|data5|more5", $hListView) GUISetState() ; Select item 50 _GUICtrlListView_SetColumnWidth($hListView, 2, $LVSCW_AUTOSIZE_USEHEADER) _GUICtrlListView_SetItemSelected($hListView, 2) _GUICtrlListView_EnsureVisible($hListView, 2) MsgBox(4160, "Information", "Top Index: " & _GUICtrlListView_GetTopIndex($hListView)) MsgBox(4160, "Information", "Top Column: " & _GUICtrlListView_GetTopColumn($hListView)) MsgBox(4160, "Information", "Right Column: " & _GUICtrlListView_GetRightColumn($hListView)) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func _GUICtrlListView_GetTopColumn($hListView) Local $aHitS = _GUICtrlListView_SubItemHitTest($hListView, 50, 100) return $aHitS[1] EndFunc ;==>_GUICtrlListView_GetTopColumn Func _GUICtrlListView_GetRightColumn($hListView) Local $aiGUISize = WinGetClientSize($hGUI) Local $aHitE = _GUICtrlListView_SubItemHitTest($hListView, $aiGUISize[0] - 50, 50) Return $aHitE[1] EndFunc ;==>_GUICtrlListView_GetRightColumnBest, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
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