Recent

Author Topic: Show cell editor only when left mouse button clicked in TDBGrid  (Read 299 times)

artem101

  • New member
  • *
  • Posts: 5
Show cell editor only when left mouse button clicked in TDBGrid
« on: September 19, 2020, 05:22:20 pm »
I have AutoEdit option in my DBGrid enabled and editor appears on either right or left mouse button double click. This is not very suitable for me, because I have context menu on right button. Is it possible to enter cell`s editor only with left button?

Blaazen

  • Hero Member
  • *****
  • Posts: 2965
  • POKE 54296,15
    • Eye-Candy Controls
Re: Show cell editor only when left mouse button clicked in TDBGrid
« Reply #1 on: September 19, 2020, 05:39:28 pm »
Do you have goAlwaysShowEditor in Options?
Lazarus 2.1.0 r64074 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

artem101

  • New member
  • *
  • Posts: 5
Re: Show cell editor only when left mouse button clicked in TDBGrid
« Reply #2 on: September 19, 2020, 07:23:01 pm »
Do you have goAlwaysShowEditor in Options?
No.


Only these options enabled:
Quote
[dgEditing,
dgTitles,
dgIndicator,
dgColumnResize,
dgColumnMove,
dgColLines,
dgRowLines,
dgTabs,
dgAlwaysShowSelection,
dgConfirmDelete,
dgCancelOnExit,
dgAnyButtonCanSelect,
dgCellEllipsis]
« Last Edit: September 19, 2020, 07:26:50 pm by artem101 »

artem101

  • New member
  • *
  • Posts: 5
Re: Show cell editor only when left mouse button clicked in TDBGrid
« Reply #3 on: September 22, 2020, 02:33:26 pm »
Is it possible to get pressed mouse button in SelectEditor event and set editor to nil like this:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.ItemsGridSelectEditor(Sender: TObject; Column: TColumn;
  2.   var Editor: TWinControl);
  3. begin
  4.   if IsRightButtonPressed() then
  5.      Editor := nil;
  6. end;  

 

TinyPortal © 2005-2018