Dialog Loosing Focus

Dialog Loosing Focus

Postby Detlef Hoefner » Tue Dec 06, 2005 4: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
Last edited by Detlef Hoefner on Tue Dec 06, 2005 5:43 pm, edited 1 time in total.
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Re: Dialog Loosing Focus

Postby Enrico Maria Giordano » Tue Dec 06, 2005 4:53 pm

This sample works fine in FWH 2.7:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    oDlg:bLostFocus = { || MsgBeep() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Detlef Hoefner » Tue Dec 06, 2005 5: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
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby Enrico Maria Giordano » Tue Dec 06, 2005 5:58 pm

No. This works fine either:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg;
           RESOURCE "TEST"

    oDlg:bLostFocus = { || MsgBeep() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


Code: Select all  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Detlef Hoefner » Tue Dec 06, 2005 6: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
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby James Bott » Wed Dec 07, 2005 1:37 am

Detlef,

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

Code: Select all  Expand view
  ACTIVATE DIALOG oDlg

  msgBeep()

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

Or use the dialog's VALID clause

Code: Select all  Expand view
  ACTIVATE DIALOG oDlg VALID msgBeep()


Regards,
Jamess
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Detlef Hoefner » Wed Dec 07, 2005 7: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
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby Antonio Linares » Wed Dec 07, 2005 12:46 pm

Detlef,

Is it a non modal dialog ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Detlef Hoefner » Wed Dec 07, 2005 1: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
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

You can't control dialog's focus

Postby manuramos » Mon Dec 26, 2005 7: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
manuramos
 
Posts: 219
Joined: Mon Dec 26, 2005 7:25 pm
Location: Jerez de la Frontera (Spain)

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Dialog Loosing Focus

Postby Antonio Mart. » Fri Apr 26, 2013 8:05 pm

Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 8 guests