Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

I'm not sure whether that's actually useful... -- Larry Wall in <199710011704.KAA21395@wall.org>


devel / comp.os.ms-windows.programmer.win32 / Listview - keep a selection when clicking a subitem ?

SubjectAuthor
* Listview - keep a selection when clicking a subitem ?R.Wieser
+* Listview - keep a selection when clicking a subitem ?JJ
|+- Listview - keep a selection when clicking a subitem ?R.Wieser
|`* Listview - keep a selection when clicking a subitem ?R.Wieser
| `* Listview - keep a selection when clicking a subitem ?JJ
|  `- Listview - keep a selection when clicking a subitem ?R.Wieser
`* Listview - keep a selection when clicking a subitem ?Paul N
 `- Listview - keep a selection when clicking a subitem ?R.Wieser

1
Listview - keep a selection when clicking a subitem ?

<th95no$l6p$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1118&group=comp.os.ms-windows.programmer.win32#1118

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Listview - keep a selection when clicking a subitem ?
Date: Sat, 1 Oct 2022 12:45:03 +0200
Organization: Aioe.org NNTP Server
Lines: 23
Message-ID: <th95no$l6p$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="21721"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MSMail-Priority: Normal
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Sat, 1 Oct 2022 10:45 UTC

Hello all,

I've created a listview with a few columns which allows multiple rows to be
selected.

The thing is that I would like to be able to select a few rows and than
click subitems without loosing that selection.

I've been looking if I could ignore the LVN_SELECTIONCHANGED notification,
but that one doesn't even return a value. And as the NM_CLICK notification
comes in after all the changes its not usable either.

tl;dr:
Does anyone know how to keep a set of rows selected when clicking a subitem
?

Or maybe the other way around : can I limit the selection of rows to only
when clicking the main item row ?

Regards,
Rudy Wieser

Re: Listview - keep a selection when clicking a subitem ?

<fqacl9k9eam8.16gt4onzrcq6b.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1119&group=comp.os.ms-windows.programmer.win32#1119

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Listview - keep a selection when clicking a subitem ?
Date: Sat, 1 Oct 2022 21:16:48 +0700
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <fqacl9k9eam8.16gt4onzrcq6b.dlg@40tude.net>
References: <th95no$l6p$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="f4893336d037b0ac5e9c75dc5251b287";
logging-data="1432183"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195i1j5SKCV4/Eej7L3gjE77VIpX31twkA="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:IzDm7wxPl+vSw6P6KhjAp6nWqKw=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Sat, 1 Oct 2022 14:16 UTC

On Sat, 1 Oct 2022 12:45:03 +0200, R.Wieser wrote:
> Hello all,
>
> I've created a listview with a few columns which allows multiple rows to be
> selected.
>
> The thing is that I would like to be able to select a few rows and than
> click subitems without loosing that selection.
>
> I've been looking if I could ignore the LVN_SELECTIONCHANGED notification,
> but that one doesn't even return a value. And as the NM_CLICK notification
> comes in after all the changes its not usable either.
>
> tl;dr:
> Does anyone know how to keep a set of rows selected when clicking a subitem
> ?
>
> Or maybe the other way around : can I limit the selection of rows to only
> when clicking the main item row ?
>
> Regards,
> Rudy Wieser

Hold CTRL key for selecting more items without deselecting existing item(s).

Re: Listview - keep a selection when clicking a subitem ?

<tha1fq$22e$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1120&group=comp.os.ms-windows.programmer.win32#1120

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Listview - keep a selection when clicking a subitem ?
Date: Sat, 1 Oct 2022 20:38:45 +0200
Organization: Aioe.org NNTP Server
Lines: 24
Message-ID: <tha1fq$22e$1@gioia.aioe.org>
References: <th95no$l6p$1@gioia.aioe.org> <fqacl9k9eam8.16gt4onzrcq6b.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="2126"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MSMail-Priority: Normal
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
 by: R.Wieser - Sat, 1 Oct 2022 18:38 UTC

JJ,

> Hold CTRL key for selecting more items without deselecting existing
> item(s).

I know, thats not the problem. I have the need to be able to click
subitems (no ctrl or shift held) *without* the selection mechanism kicking
in.

And by the way: Have you ever tried to ctrl-click items and than click a
subitem ? The selection for that row will toggle ...

Hmm.... I just checked, for a reference, what OE6 does in such a case
(trying to set the 'ignore' state for a set of rows). The other selected
rows and the last (ctrl-selected) one do not change status at the same
moment - due to that last row getting its selection toggeled when again
ctrl-clicked.

..... and that might mean that I set my goal a bit to high ....

Regards,
Rudy Wieser

Re: Listview - keep a selection when clicking a subitem ?

<thbis9$18jj$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1121&group=comp.os.ms-windows.programmer.win32#1121

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Listview - keep a selection when clicking a subitem ?
Date: Sun, 2 Oct 2022 10:41:37 +0200
Organization: Aioe.org NNTP Server
Lines: 21
Message-ID: <thbis9$18jj$1@gioia.aioe.org>
References: <th95no$l6p$1@gioia.aioe.org> <fqacl9k9eam8.16gt4onzrcq6b.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="41587"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Sun, 2 Oct 2022 08:41 UTC

JJ,

> Hold CTRL key for selecting more items without deselecting existing
> item(s).

I forgot to explicitily mention that I'm using the listview in LVS_REPORT
style.

Something "funny" :

Using a basic listview (no LVS_EX_FULLROWSELECT) you *cannot* select rows
other than by clicking on the main items column, but clicking /anywhere/ on
a row *will* drop the (carefull) selection you made. Go figure ...

There might be a reason for doing it that way, but I'm not yet been able to
figure it out.

Regards,
Rudy Wieser

Re: Listview - keep a selection when clicking a subitem ?

<1m11anxkqimwx$.16e8d9xgmdmzh$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1122&group=comp.os.ms-windows.programmer.win32#1122

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Listview - keep a selection when clicking a subitem ?
Date: Sun, 2 Oct 2022 19:31:27 +0700
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <1m11anxkqimwx$.16e8d9xgmdmzh$.dlg@40tude.net>
References: <th95no$l6p$1@gioia.aioe.org> <fqacl9k9eam8.16gt4onzrcq6b.dlg@40tude.net> <thbis9$18jj$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="3d87de0a0989834d2aa09c196e1984fc";
logging-data="1794048"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1ubSjRAYq7O53AIEgLyNc5ACGE8NiWeA="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:jy1SbgdLmbf6k3qlWAEt6rzjzIU=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Sun, 2 Oct 2022 12:31 UTC

On Sun, 2 Oct 2022 10:41:37 +0200, R.Wieser wrote:
>
> I forgot to explicitily mention that I'm using the listview in LVS_REPORT
> style.
>
> Something "funny" :
>
> Using a basic listview (no LVS_EX_FULLROWSELECT) you *cannot* select rows
> other than by clicking on the main items column, but clicking /anywhere/ on
> a row *will* drop the (carefull) selection you made. Go figure ...
>
> There might be a reason for doing it that way, but I'm not yet been able to
> figure it out.
>
> Regards,
> Rudy Wieser

Might want to try injecting CTRL key event at the correct time. e.g. when
mouse enters the ListView and when there's existing selection.

Re: Listview - keep a selection when clicking a subitem ?

<thcbs5$1afg$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1123&group=comp.os.ms-windows.programmer.win32#1123

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Listview - keep a selection when clicking a subitem ?
Date: Sun, 2 Oct 2022 17:48:15 +0200
Organization: Aioe.org NNTP Server
Lines: 42
Message-ID: <thcbs5$1afg$1@gioia.aioe.org>
References: <th95no$l6p$1@gioia.aioe.org> <fqacl9k9eam8.16gt4onzrcq6b.dlg@40tude.net> <thbis9$18jj$1@gioia.aioe.org> <1m11anxkqimwx$.16e8d9xgmdmzh$.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="43504"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
 by: R.Wieser - Sun, 2 Oct 2022 15:48 UTC

JJ,

> Might want to try injecting CTRL key event at the correct time.
> e.g. when mouse enters the ListView and when there's existing
> selection.

I'm afraid that the/my problem already shows itself when doing the first
selection and than clicking a subitem column (to effect a change al-la OE6
with its "ignore" (spectacle icon) column). I'm confident it will do the
same on a second selection (without my mouse having left the listview
controls window).

Another "funny" one : Select a few rows (using shift-click) and than do a
ctrl-click afterwards (selecting a new or deselecting a currently selected
row). After that there is no way to click anywhere (on a subitem or
otherwise) to effect a change without either loosing the selection
(shift-click) or unselecting the row you click (ctrl-click) and having to
click it again to select it again. Fun when you want to toggle something
in all of those rows ...

I already tried to fight the selection mechanism by capturing
LVN_ITEMCHANGING and in certain cases disallowing a change*, but than
strange stuff started to happen when I continued ctrl-clicking rows.

* a problem in itself, 'cause multiple changes (selected, focussed) can
occur at the same time, and it seems to be an all-or-nothing rejection.

Currently I've chosen to ignore, in the listviews NM_CLICK notification
code, the ctrl/shift click on a subitem if its done on an (just switched to)
unselected row. It makes sure that if a change is made its made on all rows
at the same time.

.... I might include a check to see if the clicked row is the only one
selected, and than effect a non-ctrl/shift click too.

I must say, I really enjoy working with those basic, freely configurable
controls. /s

Regards,
Rudy Wieser

Re: Listview - keep a selection when clicking a subitem ?

<cc34e679-c424-4fed-b260-01a1beac7161n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1124&group=comp.os.ms-windows.programmer.win32#1124

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
X-Received: by 2002:ad4:596b:0:b0:4b1:ee66:1cb8 with SMTP id eq11-20020ad4596b000000b004b1ee661cb8mr2328839qvb.3.1666099890855;
Tue, 18 Oct 2022 06:31:30 -0700 (PDT)
X-Received: by 2002:a05:6214:240f:b0:4b3:f236:ed48 with SMTP id
fv15-20020a056214240f00b004b3f236ed48mr2065112qvb.57.1666099890690; Tue, 18
Oct 2022 06:31:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.ms-windows.programmer.win32
Date: Tue, 18 Oct 2022 06:31:30 -0700 (PDT)
In-Reply-To: <th95no$l6p$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=89.240.150.28; posting-account=0B-afgoAAABP6274zLUJKa8ZpdIdhsYx
NNTP-Posting-Host: 89.240.150.28
References: <th95no$l6p$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cc34e679-c424-4fed-b260-01a1beac7161n@googlegroups.com>
Subject: Re: Listview - keep a selection when clicking a subitem ?
From: gw7rib@aol.com (Paul N)
Injection-Date: Tue, 18 Oct 2022 13:31:30 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2447
 by: Paul N - Tue, 18 Oct 2022 13:31 UTC

On Saturday, October 1, 2022 at 11:45:18 AM UTC+1, R.Wieser wrote:
> Hello all,
>
> I've created a listview with a few columns which allows multiple rows to be
> selected.
>
> The thing is that I would like to be able to select a few rows and than
> click subitems without loosing that selection.
>
> I've been looking if I could ignore the LVN_SELECTIONCHANGED notification,
> but that one doesn't even return a value. And as the NM_CLICK notification
> comes in after all the changes its not usable either.
>
> tl;dr:
> Does anyone know how to keep a set of rows selected when clicking a subitem
> ?
>
> Or maybe the other way around : can I limit the selection of rows to only
> when clicking the main item row ?

Just a suggestion, and I'm a bit late to the party, but... I'm guessing that the unwanted effects happen when the control receives a WM_LBUTTONDOWN message. Would it be possible to subclass the control and intercept that message? You could see what is being clicked on (don't know how easy that would be) and what the current state of the control is, and if the normal result is not what you want then change the message to a different one and/or do something directly.

Re: Listview - keep a selection when clicking a subitem ?

<tiodt5$1td9$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1125&group=comp.os.ms-windows.programmer.win32#1125

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Listview - keep a selection when clicking a subitem ?
Date: Wed, 19 Oct 2022 10:52:44 +0200
Organization: Aioe.org NNTP Server
Lines: 23
Message-ID: <tiodt5$1td9$1@gioia.aioe.org>
References: <th95no$l6p$1@gioia.aioe.org> <cc34e679-c424-4fed-b260-01a1beac7161n@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="62889"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-Priority: 3
 by: R.Wieser - Wed, 19 Oct 2022 08:52 UTC

Paul,

> Would it be possible to subclass the control and intercept that message?

At some point I was considering the same. Up until the point I realized I
would be fighting the build-in selection method, and could only hope it
would not get out on sync or have wierd side effects (i've tried some other
build-in(!) stuff which did just that).

Next to that I still needed the click event so I could do my own thing.
That means I would either had to move code from outside the listview to
inside it, of fake my own notification.

In the end I decided that especially the fighting was not worth it, and
setteled on not executing my own code when a subitem was clicked and (as a
result) was just deselected.

Thanks for the suggestion though.

Regards,
Rudy Wieser

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor