How to manage combo box drop-down size?

Carsten A. Arnholm arnholm at offline.no
Sat Jan 26 15:13:10 PST 2008


Vadim Zeitlin wrote:
> On Sat, 26 Jan 2008 20:00:19 +0100 "Carsten A. Arnholm"
>>
>> 1. I would like to specify the dropdown list heigth in number of
>> items instead of pixels. See SetPopupMaxItems below
>
> I think this could be added to wxOwnerDrawnComboBox itself.

Agreed, although it assumes all items have the same height, it is usually 
true.

>> 2. Mouse wheel scrolling appears a little odd. I.e. unlike a
>> wxComboBox or wxChoice, you cannot use mouse wheel scrolling to
>> select another alternative when the drop down menu is not open.
>
> Hmm, this looks like a bug. I'm not sure why something special needs
> to be done to make this work, but if we do need to do it, it should again
> be done in wxOwnerDrawnComboBox (or maybe wxComboCtrl) itself.

After double checking, I found my other elaborate wxComboCtrl derivation had 
the same problem. Adding a mouse wheel event to it seemed to work.  So it 
might be that wxComboCtrl has that problem.

> Why "+3"? Also, "h" can be obtained directly from
> wxWindow::GetCharHeight().

You are right. "+3" has no place here. It was a leftover from previous 
experiments.  When using wxWindow::GetCharHeight() it becomes trivial. I 
didn't know it existed....

>> This appears almost perfect, scrolling works. Setting the dropdown
>> size works. The only thing I have found is that on Windows you
>> cannot cancel the popup menu with the ESC key when mouse scrolling
>> has been used, without at the same time selecting the currently
>> focused value, i.e. ESC works like pressing Return key. On Linux, no
>> keyboard key presses are have any effect when the popup is open,
>> none of WXK_UP/WXK_DOWN, WXK_ESCAPE, WXK_RETURN work. That is
>> something one would like to have.
>
> Yes, definitely. Unfortunately I really, really have no time for this
> right now but if someone could look into this and provide a patch
> fixing it, it would be most welcome. In the meanwhile, it would also
> be nice  to have a patch adding (and documenting) SetPopupMaxItems()
> and another one for fixing the mouse wheel behaviour.

I am absolutely, totally clueless about which tools to use for producing a 
patch, and where to post it if I made one. Is there a basic step by step 
procedure described somewhere .... ok, found it
http://www.wxwidgets.org/docs/technote/patches.htm
hmmm... I have never used svn. I use bzr.

-- 
Carsten A. Arnholm
http://arnholm.org/
N59.776 E10.457 








More information about the wx-users mailing list