View Issue Details

IDProjectCategoryView StatusLast Update
0006198JEDI VCL00 JVCL Componentspublic2015-09-14 13:20
ReporterZENsanAssigned ToAHUser 
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindowsOSWindows 7OS Version
Product VersionDaily / GIT 
Target VersionFixed in Version3.48 
Summary0006198: SetFocus called without check for CanFocus
DescriptionIssue very similar to QC111284 entry. In the TJvDBDateTimePicker.KeyPress event there is an issue:
  ...
  case Key of
    0000032..0000255:
      FDataLink.Edit;
    Esc:
      begin
        FDataLink.Reset;
        SetFocus; <- You cant call SetFocus without checking for CanFocus (at least);
        Key := #0;
      end;
  end;
TagsNo tags attached.

Activities

2013-09-09 10:14

 

JvDBDateTimePicker.patch (332 bytes)
--- C:/COMPS/JVCL/run/JvDBDateTimePicker2.pas	pr sep  9 11:13:34 2013
+++ C:/COMPS/JVCL/run/JvDBDateTimePicker.pas	pr sep  9 11:13:46 2013
@@ -426,8 +426,7 @@ begin
     Esc:
       begin
         FDataLink.Reset;
-        if CanFocus then
-          SetFocus;
+        SetFocus;
         Key := #0;
       end;
   end;

AHUser

2013-09-09 17:54

developer   ~0020635

How does the TJvDBDateTimePicker receive the ESC key if it isn't visible or enabled? What function emulated the key press in your case?

ZENsan

2013-09-09 17:57

reporter   ~0020636

Elementary! KeyPreview = True on TForm, Escape key hides the form and then the control receives also the KeyDown/Keypress events, but in that moment we already cant set the focus!

ZENsan

2013-09-09 17:57

reporter   ~0020637

No emulation :)

AHUser

2013-09-09 18:25

developer   ~0020638

Fix in master.

Issue History

Date Modified Username Field Change
2013-09-09 10:14 ZENsan New Issue
2013-09-09 10:14 ZENsan File Added: JvDBDateTimePicker.patch
2013-09-09 17:54 AHUser Note Added: 0020635
2013-09-09 17:54 AHUser Status new => feedback
2013-09-09 17:57 ZENsan Note Added: 0020636
2013-09-09 17:57 ZENsan Note Added: 0020637
2013-09-09 18:25 AHUser Note Added: 0020638
2013-09-09 18:25 AHUser Status feedback => resolved
2013-09-09 18:25 AHUser Fixed in Version => Daily / SVN
2013-09-09 18:25 AHUser Resolution open => fixed
2013-09-09 18:25 AHUser Assigned To => AHUser
2015-09-14 13:20 obones Fixed in Version Daily / GIT => 3.48