FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Is there a codeblock for changing active window
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Is there a codeblock for changing active window
Posted: Fri Jul 09, 2010 09:49 AM

Hi,

I wonder if there is a codeblock that is executed, when the active window changes? Or another approach with the same result? It should fire at the moment that a call oWinClient:GetActive() would give a different response.

(Background info: for example, if mdi-child "A" is active, I want to show a ribbon-group "a", and if mdi-child "B" is active I want to show ribbon-group "b". It is not possible by oWinA:bLostFocus because if I click the ribbon-menu, the focus is lost at this time...)

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Is there a codeblock for changing active window
Posted: Fri Jul 09, 2010 10:51 AM

What about oWinA:bGotFocus or oWinB:bGotFocus ?

Just an idea

Regards

Anser

Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Is there a codeblock for changing active window
Posted: Fri Jul 09, 2010 11:11 AM

Anser,

bGotFocus will work for starting the group, but I want to let ribbon-group "A" disappear, when the mdi-child isn't the active window any more. But I can't do that with bLostFocus, because, for example, by clicking the ribbon-menu the mdi-child already looses focus but is still the active window.
Thanks anyway for your suggestion, maybe it's a start...

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Is there a codeblock for changing active window
Posted: Fri Jul 09, 2010 02:00 PM

Ok, now I have implemented oWinChild:bGotFocus and oWinChild:bInit for each mdi-child.
The only problem that is left: if I close all windows or the last window I also want to let the ribbon-group disappear. But a oWin:bGotFocus for the main Window won't help in this case. Has anyone a suggestion?

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Is there a codeblock for changing active window
Posted: Fri Jul 09, 2010 02:11 PM

How about the window's VALID clause?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Is there a codeblock for changing active window
Posted: Mon Jul 12, 2010 12:38 PM
James Bott wrote:How about the window's VALID clause?

James


It won't work in this case, because I need a block that is called after closing a mdi-child. Because at closing time I don't know, which mdi-child will become the active one after closing. Or is there any method to find out, which mdi-child will become the active one when the actual active one has been closed?
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Is there a codeblock for changing active window
Posted: Mon Jul 12, 2010 03:54 PM

Window:A
bGotFocus ( Hide Group-B and show Group-A )
bPostEnd ( If All windows are closed, hide both groups )

Window-B
bGotFocus ( Hide Group-A and show Group-B )
bPostEnd ( If all windows are closed, hide both groups )

Any other mdichild not A or B
bGotFocus ( Hide both Group-A and Group-B )

Regards



G. N. Rao.

Hyderabad, India
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Is there a codeblock for changing active window
Posted: Thu Jul 15, 2010 08:17 AM

Rao,

many thanks for your hint. This works fine!
bPostEnd is the codeblock I've been searching for :)

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Is there a codeblock for changing active window
Posted: Thu Jul 15, 2010 09:33 AM

I think James means the following combination:

Window:A
bGotFocus ( show Group-A )
VALID ( hide both groups )

It's working perfect for me!

Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Is there a codeblock for changing active window
Posted: Thu Jul 15, 2010 10:07 AM

Many times we forget that bPostEnd is a very usefull codeblock :-)

Thanks Rao :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion