[lazarus] Programmatically showing the listbox of combobox

hernan.et at pg.com hernan.et at pg.com
Sun Jun 15 19:09:35 EDT 2003


Hi Jesus,

Regarding your question whether it is possible to have a milti-column listbox, well it is possible. If you have time reading the gtk reference,
you will find that the list of items that can be displayed by the GtkCombo can be any item that is PGtkItem, or was it PgtkWidget????
So basically, you can pack any controls you want into the list for GtkCombo? But I am not sure if we can put some headers and footers.
Maybe it is better to implement it ourselves not relying onto GtkCombo list property.

BTW, any updates on your TDBGrid unit. It seems to have a problem with current version of lazarus. I have tried it at home,
 it gives some AV on DC brushes or something like that.

Regards,

Yoyong
>> Hi Jesus,
>>
>> I have played around the combobox implementation and here is what I got.
>>
>> If you need to trap arrow keys, we need the attached patch. And as for the
>> FDroppedDown not updated, I am still working on it. If I may ask, why
>would you
>> need to check the value of FDroppedDown.
>
>I need the combobox to send the keyboard events to the parent grid in order
>to allow
>normal grid navigation
>
>I will be happy if I could get the following::
>
>    1. the combobox IS dropped down.
>
>        1.1.    UP/DOWN key events    =>    Item focus
>        1.2.    LEFT/RIGHT key events    =>    Item focus or Grid navigation
>???
>        1.3.    ENTER key event  =>    Focused item is now the selected
>Item, hide listbox.
>        1.4.    ESC key event    =>    Selected item remains without
>changes, hide listbox
>        1.5.    CTRL+DOWN    =>    Same as ESC
>        1.6.    Typing Text    =>    Incremental search  (item focusing)
>
>    2. the combobox IS NOT dropped down.
>
>        2.1.    UP/DOWN key events    =>    Grid navigation
>        2.2.    LEFT/RIGHT key events    =>    Grid navigation
>        2.3.    ENTER key event  =>    unhandled or same as 2.5 ???
>        2.4.    ESC key event    =>    unhandled
>        2.5.    CTRL+DOWN    =>    drop down the listbox to allow 1.1,1.2 or
>1.6
>        2.6.    Typing Text =>{Dropdown the listbox ???,}Inc. search (item
>selection)
>
>The way is now, it sometimes does Item selection and sometimes Grid
>navigation, depending on the current item selection! (2.1).
>
>If the lcl combobox will get all key events (being the listbox droppedown or
>not), I need a way to know when to do Item Selection or grid navigation and
>this depends on DroppedDown Property, at least in the way I planned.
>
>> In my program, when I set Style to
>> csDroppedDown, AutoDropDown = True, and I type something on the entry box
>I
>> cannot get out of the listbox not unless I select an item from the list.
>> Also,
>> if you need to trap VK_UP or VK_DOWN, the attached file adds another
>property
>> for the combo box  name ArrowKeysTraverseList with a default value of
>True. This
>> is the defualt behaviour of the combo box(gtk widget default behaviour),
>> especially if you set style to csdropdownlist. Now if you set
>> ArrowKeysTraverseList to False and AutoDroppedDown to false and I am not
>sure
>> style to csdroppedownlist you should be able to trap VK_UP or VK_DOWN. And
>also
>> the patch implemented the key sequence Ctrl+Down to show the popup.
>>
>> Regards
>>
>> Yoyong
>>
>
>Thank you, It sounds nice I will update as soon the patches are in cvs ;)
>
>What do you think, are we asking to much to gtk?. I'm asking this because
>for example, if I need a multicolumn listbox, with headers, footers and
>other goodies, does the underlaying gtkwidget provide such functionality or
>we need to wrap another one. if this is the case, aren't we being too gtk
>dependant? I mean what if others interfaces doesn't have a so-similar
>widget?.
>
>Thanks.
>
>Jesus Reyes A.







More information about the Lazarus mailing list