🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.opentoolsapi
5 messages
5 total messages Started by AlexB Wed, 04 Jun 2008 05:51
Expert is not visible
#57
Author: AlexB
Date: Wed, 04 Jun 2008 05:51
47 lines
2066 bytes
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
Re: Expert is not visible
#62
Author: Erik Berry
Date: Sun, 08 Jun 2008 23:55
15 lines
1670 bytes
AlexB wrote:
> 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
Re: Expert is not visible
#64
Author: AlexB
Date: Mon, 09 Jun 2008 05:32
11 lines
1168 bytes
Erik Berry wrote:

> 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
Re: Expert is not visible
#66
Author: AlexB
Date: Tue, 10 Jun 2008 07:07
43 lines
1997 bytes
AlexB wrote:

> Erik Berry wrote:
> 
> > 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
Re: Expert is not visible
#71
Author: AlexB
Date: Mon, 16 Jun 2008 03:50
21 lines
1350 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads