Jump to content

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


Recommended Posts

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
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

  • 1 year later...

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
 Share

  • Recently Browsing   0 members

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