View Issue Details

IDProjectCategoryView StatusLast Update
0028626LazarusLCLpublic2015-09-06 22:38
ReporterDenis KozlovAssigned ToBart Broersma 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5 (SVN)Product Build 
Target Version1.4.4Fixed in Version1.4.4 
Summary0028626: Spin edits ignore clipboard shortcuts (cut, copy, paste)
DescriptionTSpinEdit, TFloatSpinEdit and any other TCustomFloatSpinEdit descendants are ignoring clipboard shortcuts (cut, copy, paste).

TCustomFloatSpinEdit descends from TCustomEdit, which handles clipboard shortcuts, but TCustomFloatSpinEdit overrides KeyPress method and ignores most of keys, including clipboard shortcut combinations.
Additional InformationFor the reference, TCustomFloatSpinEdit.KeyPress from Lazarus 1.4.2 and TRUNK are same:

procedure TCustomFloatSpinEdit.KeyPress(var Key: char);
begin
  inherited KeyPress(Key);
  if (Key in ['.',',']) then Key := DefaultFormatSettings.Decimalseparator;
  if not (Key in ['0'..'9', DefaultFormatSettings.DecimalSeparator,'+','-',0000008,0000009]) then Key := #0;
  if (Key = DefaultFormatSettings.DecimalSeparator) and (FDecimals = 0) then Key := #0;
end;
TagsNo tags attached.
Fixed in Revisionr49766
LazTarget1.4.4
Widgetset
Attached Files

Activities

Denis Kozlov

2015-09-05 22:46

reporter   ~0085729

A potential fix would be to change TCustomFloatSpinEdit from overriding KeyPress to overriding KeyDown/KeyUp, so that TShiftState is available for inspection. If CTRL key is in shift state then allow any key, since this is usually a shortcut combination.

I can make a patch, if this is the right way to fix this?

Bart Broersma

2015-09-06 00:07

developer   ~0085731

Please test and close if OK.

Denis Kozlov

2015-09-06 02:35

reporter   ~0085736

Seems to work fine, thanks.

Interesting trick with ^C, ^X, ^V, is this a documented feature?

Bart Broersma

2015-09-06 11:39

developer   ~0085740

Yes, ta least since the days of Turbo Pascal 3 (maybe even earlier, but that was my first Pascal compiler).
^C = Chr(3), which at least in PC's is the charcode for Ctrl+C.
Please close this issue.

Issue History

Date Modified Username Field Change
2015-09-05 21:27 Denis Kozlov New Issue
2015-09-05 22:46 Denis Kozlov Note Added: 0085729
2015-09-06 00:03 Bart Broersma Assigned To => Bart Broersma
2015-09-06 00:03 Bart Broersma Status new => assigned
2015-09-06 00:07 Bart Broersma Fixed in Revision => r49766
2015-09-06 00:07 Bart Broersma LazTarget => 1.4.4
2015-09-06 00:07 Bart Broersma Note Added: 0085731
2015-09-06 00:07 Bart Broersma Status assigned => resolved
2015-09-06 00:07 Bart Broersma Fixed in Version => 1.4.4
2015-09-06 00:07 Bart Broersma Resolution open => fixed
2015-09-06 00:07 Bart Broersma Target Version => 1.4.4
2015-09-06 02:35 Denis Kozlov Note Added: 0085736
2015-09-06 11:39 Bart Broersma Note Added: 0085740
2015-09-06 22:38 Denis Kozlov Status resolved => closed