Recent

Author Topic: Click on icon in TComboBox  (Read 4129 times)

zamtmn

  • Sr. Member
  • ****
  • Posts: 352
Click on icon in TComboBox
« on: May 22, 2011, 06:11:58 pm »
Hi all.

How to handle a click on the icon in the csOwnerDraw TComboBox? I need to when click on the icon to prohibit the selection item is clicked or collapse the list.

Sorry for my english((

Blaazen

  • Hero Member
  • *****
  • Posts: 2780
  • POKE 54296,15
    • Eye-Candy Controls
Re: Click on icon in TComboBox
« Reply #1 on: May 22, 2011, 06:17:50 pm »
Quote
...  I need to when click on the icon to prohibit the selection item is clicked ...
Do you mean something like CheckBoxes in TComboBox ?
Lazarus 2.1.0 r59757M FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

zamtmn

  • Sr. Member
  • ****
  • Posts: 352
Re: Click on icon in TComboBox
« Reply #2 on: May 22, 2011, 06:38:50 pm »
Quote
Do you mean something like CheckBoxes in TComboBox ?
Yes, exactly. CheckBoxes with other icons

zamtmn

  • Sr. Member
  • ****
  • Posts: 352
Re: Click on icon in TComboBox
« Reply #3 on: May 22, 2011, 06:45:34 pm »
Something like this animated gif

Blaazen

  • Hero Member
  • *****
  • Posts: 2780
  • POKE 54296,15
    • Eye-Candy Controls
Re: Click on icon in TComboBox
« Reply #4 on: May 22, 2011, 08:34:38 pm »
I think it is impossible with TComboBox.
The most similar thing I found in Lazarus: Tools -> Configure Build Lazarus ... (done by THeaderControl + TListBox)
You will probably have to do it by combonation of TEdit + TListBox (and you will show/hide TListBox).
Or possibly you can use one TStringGrid or TDrawGrid and change its height (one row / more rows).
And of course you will have to draw your own icons using OnDrawItem events.
At this time I have no idea for simplier solution.
Lazarus 2.1.0 r59757M FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

zamtmn

  • Sr. Member
  • ****
  • Posts: 352
Re: Click on icon in TComboBox
« Reply #5 on: May 22, 2011, 08:59:08 pm »
Thank you. I thought so ((.'ll try to make using TListBox