Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006544 [JEDI VCL] 00 JVCL Components minor always 2017-01-26 15:42 2018-07-18 22:23
Reporter akalwa View Status public  
Assigned To
Priority normal Resolution open  
Status feedback   Product Version Daily / GIT
Summary 0006544: TJvCustomComboEdit (and descendants) ignore the user's caret width setting
Description 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;
Additional Information 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/ [^]
Tags No tags attached.
Attached Files 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

- Relationships

-  Notes
(0021520)
obones (administrator)
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 (reporter)
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 (reporter)
2018-07-18 22:23

On Windows 10, just type "Caret" into the start menu to open the settings.

- Issue History
Date Modified Username Field Change
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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker