View Issue Details

IDProjectCategoryView StatusLast Update
0004219JEDI VCL00 JVCL Componentspublic2007-09-11 16:23
ReporterZENsanAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0004219: JvDBGrid remains unusable if there is TWebBrowser or TEmbeddedWB
DescriptionJvDBGrid remains unusable if there is TWebBrowser or TEmbeddedWB.
Siply put this two components on the same form/frame and After activating WebBrowser you cant control DbGrid.
TagsNo tags attached.

Activities

2007-08-29 06:45

 

Grid.zip (4,811 bytes)

AHUser

2007-09-05 10:40

developer   ~0013733

Last edited: 2007-09-06 12:17

This problem also happens with TDBGrid. But the actual bug is not in the grid. The WebBrowser takes the windows focus, but not the VCL focus. And when you click on the grid, the windows focus doesn't change because the VCL thinks it already has the focus. This causes AquireFocus to fail.

A solution is to implement the WebBrowsers ShowUI event:

function TForm1.EmbeddedWeb_ShowUI(const dwID: Cardinal;
  const pActiveObject: IOleInPlaceActiveObject;
  const pCommandTarget: IOleCommandTarget; const pFrame: IOleInPlaceFrame;
  const pDoc: IOleInPlaceUIWindow): HRESULT;
begin
  if csDesigning in ComponentState then
    Result := S_FALSE
  else
  begin
    try
      if webBrowser.CanFocus then
        webBrowser.SetFocus; // inform the VCL that the browser has the vcl focus
    except
    end;
    Result := S_FALSE;
  end;
end;

ZENsan

2007-09-06 07:47

reporter   ~0013746

Many thanks! It works perfectly. Genius!

Issue History

Date Modified Username Field Change
2007-08-29 06:45 ZENsan New Issue
2007-08-29 06:45 ZENsan File Added: Grid.zip
2007-09-05 10:40 AHUser Note Added: 0013733
2007-09-05 10:44 AHUser Status new => feedback
2007-09-06 07:47 ZENsan Note Added: 0013746
2007-09-06 12:17 AHUser Note Edited: 0013733
2007-09-11 16:23 AHUser Status feedback => resolved
2007-09-11 16:23 AHUser Resolution open => fixed
2007-09-11 16:23 AHUser Assigned To => AHUser