FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper Dialog Loosing Focus
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Dialog Loosing Focus
Posted: Tue Dec 06, 2005 04:45 PM

Hi all,

i can not catch the moment when a dialog looses focus.
I tried oDlg:bLostFocus := { || MsgBeep() }
But i never heard the beep.

Is there a known issue in FW2.4 that a bLostFocus block of a dialog will not be executed?
Maybe it's not executed because the dialog lost his Focus :wink: ?

Thanks for each reply.
Detlef

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Dialog Loosing Focus
Posted: Tue Dec 06, 2005 04:53 PM
This sample works fine in FWH 2.7:

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    oDlg:bLostFocus = { || MsgBeep() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Dialog Loosing Focus
Posted: Tue Dec 06, 2005 05:42 PM

Hi Enrico,

Yes, your sample works even fine for me with FW 2.4.

But from the moment i build the dialog from resource your sample doesn't work.

Could you confirm this, please?

Thanks,
Detlef

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Dialog Loosing Focus
Posted: Tue Dec 06, 2005 05:58 PM
No. This works fine either:

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg;
           RESOURCE "TEST"

    oDlg:bLostFocus = { || MsgBeep() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


TEST DIALOG 40, 27, 194, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "This is a & test"
FONT 8, "MS Sans Serif"
{
 DEFPUSHBUTTON "&Close", 201, 12, 96, 50, 14
}


EMG
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Dialog Loosing Focus
Posted: Tue Dec 06, 2005 06:31 PM

Hi Enrico,

this is probably one difference from FW 2.4 to 2.7.
Your sample doesn't work for my version.

Anyhow, thanks Enrico.

Regards
Detlef

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog Loosing Focus
Posted: Wed Dec 07, 2005 01:37 AM
Detlef,

As long as the dialog is modal, you can just do whatever after the dialog is closed.

  ACTIVATE DIALOG oDlg

  msgBeep()

This would be called just a split second after oDlg:bLostFocus.

Or use the dialog's VALID clause

  ACTIVATE DIALOG oDlg VALID msgBeep()


Regards,
Jamess
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Dialog Loosing Focus
Posted: Wed Dec 07, 2005 07:40 AM

James,

my problem is not to do something after a dialog is closed but when it's loosing focus.
I can not catch the moment when a user clicks outside the dialog.

But thanks for jumping in, James.
Regards,
Detlef

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Dialog Loosing Focus
Posted: Wed Dec 07, 2005 12:46 PM

Detlef,

Is it a non modal dialog ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Dialog Loosing Focus
Posted: Wed Dec 07, 2005 01:03 PM

Antonio,

no it's a modal dialog.

Just like the 2nd example Enrico posted.
It doesn't work for me.
bGotFocus is executed but bLostFocus not.

Thanks for jumping in Antonio.

Regards,
Detlef

Posts: 219
Joined: Mon Dec 26, 2005 07:25 PM
You can't control dialog's focus
Posted: Mon Dec 26, 2005 07:43 PM

I Think you can't completly control dialog's focus. You only can fully control CONTROLS FOCUSES. for example oListBox:bLostFocus := .....

For knowing mouses outclicks you must build NO MODALs dialogs and test any Control:bLostFocus and the IsOverWnd command. I THINK...

Nos Gusta Programar
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog Loosing Focus
Posted: Wed Jan 04, 2006 12:50 AM
Detlef Hoefner wrote:
my problem is not to do something after a dialog is closed but when it's loosing focus.
I can not catch the moment when a user clicks outside the dialog.


Hmm. Since the dialog is modal, the only way it can loose focus is if you click outside the application. Is that what you mean?

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Dialog Loosing Focus
Posted: Fri Apr 26, 2013 08:05 PM

Continue the discussion