Easier solution to MDI Report Explorer
I have seen a solution to making the Report Explorer an MDI child where it
used a timer and some other tricks (hacks in my opinion) to get it working
(http://www.digital-metaphors.com/tips/ReportExplorerAsMDIChild.zip). Maybe
this has been done in RB7, but I found that changing code in ppRptExp made
the explorer form follow the setting of the FormStyle property. It seems
that this is a bug in 6.03 at least, because why surface the FormStyle
property if it doesn't do anything?
-Jim
procedure TppFormWrapper.PropertiesToForm;
var
lForm: TForm;
begin
lForm := GetForm;
if (lForm = nil) then Exit;
if (csDesigning in ComponentState) then Exit;
lForm.Caption := FFormCaption;
lForm.Icon := FFormIcon;
lForm.FormStyle := FFormStyle; //****** Added this line
if not(TppCustomReportExplorer(lForm).FormSettingsRemembered) then
begin
lForm.WindowState := FFormState;
lForm.Position := FFormPosition;
lForm.Height := FFormHeight;
lForm.Left := FFormLeft;
lForm.Top := FFormTop;
lForm.Width := FFormWidth;
end;
lForm.Tag := FFormTag;
{pass-thru events}
lForm.OnActivate := FOnActivate;
lForm.OnClose := FOnClose;
lForm.OnCloseQuery := FOnCloseQuery;
lForm.OnDeactivate := FOnDeactivate;
lForm.OnHide := FOnHide;
lForm.OnResize := FOnResize;
lForm.OnShow := FOnShow;
end; {procedure, PropertiesToForm}
used a timer and some other tricks (hacks in my opinion) to get it working
(http://www.digital-metaphors.com/tips/ReportExplorerAsMDIChild.zip). Maybe
this has been done in RB7, but I found that changing code in ppRptExp made
the explorer form follow the setting of the FormStyle property. It seems
that this is a bug in 6.03 at least, because why surface the FormStyle
property if it doesn't do anything?
-Jim
procedure TppFormWrapper.PropertiesToForm;
var
lForm: TForm;
begin
lForm := GetForm;
if (lForm = nil) then Exit;
if (csDesigning in ComponentState) then Exit;
lForm.Caption := FFormCaption;
lForm.Icon := FFormIcon;
lForm.FormStyle := FFormStyle; //****** Added this line
if not(TppCustomReportExplorer(lForm).FormSettingsRemembered) then
begin
lForm.WindowState := FFormState;
lForm.Position := FFormPosition;
lForm.Height := FFormHeight;
lForm.Left := FFormLeft;
lForm.Top := FFormTop;
lForm.Width := FFormWidth;
end;
lForm.Tag := FFormTag;
{pass-thru events}
lForm.OnActivate := FOnActivate;
lForm.OnClose := FOnClose;
lForm.OnCloseQuery := FOnCloseQuery;
lForm.OnDeactivate := FOnDeactivate;
lForm.OnHide := FOnHide;
lForm.OnResize := FOnResize;
lForm.OnShow := FOnShow;
end; {procedure, PropertiesToForm}
This discussion has been closed.
Comments
the report explorer in an MDI app. What version of Delphi are you using? Did
you have to make any other changes to our source? Perhaps there is a Delphi
update that fixed the problem we were running into, which we weren't aware
of?
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
and RB 6.03 Pro. I have since also added:
lForm.WindowState := FFormState;
right below the other line I added, so that I can get the window state to
work also. I am sending a demo app for you to look at.
-Jim