Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003266 [JEDI VCL] 00 JVCL Components minor always 2005-10-15 08:52 2005-10-16 01:49
Reporter elahn View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0003266: JvDateEdit Focus Bug
Description Steps to reproduce:

(Steps 1 & 2 are already done in example program)

1. Drop a TMaskEdit on a form & set the EditMask property
2. Drop a TJvDateEdit on a form
3. Run
4. Type in some invalid text in the TMaskEdit
5. Press TAB
6. Click OK to the error message.
7. Continue typing in the TMaskEdit.

You will notice that the cursor appears in the TJvDateEdit, even though the TMaskEdit still has the focus.

enjoy life,
Additional Information
Tags No tags attached.
Attached Files zip file icon [^] (1,036 bytes) 2005-10-15 08:52
zip file icon [^] (31,445 bytes) 2005-10-15 12:35

- Relationships

-  Notes
elahn (developer)
2005-10-15 12:36

Fixed in attached

In TJvCustomComboEdit.FocusSet, check if GetFocus = Handle before calling SetShowCaret.
AHUser (developer)
2005-10-16 01:49

Fixed in CVS.

The main problem is that FocusSet is the handler for WM_SETFOCUS. And WM_SETFOCUS is captured by the VCL to make OnExit and OnEnter working. So the "inherited FocusSet" triggers the OnExit event of the other control which shows the error dialog and sets the focus to itself.

Windows.GetFocus does not always work because it returns the currently focused control and that could change very fast to another control. And it is a pain when Debugging because you always get the handle of a Delphi/BCB window.
Better use "Screen.ActiveControl = Self". The VCL knowns which control has the focus. And this does not change while debugging.

- Issue History
Date Modified Username Field Change
2005-10-15 08:52 elahn New Issue
2005-10-15 08:52 elahn File Added:
2005-10-15 12:35 elahn File Added:
2005-10-15 12:36 elahn Note Added: 0008031
2005-10-16 01:49 AHUser Status new => resolved
2005-10-16 01:49 AHUser Resolution open => fixed
2005-10-16 01:49 AHUser Assigned To => AHUser
2005-10-16 01:49 AHUser Note Added: 0008032

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker