[lazarus] Programmatically showing the listbox of combobox

hernan.et at pg.com hernan.et at pg.com
Wed Jun 11 00:19:02 EDT 2003



>> Hi Jesus,
>>
>> Do you mean, the listbox is not closed/hidden? If you set csdropdownlist
>and the text in the entry is not in the list, it will not close/update the
>combobox.
>>
>
>I mean, if I use MyCombo.DroppedDown:=True (internally, FDroppedDown:=True);
>The listbox shows up, But if I click Outside of the Listbox, the listbox
>disappers normally, its ok,  the problem is that internally FDroppedDown
>doesn't get updated to False so if I test MyCombo.DroppedDown it returns
>True, even when the listbox is hidden!.

This is indeed a problem, I will try to check this at home.

>>
>> Please expound, I don't quite understand what you mean. Or better yet,
>what do you want to do, maybe I can be of help.
>>
>
>A little example, suppose you have a ComboBox filled with 5 items, then
>dropdown the listbox (using the arrow button for example) and select the
>third item and press ENTER, the listbox disappear and now the combobox has
>the focus. If you press the Down Key (VK_DOWN) the fourth item would be
>selected but....
>
>if you previously set up a KeyDown Event for this combobox, it wont get
>called! some way the underlaying gtkwidget is handling this before the LCL
>control, If it is possible, I would like to get this events first in order
>to allow or deny the item selection.

I will also try to experiment this at home. Sorry, I am using Windows while a work.

>There are two cases when this works normally: when the Itemindex:=0 And the
>pressed key is [UP] and when Itemindex:=Items.Count-1 And the pressed key is
>[DOWN], reading the gtk reference it appears that this is so by design as I
>asked before: http://www.lazarus.freepascal.org/archives/msg02335.html
>
>
>The goal I'm seeking here is to allow UP/DOWN keys ONLY IF the listbox is
>poped up and let grid's selection move IF NOT.
>
>What I want is to have Combobox editors in a grid  (mainly with option
>goAlwaysShowEditor) in such way that moving between cells with ComboBox
>Editors will not trap the keyboard focus (and doing unwished item
>selections!) I want free key navigating instead.


Regards,

Yoyong






More information about the Lazarus mailing list