Tab movement suppresion in edit mode

TeeGrid VCL for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.

Tab movement suppresion in edit mode

Postby ghanshaw » Fri Jan 12, 2018 6:22 pm

Is there an easy way to suppress the movement from the tab key when in edit mode like there is for the enter key?
I have tried using FormKeyDown logic but it seems to work only every other time the tab key is pressed.
ghanshaw
Newbie
Newbie
 
Posts: 13
Joined: Wed Dec 13, 2017 12:00 am

Re: Tab movement suppresion in edit mode

Postby ghanshaw » Thu Jan 18, 2018 12:04 pm

I have managed to disable the tab movement but have now noticed that use of the arrow keys does not generate any events. How can I track which cell of the grid the user has arrowed to?
ghanshaw
Newbie
Newbie
 
Posts: 13
Joined: Wed Dec 13, 2017 12:00 am

Re: Tab movement suppresion in edit mode

Postby Yeray » Mon Jan 22, 2018 8:58 am

Hello,

I've been able to fire an event when the TAB key is pressed while editing a cell. The problem is the IEditor control in TVCLTeeGrid is "private" and to use it we will have to move it to "protected":

Code: Select all
    procedure CMDialogKey(Var Msg: TWMKey); message CM_DIALOGKEY;


Code: Select all
type TVCLTeeGridAccess=class(TVCLTeeGrid);

procedure TFormGridDataset.CMDialogKey(Var Msg: TWMKEY);
begin
  if (Msg.CharCode = VK_TAB) and (ActiveControl = TVCLTeeGridAccess(TeeGrid1.Grid).IEditor) then
     ShowMessage('TAB key pressed');

  inherited;
end;
Best Regards,

ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image ImagePlease read our Bug Fixing Policy
Yeray
Site Admin
Site Admin
 
Posts: 8369
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia


Return to VCL

Who is online

Users browsing this forum: No registered users and 1 guest