View Issue Details

IDProjectCategoryView StatusLast Update
0003266JEDI VCL00 JVCL Componentspublic2005-10-16 01:49
ReporterelahnAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.10 
Summary0003266: JvDateEdit Focus Bug
DescriptionSteps 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,
           Elahn
TagsNo tags attached.

Activities

2005-10-15 08:52

 

JvDateEdit_Focus_Bug.zip (1,036 bytes)

2005-10-15 12:35

 

JvToolEdit.zip (31,445 bytes)

elahn

2005-10-15 12:36

developer   ~0008031

Fixed in attached JvToolEdit.zip.

In TJvCustomComboEdit.FocusSet, check if GetFocus = Handle before calling SetShowCaret.

AHUser

2005-10-16 01:49

developer   ~0008032

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: JvDateEdit_Focus_Bug.zip
2005-10-15 12:35 elahn File Added: JvToolEdit.zip
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