Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#13115 closed defect (invalid)

wxListCtrl skips draw if neither wxLC_HRULES nor wxLC_VRULES styles are set

Reported by: splisp Owned by:
Priority: normal Milestone:
Component: wxMSW Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

In file src/msw/listctrl.cpp, line 2898 (inside the OnPaint() method), the following test skips drawing and the report remains blank:

2898	    if (!InReportView() || !(drawHRules || drawVRules) || !itemCount)
2899	    {
2900	        event.Skip();
2901	        return;
2902	    }

I'm going to submit a patch for this in short :)

Regards,

Fabrizio

Attachments (1)

rules.patch download (657 bytes) - added by splisp 9 years ago.
Patch

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by splisp

Patch

comment:1 Changed 9 years ago by splisp

  • Patch set

comment:2 Changed 9 years ago by splisp

Please note that I only tested the patch over the version released in the 2.9.1 distribution...

comment:3 Changed 9 years ago by vadz

  • Priority changed from high to normal
  • Resolution set to invalid
  • Status changed from new to closed

Sorry, I don't understand what the problem is, exactly. If neither horizontal nor vertical rules need to be drawn, it's perfectly fine to skip drawing because we only draw the rules in the code we're skipping.

So why do you think this code needs to be changed? AFAICS it's perfectly fine as it is.

comment:4 follow-up: Changed 9 years ago by splisp

Currently the wxListCtrl code calls event.skip() and returns *before* calling wxControl::OnPaint(event), which is where the list content is drawn. The result is that, if no RULES style is set, _nothing_ is drawn (not just the rules).

Regards,

Fabrizio

comment:5 in reply to: ↑ 4 ; follow-up: Changed 9 years ago by vadz

Replying to splisp:

Currently the wxListCtrl code calls event.skip() and returns *before* calling wxControl::OnPaint(event), which is where the list content is drawn.

The list is drawn by its DefWindowProc() which is called precisely because the event is skipped, there is no need to call wxControl::OnPaint() for this to happen.

The result is that, if no RULES style is set, _nothing_ is drawn (not just the rules).

This is obviously not the case, just run the list control sample which does work just fine even without the rules. Please look at your code carefully, you're doing something to trigger the problem and while I have no idea what it is, it's definitely not the case that wxListCtrl drawing doesn't work by default in wxMSW.

comment:6 in reply to: ↑ 5 Changed 9 years ago by splisp

The list is drawn by its DefWindowProc() which is called precisely because the event is skipped, there is no need to call wxControl::OnPaint() for this to happen.

This exactly exposes the bug in _my_ code, which I had never been aware of: I will open a thread on the forum with more details, I need some explanation.

Thanks for replying!

Regards

Fabrizio

Note: See TracTickets for help on using tickets.