Author Topic: In Grid Control push Enter?  (Read 6143 times)

Aleksandr Tkachenko

  • Member
  • *
  • Posts: 61
In Grid Control push Enter?
« on: July 29, 2008, 05:04:00 AM »
Why Forms is closing when cursor in Grid and push Enter?

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2101
Re: In Grid Control push Enter?
« Reply #1 on: July 30, 2008, 03:53:35 AM »
Hello,

you can avoid that using the CancelClose event of the form. I do this, too.

Code: [Select]
(defun cancel_edit ()
  (if isLabelEdit (dcl_Grid_CancelItemEdit MyGrid))
); cancel_edit

(defun c:OnCancelClose (isESCWasPressed)
  (cancel_edit)
  (/= isESCWasPressed 1) ;; avoids closing form after ENTER
); CancelClose

(defun c:OnBeginLabelEdit (intRow ontCol)
  (setq isLabelEdit T)
  ;; ... someting else, too
); c:OnBeginLabelEdit

(defun c:OnEndLabelEdit (intRow ontCol)
  ;; ... someting else, too
  (setq isLabelEdit nil)
); c:OnBeginLabelEdit

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Aleksandr Tkachenko

  • Member
  • *
  • Posts: 61
Re: In Grid Control push Enter?
« Reply #2 on: July 31, 2008, 04:26:20 AM »
Thank you Fred, it's worked.