Source language: Translate to:

Get back window of command wizard on nb-task-click

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Get back window of command wizard on nb-task-click

Postby HPW » Wed Oct 11, 2006 4:51 am

I noticed a problem with command wizards.

When I switch between another app and neobook IDE and I have the wizard of 'If' or 'SetVar' open, then I the wizard gets back onTop and focused, when I click on the neobook button on the taskbar.

But with my plugins and also with neobook DB (2.3d) for example 'dbfClose' when I click on the neobook button, nothing appears.
Switching with ALT-TAB brings back the open dialog but clicking on the taskbar not.

Any idea what I can do as a plugin author to get the same behaviour as the build-in command wizards?
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby HPW » Wed Oct 11, 2006 11:56 am

It also happens with neobook's DB and neobook PDF's About-dialogs.
As long as they are open, a taskbar-click on neobook does not show it.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Neosoft Support » Wed Oct 11, 2006 12:03 pm

This has something to do with which window is designated as the dialog's parent. It seems like you should be able to fix this using some variation of the following:

Form.CreateParented( GetActiveWindow );

or

Form.Parent := GetActiveWindow;
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby HPW » Wed Oct 11, 2006 1:33 pm

Since I am using such code like in the templates for nbEditAction:

Code: Select all
  CASE IDNum OF
    1 : BEGIN
          EditForm := TEditForm.CreateParented( GetActiveWindow );
 ...
 ...


But that does work as described.
Maybe because it is a sub-dialog of the action-dialog?
Or because it is modal?
How do you create the 'SetVar' dialog?

Any idea?
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Neosoft Support » Wed Oct 11, 2006 5:26 pm

...How do you create the 'SetVar' dialog?


NeoBook's internal dialogs are different because they are created within the context of the main program. Plug-in dialogs are outside of that context so they are not technically part of NeoBook. In fact, Windows thinks they're part of a separate application, which is what causes the behavior you describe.

The solution below is for Delphi, but something similar will work for other languages as well:

1. The form should be created like this:

Code: Select all
MyForm := TMyForm.CreateParented( GetActiveWindow );


2. Add the following to your form's interface:

Code: Select all
procedure WMActivate( var Msg : TWMActivate ); message WM_ACTIVATE;


3. Finally, add the following to your form's implementation:

Code: Select all
procedure TMyForm.WMActivate( var Msg : TWMActivate );
begin
  IF Msg.Active <> WA_INACTIVE THEN
    BringWindowToTop( Handle );
  INHERITED;
end;
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby HPW » Wed Oct 11, 2006 10:31 pm

Thanks! I will try it.

Will you add that to neosofts own plugins? (About and Command wizards)
And you should update the SDK examples!

I had to hit ctrl+alt+del to close neobook without saving my work


I think you mean something different. This here is a minor cosmetic problem. I was always able to get back to neobook by ALT-TAB or minimizing all other windows.
Last edited by HPW on Wed Oct 11, 2006 10:47 pm, edited 1 time in total.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby HPW » Wed Oct 11, 2006 10:46 pm

Just tried it with one about dialog.
Work nice as expected!
Update for all plugins has to be done!
:lol:
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Neosoft Support » Thu Oct 12, 2006 11:32 am

Will you add that to neosofts own plugins? (About and Command wizards) And you should update the SDK examples!


Yes!
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest