#11419: wxVListBoxComboPopup uses m_itemHeight before it is initialised

1 view
Skip to first unread message

wxTrac

unread,
Nov 5, 2009, 8:02:06 AM11/5/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11419>

#11419: wxVListBoxComboPopup uses m_itemHeight before it is initialised
----------------------+-----------------------------------------------------
Reporter: manifold | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxMSW | Version: 2.8.10
Keywords: | Blockedby:
Patch: 0 | Blocking:
----------------------+-----------------------------------------------------
wxVListBoxComboPopup::Create calls SetItemCount before setting
m_itemHeight, but SetItemCount calls OnMeasureItem, for which m_itemHeight
is the default value.

This affects wxMac and wxGTK as well.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11419>

wxTrac

unread,
Nov 6, 2009, 9:01:07 AM11/6/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11419#comment:1>

#11419: wxVListBoxComboPopup uses m_itemHeight before it is initialised

----------------------------------+-----------------------------------------
Reporter: manifold | Owner:
Type: defect | Status: infoneeded_new
Priority: normal | Milestone:
Component: GUI-generic | Version: 2.8.10
Keywords: wxOwnerDrawnComboBox | Blockedby:
Patch: 0 | Blocking:
----------------------------------+-----------------------------------------
Changes (by jmsalli):

* keywords: => wxOwnerDrawnComboBox
* status: new => infoneeded_new
* component: wxMSW => GUI-generic


Comment:

wxVListBoxComboPopup::Init() should have been called before Create(), by
code in wxComboCtrl, so m_itemHeight would be initialized to 0. The
initial OnMeasureItem() call you are referring to may be superfluous, but
OTOH it should do no harm either.

So, was this just an observation, or is this issue causing some real
problems for you?

Thanks!


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11419#comment:1>

wxTrac

unread,
Nov 8, 2009, 4:50:10 PM11/8/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11419#comment:2>

#11419: wxVListBoxComboPopup uses m_itemHeight before it is initialised

----------------------------------+-----------------------------------------


Reporter: manifold | Owner:
Type: defect | Status: new
Priority: normal | Milestone:

Component: GUI-generic | Version: 2.8.10
Keywords: wxOwnerDrawnComboBox | Blockedby:
Patch: 0 | Blocking:
----------------------------------+-----------------------------------------

Changes (by manifold):

* status: infoneeded_new => new


Comment:

The problem I had was using a wxOwnerDrawnComboBox, under wxMac the popup
was opening too small, missing the decenders on the bottom line of text.

The control's OnMeasureItem() was returning -1, which is documented as
causing the default behaviour of measuring the text, but I realised that
it was actually causing the height to be zero.

When I spotted the above problem, I assumed that was causing it. I can see
that you are right that it may not actually be causing a problem

Maybe the real problem lies in the size of margins in GetAdjustedSize.

I am sorry, I should have reported my actual problem!


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11419#comment:2>

wxTrac

unread,
Nov 9, 2009, 10:17:08 AM11/9/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11419#comment:3>

#11419: wxVListBoxComboPopup uses m_itemHeight before it is initialised

----------------------------------+-----------------------------------------
Reporter: manifold | Owner:
Type: defect | Status: infoneeded_new


Priority: normal | Milestone:
Component: GUI-generic | Version: 2.8.10
Keywords: wxOwnerDrawnComboBox | Blockedby:
Patch: 0 | Blocking:
----------------------------------+-----------------------------------------

Changes (by jmsalli):

* status: new => infoneeded_new


Comment:

You could still test if the the order of variable initialization in
wxVListBoxComboPopup::Create() has some effect. That is, by moving
m_itemHeight assignment above the SetItemCount() call. If that does not
fix it, then you are probably better off creating a new ticket with a
clear description of the problem and a minimal sample that reproduces the
bug.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11419#comment:3>

Reply all
Reply to author
Forward
0 new messages