View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001786||JEDI VCL||00 JVCL Components||public||2004-05-20 05:51||2004-05-20 07:04|
|Reporter||Markus Spoettl||Assigned To||marcelb|
|Target Version||Fixed in Version|
|Summary||0001786: JvInspector: Major Problem with usage of SetFocus|
there is a major problem in JvInspector which is caused by how
TJvCustomInspectorItem.SetEditCtrl(const Value: TCustomEdit);
is implemented. Assume the following situation:
1) One Inspector and a list view on a form
2) When the item changes in the list view
Inspector.RefreshValues is called
3) Now, set the focus to an inspector item so
that the editor becomes visible
4) Click another item in the list.
What SHOULD happen now is that the input focus is removed from the inspector and set to the list view. However, the inspector forces the focus onto itself, apparently assuming that the edit control had the focus. that should never happen.
What happens is that you have to click the list view twice, the first time the focus get removed from the editor to the inspector, the second time it is really removed.
Another problem is that the inspector never really gets out of editing if you call RefreshValues because it automatically creates an editor (which it shouldn't if it doesn't have the focus).
|Tags||No tags attached.|
||Well, that's a nice bug. Increased the priority. Better report the second issue separately though.|
||There is no second issue, it's the same problem - the control should never set the focus to itself - at least not without checking whether the editor had the focus previously.|
Interestingly enough, I can't replicate your first issue. AFAICT, SetEditCtrl does set focus when it shouldn't, so I added a test to see if the editor had focus:
if Inspector.CanFocus and EditCtrl.Focused then
EditCtrl.WindowProc := Edit_WndProc;
InitEdit will only focus the editor if the inspector has the focus, so RefreshValues should not force the focus to the inspector, unless the current editor had the focus (in which case, the recreated editor get's the focus anyway).
BTW, an editor is created as soon as an inspector item is selected. It should obviously not get focus if the inspector doesn't have it, but TJvCustomInspectorItem.InitEdit handles that OK. So, perhaps the change outlined above corrected the issue (don't know, since I couldn't replicate it anyway). If it does, I'll commit the change. If not, I'll need a small test project that does exhibit this issue.
||Yes, that works, Thank!|
||Great! I'll commit the change. Still wondering why I didn't get a focus problem though...|
|2004-05-20 05:51||Markus Spoettl||New Issue|
|2004-05-20 06:18||marcelb||Note Added: 0004306|
|2004-05-20 06:18||marcelb||Assigned To||=> marcelb|
|2004-05-20 06:18||marcelb||Priority||normal => high|
|2004-05-20 06:18||marcelb||Status||new => assigned|
|2004-05-20 06:28||Markus Spoettl||Note Added: 0004307|
|2004-05-20 06:50||marcelb||Note Added: 0004308|
|2004-05-20 06:59||Markus Spoettl||Note Added: 0004309|
|2004-05-20 07:04||marcelb||Status||assigned => resolved|
|2004-05-20 07:04||marcelb||Resolution||open => fixed|
|2004-05-20 07:04||marcelb||Note Added: 0004310|