Dialog Loosing Focus
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Dialog Loosing Focus
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 ?
Thanks for each reply.
Detlef
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 ?
Thanks for each reply.
Detlef
Last edited by Detlef Hoefner on Tue Dec 06, 2005 5:43 pm, edited 1 time in total.
- Enrico Maria Giordano
- Posts: 8734
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Been thanked: 1 time
- Contact:
Re: Dialog Loosing Focus
This sample works fine in FWH 2.7:
EMG
Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg
oDlg:bLostFocus = { || MsgBeep() }
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
EMG
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
- Enrico Maria Giordano
- Posts: 8734
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Been thanked: 1 time
- Contact:
No. This works fine either:
EMG
Code: Select all | Expand
#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
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
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Detlef,
As long as the dialog is modal, you can just do whatever after the dialog is closed.
This would be called just a split second after oDlg:bLostFocus.
Or use the dialog's VALID clause
Regards,
Jamess
As long as the dialog is modal, you can just do whatever after the dialog is closed.
Code: Select all | Expand
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
ACTIVATE DIALOG oDlg VALID msgBeep()
Regards,
Jamess
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42398
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 10 times
- Been thanked: 47 times
- Contact:
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
You can't control dialog's focus
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...
For knowing mouses outclicks you must build NO MODALs dialogs and test any Control:bLostFocus and the IsOverWnd command. I THINK...
Nos Gusta Programar
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
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
-
- Posts: 174
- Joined: Sat Feb 23, 2013 10:04 am