Jump to content

Recommended Posts

Posted

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

 

  • Moderators
Posted

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! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

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  :bike: 

from you  :king:  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

 

  • Moderators
Posted

orbs,

Here is something to show the principle of what I suggested:

#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

WEnd
For 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! :party:

 

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • Moderators
Posted

orbs,

Found it!

#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! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...