Discussion:
Expert is not visible
(too old to reply)
AlexB
2008-06-04 05:51:40 UTC
Permalink
Hi all.

I have a strange problem.

If I install my expert in IDE (right click in progect manager->Install)
I can invoke the expert with click on a specially added 'Tools' menu
item; I see the expert's form and all works like a charm.

But clicking menu (my menu item is still in the right place) doesn't
show the form after restarting of the IDE; IDE caption becomes inactive
but exspert is invisible. It looks like the expert becomes active but
it is offscreen or in wrong Z-order. Now I can start a dummy test
project (expert is still invisible and I can't show it by repeated menu
clicks); but arter finish of the dummy progect the expert becomes
visible and all works like a charm again!

I use the DockingForm example from "Erik's Open Tools API FAQ and
Resources" page (http://www.gexperts.org/opentools/):

unit BaseDockForm;
...
procedure ShowDockableForm(Form: TBaseDockableForm);
begin
if not Assigned(Form) then
Exit;
if not Form.Floating then
begin
Form.ForceShow;
FocusWindow(Form);
end
else
Form.Show;
end;

I've already tried to add

Form.Visible:=true;
Form.BringToFront();
Form.Activate;

in different combination with no luck ...

Can anyone help?

TIA
--
Alex
Erik Berry
2008-06-08 23:55:29 UTC
Permalink
Post by AlexB
But clicking menu (my menu item is still in the right place) doesn't
show the form after restarting of the IDE; IDE caption becomes inactive
but exspert is invisible. It looks like the expert becomes active but
it is offscreen or in wrong Z-order. Now I can start a dummy test
project (expert is still invisible and I can't show it by repeated menu
clicks); but arter finish of the dummy progect the expert becomes
visible and all works like a charm again!
After trying to show your form, print out a debug message containing the
form's Top/Left, Height/Width, Visible, Position, FormStyle, WindowState, and
Parent.Name (if available) and see if the form is really in the location and
state you expect.

Erik
AlexB
2008-06-09 05:32:02 UTC
Permalink
Post by Erik Berry
After trying to show your form, print out a debug message containing
the form's Top/Left, Height/Width, Visible, Position, FormStyle,
WindowState, and Parent.Name (if available) and see if the form is
really in the location and state you expect.
OK, I'll try it.
But I quite sure that all values are in proper ranges ...
--
Alex
AlexB
2008-06-10 07:07:19 UTC
Permalink
Post by AlexB
Post by Erik Berry
After trying to show your form, print out a debug message containing
the form's Top/Left, Height/Width, Visible, Position, FormStyle,
WindowState, and Parent.Name (if available) and see if the form is
really in the location and state you expect.
OK, I'll try it.
But I quite sure that all values are in proper ranges ...
Results:
Top=210 Left=278 Height=379 Width=837
Visible=true Position=poDesigned
FormStyle=fsNormal WindowState=wsNormal
Parent=nil

Additionally:
BoundsRect=(278, 210, 1151, 589, (278, 210), (1151, 589))
ClientOrigin=(282, 230)
ClientRect=(0, 0, 865, 355, (0, 0), (865, 355))
Floating=True
Dockable=True
Active=True
Enabled=True
ModalResult=0
AboutToDestroy=False
FormState=[]
BorderStyle=bsSizeToolWin
SaveStateNecessary=True
AutoSave=True
DeskSection='frmArrayInspector'
LoadedFromDesktop=True
IDEDockType=dtJoin
VisibleOnUndock=False // ?

I've tried VisibleOnUndock=True - no effect ...

Parent=nil, is this OK ?
--
Alex
AlexB
2008-06-16 03:50:18 UTC
Permalink
OK, fixed.

The example has Register procedure:

procedure Register;
begin
RegisterPackageWizard(TDockFormExpert.Create as IOTAMenuWizard);
TExampleDockableForm.CreateExampleDockForm;
end;

(In fact I saw a lot of examples with the similar code)

I saw no problem in debugger (no exceptions, strange values etc) but my
expert was invisible (+ some other oddities).

I've removed the form creation from the Register procedure. Form
constructor now works after the first click on my IDE menu item and all
goes OK.
--
Alex
Loading...