Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
6544 00 JVCL Components minor always 2017-01-26 15:42 2018-12-18 18:59
akalwa  
 
normal  
feedback Daily / GIT  
open  
none    
none  
0006544: TJvCustomComboEdit (and descendants) ignore the user's caret width setting
Windows allows users to change the caret width (text cursor width) to more than the default 1 pixel. While all contols derived from TCustomEdit work as expected, TJvCustomComboEdit and descendants ignore the user's setting.

The bug is in TJvCustomComboEdit.SetShowCaret().
Here the caret size is set as either 1 or 2 pixel, depending on the font's bold style. But that is not Windows' behaviour. Caret is usually not changed on font style. Instead the caret width should be read from the system settings:

procedure TJvCustomComboEdit.SetShowCaret;
var
  CaretWidth : Integer;
begin
  if not SystemParametersInfo(SPI_GETCARETWIDTH, 0, @CaretWidth, 0) then
  begin
    CaretWidth := 1;
    if fsBold in Font.Style then
      Inc(CaretWidth);
  end;
  CreateCaret(Handle, 0, CaretWidth, GetTextHeight);
  ShowCaret(Handle);
end;
Control Panel -> Ease of Access Center -> Make the computer easier to see ->
Set the thickness of the blinking cursor
Change the default width from 1 to 3 pixel and apply the changes.

https://techjourney.net/increase-the-thickness-of-blinking-cursor-in-windows/ [^]
zip file icon CaretWidth.zip [^] (1,491 bytes) 2018-07-18 22:18
? file icon JvToolEdit.pas.patch [^] (668 bytes) 2018-07-18 22:22
Issue History
2017-01-26 15:42 akalwa New Issue
2018-07-18 15:52 obones Note Added: 0021520
2018-07-18 15:52 obones Status new => feedback
2018-07-18 22:18 akalwa File Added: CaretWidth.zip
2018-07-18 22:22 akalwa Note Added: 0021559
2018-07-18 22:22 akalwa File Added: JvToolEdit.pas.patch
2018-07-18 22:23 akalwa Note Added: 0021560
2018-12-18 18:59 akalwa Note Added: 0021600

Notes
(0021520)
obones   
2018-07-18 15:52   
Could you check if the issue is still present in the latest GIT content? If yes, please provide the zipped sources of an application showing this.
(0021559)
akalwa   
2018-07-18 22:22   
The bug is still there in current git revision. The code in JvToolEdit.pas TJvCustomComboEdit.SetShowCaret() has not been changed.

I've attached a small demo application.
Compile and run the application; open Windows caret settings and change caret with to 4 or higher.
Switch back to the demo application and put focus to the TEdit box; the new caret width will be used. Put focus to the TJvComboEdit box; caret width is still 1.

Please apply attached patch to fix this bug (Sorry, no pull request; still using TortoiseSVN to access the master repository).
(0021560)
akalwa   
2018-07-18 22:23   
On Windows 10, just type "Caret" into the start menu to open the settings.
(0021600)
akalwa   
2018-12-18 18:59   
Any news on this?
Please someone grab the attached patch from 2018-07-18 and apply it the current source code. TIA