Recent

Author Topic: Find component CheckComboBox  (Read 1839 times)

mikutu

  • New Member
  • *
  • Posts: 14
Find component CheckComboBox
« on: October 30, 2019, 03:09:26 am »
I know there's a tab the misc component TCheckComboBox. He 's not right for me.
I need to see the list of selected items (see attachment)

Handoko

  • Hero Member
  • *****
  • Posts: 5151
  • My goal: build my own game engine using Lazarus
Re: Find component CheckComboBox
« Reply #1 on: October 30, 2019, 06:08:04 am »
Maybe what you need is a TCheckListBox, which is  under Additional tab.

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: Find component CheckComboBox
« Reply #2 on: October 30, 2019, 10:54:00 am »
I know, the Misc TCheckCombobox is not very useful...

You probably are looking for the TJvCheckedCombobox of the JVCL collection. It has not yet been ported to Lazarus, though. I just looked at it: It is at the end of a chain of ancestors which are not ported either. So, not a quick job, and maybe not portable...

As a workaround you could use a normally hidden TCheckListbox in combination with a TEditButton with an OnButtonClick event to show the Checklistbox. As you can see in the attached demo you need only a few dedicated procedures to get a decent behavior. (This most difficult part - to close the checklistbox by clicking somewhere into the form - is not solved, though).
« Last Edit: October 30, 2019, 11:34:23 am by wp »

mikutu

  • New Member
  • *
  • Posts: 14
Re: Find component CheckComboBox
« Reply #3 on: November 01, 2019, 05:01:20 am »
As a workaround you could use a normally hidden TCheckListbox in combination with a TEditButton with an OnButtonClick event to show the Checklistbox.
Thank you. I need a cross platform component (windows, linux). Small problem drop-down list cannot appear outside the form. Is there a component popup container in the lazarus?

Tried to make a component from a TEditButton + TPopupMenu and use ownerDraw. It can display a drop-down list outside the form. This solution has its own problems. Popup menu close after click menu item. No draw custom backround for popup menu in Ununtu 18.04.

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: Find component CheckComboBox
« Reply #4 on: November 01, 2019, 12:03:22 pm »
The attached modification of the former demo puts the checklistbox into a form which allows the dropdown to reach beyond the bounds of the form.

 

TinyPortal © 2005-2018