Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-02

Strange ComboBox behavior (Windows)

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Rolf

Hi Lazarus team,

I've two issues with a ComboBox (csDropDown) control in Windows:

1. ComboBox.AutoSelect:=false isn't working. I seems that Windows always
selects the whole ComboBox.Text at activation of the control.

2. Changing the ComboBox.Font (.Style, .Size or .Color) overwrites the ComboBox.Text with the first matching item of ComboBox.Items. ComboBox.Style is csDropDown. Look at this code:

procedure TForm1.SpeedButtonTestClick (Sender: TObject);
begin
   ComboBox1.Clear;
   ComboBox1.Items.Add('Item0');
   ComboBox1.Items.Add('TestItem1');
   ComboBox1.Items.Add('Item2');
   ComboBox1.Text:='Test';
   if fsBold in ComboBox1.Font.Style then
     ComboBox1.Font.Style:=ComboBox1.Font.Style-[fsBold]
   else
     ComboBox1.Font.Style:=ComboBox1.Font.Style+[fsBold];
end;

ComboBox1.Text is set to 'TestItem1'.

I'd a good look into customcombobox.inc and win32wsstdctrls.pp (Windows 10 x64, Lazarus 1.9 57316) trying to analyse this without any idea. Meanwhile I think that both issues are MS Windows ones. But I don't have a Linux environment to check it. Maybe someone else can do?

Is there any interest in a patch to solve MS Windows issues although the patch would add some windows specific code to stdctrls.pp and customcombobox.inc? I've a solution for the "AutoSelect=false" one and an idea for the second one.

Rolf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180220/8320e258/attachment.html>

Reply by email

Ondrej Pokorny
to Rolf
Is there any interest in a patch to solve MS Windows issues although the patch would add some windows specific code to stdctrls.pp and customcombobox.inc? I've a solution for the "AutoSelect=false" one and an idea for the second one.

There definitely is interest in fixing bugs. OS/WS/platform-specific code belongs to the widgetset code: win32wsstdctrls.pp and similar.

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180220/7abce2a7/attachment.html>

Reply by email

Rolf
to Ondrej Pokorny

Hi Ondrej,

I was in doubt but to my own surprise it's possible to patch only win32wsstdctrls.pp for both issues.
Patch is attached. Are you the one to apply it or shall I do something else?

Rolf

------ Originalnachricht ------
Von: "Ondrej Pokorny via Lazarus"
An:
Cc: "Ondrej Pokorny"
Gesendet: 20.02.2018 17:45:40
Betreff: Re: [Lazarus] Strange ComboBox behavior (Windows)

Show quoted text 10 lines
On 20.02.2018 8:40, Rolf Wetjen(rolf.wetjen--- via Lazarus wrote: >Is there any interest in a patch to solve MS Windows issues although >the patch would add some windows specific code to stdctrls.pp and >customcombobox.inc? I've a solution for the "AutoSelect=false" one and >an idea for the second one. There definitely is interest in fixing bugs. OS/WS/platform-specific code belongs to the widgetset code: win32wsstdctrls.pp and similar. Ondrej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180228/b2e97160/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: win32wsstdctrls.pp.patch
Type: application/octet-stream
Size: 11210 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180228/b2e97160/attachment.obj>

Reply by email

Ondrej Pokorny
to Rolf
Rolf Wetjen wrote
I was in doubt but to my own surprise it's possible to patch only win32wsstdctrls.pp for both issues. Patch is attached. Are you the one to apply it or shall I do something else?

Please create a bug report on http://mantis.freepascal.org and attach the patch there. Thank you!
Either I'll take a look at it later (I am leaving now for some time) or maybe some other developer.

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180302/7785b3a9/attachment-0001.html>

Reply by email