Opened 8 years ago

Closed 4 months ago

#3666 closed defect (fixed)

wxListCtrl::GetItem return all information without the mask supplied

Reported by: rodlima Owned by: VZ
Priority: normal Milestone:
Component: GUI-generic Version:
Keywords: Cc: rodlima
Blocked By: Blocking:
Patch: no

Description

Differently from generic's implementation, MSW's wxListCtrl:GetItem port doesn't fill all members of wxListItem when no mask is passed.

If you look at the code, generic's implementation returns all information when wxListItem's mask is not specified (it's this way due to backward compatibility issues), but MSW's doesn't.

And MSW's port never sets wxListItem's font or item's background colour.

All this wrong behaviour makes working with multiplatform projects rather difficult, we as a library user expect that all ports behave the same.

Change History (3)

comment:1 Changed 4 months ago by oneeyeman

I think the generic implementation is at fault here.
While it is possible to get/set all of the states by specifying -1 as a stateMask, it is not possible to do so for the mask field.
If you want some specific information about the item you set the mask appropriately, but you can't ignore this field as to retrieve everything about the item as there is no guarantee that the information will be valid.

I can't check generic one at the moment, but if anybody can do that to confirm that generic implementation still behaves like it described on this ticket it should be changed from wxMSW to become generic one.

comment:2 Changed 4 months ago by oneeyeman

  • Component changed from wxMSW to GUI-generic
  • Summary changed from MSW's wxListCtrl::GetItem doesn't return all information to wxListCtrl::GetItem return all information without the mask supplied

comment:3 Changed 4 months ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from new to closed

In 76630:

Return all information from wxListCtrl::GetItem() if no mask specified.

This is more useful than returning nothing and is consistent with the generic
version behaviour.

Closes #3666.

Note: See TracTickets for help on using tickets.