Recent

Author Topic: Reporting a Bug? in StringGrid  (Read 1277 times)

Derz

  • New Member
  • *
  • Posts: 33
Reporting a Bug? in StringGrid
« on: February 14, 2026, 09:05:14 pm »
One of the bugs I addressed in a descendant of tStringGrid appears to be in the latest release (4.4).  Is there a more appropriate place to post suspected bugs?

It has to do with Cut, Copy, and Paste Keyboard shortcuts.  I don't know about other OS's, but in Windows these are normally CNTL-X, CNTL-C, and CNTL-V

From the existing code in Grids.pas, procedure TCustomGrid.KeyDown, CUT uses the shift state of ssShift instead of ssModifier, which is defined as ssCntl.

Code: Pascal  [Select][+][-]
  1.     VK_C:
  2.       if not FEditorKey and (Shift = [ssModifier]) then
  3.         doCopyToClipboard;
  4.     VK_V:
  5.       if not FEditorKey and (Shift = [ssModifier]) then
  6.         doPasteFromClipboard;
  7.     VK_X:
  8.       if not FEditorKey and (Shift = [ssShift]) then
  9.         doCutToClipboard;
  10.  

And while addressing this, Windows also supports the INSERT and DELETE keys for Cut, Copy and Paste accelerators.
  • CUT=ssShift+VK_Delete
    COPY=ssCntl+VK_Insert
    PASTE=ssShift+VK_Insert

Pressing DELETE without a shift state and while not editing a cell should delete the selection.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12170
  • Debugger - SynEdit - and more
    • wiki
Re: Reporting a Bug? in StringGrid
« Reply #1 on: February 14, 2026, 09:21:35 pm »
There is a link to the bugtracker on the left of the forum. https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues

In this case you don't need to report anymore, I just picked it up right now from your report here.
But in general reports on the forum are often not seen, or they are lost, if they can't be acted on immediately.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12170
  • Debugger - SynEdit - and more
    • wiki
Re: Reporting a Bug? in StringGrid
« Reply #2 on: February 14, 2026, 09:25:35 pm »
And while addressing this, Windows also supports the INSERT and DELETE keys for Cut, Copy and Paste accelerators.
  • CUT=ssShift+VK_Delete
    COPY=ssCntl+VK_Insert
    PASTE=ssShift+VK_Insert

Pressing DELETE without a shift state and while not editing a cell should delete the selection.

Those you should still report, please

Derz

  • New Member
  • *
  • Posts: 33
Re: Reporting a Bug? in StringGrid
« Reply #3 on: February 14, 2026, 10:04:33 pm »
Martin,  Thank you.

I went to GitLab and began the process of creating a new account.  It got to personal.  I didn't mind giving them my Google account, nor my EMAIL, but I would not give them a cell phone number.  I do not give that out without an important reason.  This doesn't qualify.  But thanks for the information.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12170
  • Debugger - SynEdit - and more
    • wiki
Re: Reporting a Bug? in StringGrid
« Reply #4 on: February 14, 2026, 10:26:33 pm »
I never had to give them any detail but my email. Though that is a while back.

I heard people having issues, IIRC it was usually resolved by finding a gray on gray link to skip the required info. But then I don't know if/when and what changed.

Maybe someone who recently created an account will read this and can comment.

Bart

  • Hero Member
  • *****
  • Posts: 5701
    • Bart en Mariska's Webstek
Re: Reporting a Bug? in StringGrid
« Reply #5 on: February 14, 2026, 11:17:08 pm »
And while addressing this, Windows also supports the INSERT and DELETE keys for Cut, Copy and Paste accelerators.
  • CUT=ssShift+VK_Delete
    COPY=ssCntl+VK_Insert
    PASTE=ssShift+VK_Insert

[rant]
It used to be, but at least in Office 365 (at least in Outlook), MS has abandonded that idea: Shift+Del is now the same as Del.
I was used to do Shift+Del, then Ctrl+V to move a selection, but those day have gone.
[/rant]

Bart

wp

  • Hero Member
  • *****
  • Posts: 13396
Re: Reporting a Bug? in StringGrid
« Reply #6 on: February 15, 2026, 01:04:42 am »
And while addressing this, Windows also supports the INSERT and DELETE keys for Cut, Copy and Paste accelerators.
  • CUT=ssShift+VK_Delete
    COPY=ssCntl+VK_Insert
    PASTE=ssShift+VK_Insert

[rant]
It used to be, but at least in Office 365 (at least in Outlook), MS has abandonded that idea: Shift+Del is now the same as Del.
I was used to do Shift+Del, then Ctrl+V to move a selection, but those day have gone.
[/rant]

Bart
Having Office 2016 only, but in this Excel the old key combinations CTRL+INS, SHIFT+INS, SHiFT_DEL are still working as I am used to.

Maybe we should add a property ClipboardCommands = set of [ccCXV, ccInsDel]? (Or: [ccModern, ccOldStyle])
« Last Edit: February 15, 2026, 01:08:51 am by wp »

Bart

  • Hero Member
  • *****
  • Posts: 5701
    • Bart en Mariska's Webstek
Re: Reporting a Bug? in StringGrid
« Reply #7 on: February 15, 2026, 01:48:34 am »
Maybe we should add a property ClipboardCommands = set of [ccCXV, ccInsDel]? (Or: [ccModern, ccOldStyle])

Nah, we should just support them all.
We're not MS after all.
We can be trusted.

Bart

Derz

  • New Member
  • *
  • Posts: 33
Re: Reporting a Bug? in StringGrid
« Reply #8 on: February 15, 2026, 08:44:50 pm »
Someone else will have to pursue this if important to them.  I will not give GitLab by cell number.  They offered a credit card option for verification.  Daah. :(

I have addressed this for myself in a descendant class.  But I agree with Bart-  there is no harm.  I also acknowledge that MS has abandoned it in newer releases.

Code: Pascal  [Select][+][-]
  1. And while addressing this, Windows also supports the INSERT and DELETE keys for Cut, Copy and Paste accelerators.
  2.  
  3.     CUT=ssShift+VK_Delete
  4.     COPY=ssCntl+VK_Insert
  5.     PASTE=ssShift+VK_Insert

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12170
  • Debugger - SynEdit - and more
    • wiki
Re: Reporting a Bug? in StringGrid
« Reply #9 on: February 15, 2026, 08:54:22 pm »
Question, what if the grid would work with actions?

Then you could assign any keycombo to a TCopyAction, and if the grid has focus, the action will be executed for the grid.

Of course, the issue is, that by now there are apps that have actions and grids, and rely on no interaction. Maybe TCustomGrid.___Action__ either bool, or set to indicate which actions?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12170
  • Debugger - SynEdit - and more
    • wiki
Re: Reporting a Bug? in StringGrid
« Reply #10 on: February 15, 2026, 09:04:22 pm »
I just test signed up to gitlab.

All I needed was an email (I don't know if it matters that this email was on my own domain, rather than some free email). I got an email with a code to confirm my mail.
That was it.
I was not ask for any other details.

I did pick, that I would use the account "for myself" and "other" as role.

And that account allows me to proceed to the bug tracker and start writing a new issue in Lazarus. I did not submit anything right now, since I am not planing to keep that account.

Bart

  • Hero Member
  • *****
  • Posts: 5701
    • Bart en Mariska's Webstek
Re: Reporting a Bug? in StringGrid
« Reply #11 on: February 15, 2026, 09:44:34 pm »
B.t.w. When the grid is in edit mode, the editor itself should (out of the box) support all common shortcust for copy/cut/paste, since they are "normal" edit controls (liek TEdit, TComboBox etc.).

Bart

wp

  • Hero Member
  • *****
  • Posts: 13396
Re: Reporting a Bug? in StringGrid
« Reply #12 on: February 15, 2026, 11:54:41 pm »
Yes, but the clipboard commands CTRL+C/+X/+V are working also when the grid is not in edit mode:

- Make sure that goAlwaysShowEditor is off (but goEditing is on, of course).

- Click in any non-empty cell (note that edit mode is not entered), press CTRL+C.
- Click in any other cell, press CTRL-V.
- The text is copied.

BUT:
- Click in any non-empty cell, press CTRL+INS
- Click in any other cell, press SHIFT+INS
- Nothing happens.

Zvoni

  • Hero Member
  • *****
  • Posts: 3294
Re: Reporting a Bug? in StringGrid
« Reply #13 on: February 16, 2026, 08:26:17 am »
And while addressing this, Windows also supports the INSERT and DELETE keys for Cut, Copy and Paste accelerators.
  • CUT=ssShift+VK_Delete
    COPY=ssCntl+VK_Insert
    PASTE=ssShift+VK_Insert

[rant]
It used to be, but at least in Office 365 (at least in Outlook), MS has abandonded that idea: Shift+Del is now the same as Del.
I was used to do Shift+Del, then Ctrl+V to move a selection, but those day have gone.
[/rant]

Bart
Errr.... SHIFT+DEL (on Windows at least) was always "DELETE without going to the Paperbin" (no restore possible) as far as i can remember back.
In Explorer, Outlook, everywhere.
If there's no Paperbin available (e.g. Deleting a File on a Fileserver), DEL behaves the same as SHIFT+DEL

Am i missing something?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Bart

  • Hero Member
  • *****
  • Posts: 5701
    • Bart en Mariska's Webstek
Re: Reporting a Bug? in StringGrid
« Reply #14 on: February 16, 2026, 03:19:56 pm »
Errr.... SHIFT+DEL (on Windows at least) was always "DELETE without going to the Paperbin" (no restore possible) as far as i can remember back.

In all ediatbe controles Shift+Del was "Cut".
I've been using this for ages now and Office 365 just killed that.
I can't type "blind", so i tend to see the effects of my typeing only after a few seconds, and this has bitten me in the @ss:I do Shift+Del, then at some other place Ctrl+V and some old text from the clipboard gets pasted.

I'm now typing this in Edge: and in Edge Shift+Del still does "Cut", not "Delete".

Bart

 

TinyPortal © 2005-2018