Lazarus

Programming => LCL => Topic started by: jamie on June 07, 2021, 03:06:52 pm

Title: Strange abnormally with TCheckComboBox on the Misc tab.
Post by: jamie on June 07, 2021, 03:06:52 pm
Drop a TCheckComBoBox on the form..

Add some items to it ..

Run the project.

Click on the Edit part, it opens and allows you to select one. Do that, select an item and now the list should close.

now go over to the edit part again, click in it or click the check mark that is in the edit and the list will open again. But this time if you keep clicking on the edit part, it will just stay open. I guess that is ok..

 But this Is the problem, when you get to that point where you can click the edit part and the list refreshes itself to stay open, now go over to the FORM title caption and move the form. What you will see is instead of the list closing like it should it becomes detached and floating on the form or anywhere on your screen and it is still interactive..
 
 You need to click the down arrow on the edit part to actually close it then.

I think this most likely only happens in Winders as a side effect of an attempt to reject the closing of the list.


EDIT:
  Oh btw, have a good day  :D


Title: Re: Strange abnormally with TCheckComboBox on the Misc tab.
Post by: Joanna on October 03, 2021, 06:55:52 am
I’ve started using tcheckcombobox recently and there don’t seem to be a lot of people around who are familiar with it.

Here’s another anomaly in behavior I discovered.

Create a checkcombobox and put some strings in it and set index to zero.

Get focus on it without clicking. Hit return key several times and you will see that it toggles the checked status of the selected item.
Now click it and it will drop down and press return again and it crashes with external SIGSEGV error
Location 77503560
Function ntdll!rtlappendstringtostring

I have no idea why it does this and the only way I can think of to stop it is intercepting the return key so it never reaches combobox.

Also the dropdown often gets stuck and is impossible to close.
Title: Re: Strange abnormally with TCheckComboBox on the Misc tab.
Post by: jamie on October 03, 2021, 01:39:05 pm
That control requires rework. It does have issues.

I would suggest for the time being to use a TComboBox in Owner draw mode.

If you need a sample code project to should how I can provide  :-*
Title: Re: Strange abnormally with TCheckComboBox on the Misc tab.
Post by: Bart on October 03, 2021, 03:55:19 pm
It does have issues.

Indeed it does, I listed some on the bugreport (https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39412) Joanna opened.

Also, I would expect that pressing the spacebar (when dropped down) would toggle the checked state of an item.
I must agree with wp: it's a rather useless control ATM.

Bart
Title: Re: Strange abnormally with TCheckComboBox on the Misc tab.d
Post by: Joanna on October 03, 2021, 04:06:03 pm
Do you know when the last time it was worked on was?
 Mine crashes when I press return when selected item is checked it seems but i don’t know if this happens with newer clients.
 
In Linux 2.0.10 it doesn’t seem to crash.

Thanks for the offer, have already mostly figured out how to get it to do the pretty colors by overriding the drawitem event...So I won’t need to resort to using tcombobox.  :D
It’s part of my project to Generate sql for filtering  columns in a database grid by numerical values. I’m going to add some buttons for select and clear all to make it less work to use.

Bart I read some old forum. Posts about it and apparently it was a difficult control to make . I really like this control because of its compactness.

With my lazarus version the space bar closes the dropdown. If it is not dropped down the checked status of selected one is toggled.

TinyPortal © 2005-2018