Jump to content
footswitch

Custom ListView - icons / checkboxes / multiline / edit in place

Recommended Posts

ProgrammerKid

On-Topic: Cool script

Off-Topic: Can someone help me in my first topic? Thanks, sorry if this is called spam.

Share this post


Link to post
Share on other sites
footswitch

About the last script posted by rover, here's a quick fix for multi-selection (replace the declaration of $bSelected and adjust the If statement)

Local $bSelected = GUICtrlSendMsg($cID, $LVM_GETITEMSTATE, $itmID, $LVIS_SELECTED) <> 0
If $bSelected Then
  $iTxtCol = 0x494949
  DllCall($iDllUSER32, "int", "FillRect", "handle", $hDC, "ptr", DllStructGetPtr($tDRAWITEMSTRUCT, "itmRect"), "handle", $hBrush)
Else
  $iTxtCol = 0xB79588
EndIf

Share this post


Link to post
Share on other sites
rover

About the last script posted by rover, here's a quick fix for multi-selection (replace the declaration of $bSelected and adjust the If statement)

Local $bSelected = GUICtrlSendMsg($cID, $LVM_GETITEMSTATE, $itmID, $LVIS_SELECTED) <> 0
If $bSelected Then
  $iTxtCol = 0x494949
  DllCall($iDllUSER32, "int", "FillRect", "handle", $hDC, "ptr", DllStructGetPtr($tDRAWITEMSTRUCT, "itmRect"), "handle", $hBrush)
Else
  $iTxtCol = 0xB79588
EndIf

@footswitch

Good to hear you like it.

I came up with the idea of theming selected items a few years back.

A bit of a misuse to use the button theme, but it works in XP on up.

The listview theme in Vista and up has a group item glass theme part that could also be used, check MSDN and the vsstyle.h file for parts and states constants.

The sendmessage call is not needed, the ODS_SELECTED section was coded improperly.

I've corrected that in both examples and added a few fixes and a themed select bar demonstration to the second example.

@UEZ

Thanks

Edited by rover

I see fascists...

Share this post


Link to post
Share on other sites
KaFu

Really nice example with lots of ideas to follow-up on, 5 stars from me too (maybe you repost it in the examples forum too) ;)...

Share this post


Link to post
Share on other sites
footswitch

Sweet Jesus.

;)

Edited by footswitch

Share this post


Link to post
Share on other sites
rover

Sweet Jesus.

Just one last thing

Added combo for Button or Listview theme parts with resize of Listview theme parts as they are 1 pixel larger than Button parts

Btw, the Listview group header theme parts have a better gradient than Button parts in Vista+

Really nice example with lots of ideas to follow-up on, 5 stars from me too (maybe you repost it in the examples forum too) ..

Thanks

It's a good enough example/guideline for people to code their own implementation.

Edited by rover

I see fascists...

Share this post


Link to post
Share on other sites
AndreyS
Greetings to all the participants!
Maybe someone knows how to do so long elements were fully visible and appear in a few lines in ListView? Maybe there is a special property?
After all, it is obviously necessary and useful.

Share this post


Link to post
Share on other sites

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

×