Mouse Click outside NoWait Dialog

Mouse Click outside NoWait Dialog

Postby fraxzi » Wed Nov 04, 2009 8:52 am

Hello All,

I have a NoWait Dialog... How to determine if mouse click is outside the Dialog?



Regards,
Fraxzi
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Re: Mouse Click outside NoWait Dialog

Postby fraxzi » Wed Nov 04, 2009 11:56 pm

Dear Enrico,

Thank you!

How forgetful I am :lol:


I test it with Modal too but not what I desired.



Regards,
Fraxzi
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Mouse Click outside NoWait Dialog

Postby Enrico Maria Giordano » Thu Nov 05, 2009 9:29 am

fraxzi wrote:I test it with Modal too but not what I desired.


Are you saying that bLostFocus is not evaluated properly?

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

Re: Mouse Click outside NoWait Dialog

Postby fraxzi » Thu Nov 05, 2009 9:45 am

Enrico,

I defined oDlg:bLostFocus := {|| oDlg:End() } but not executing on modal mode.

Any workaround?


Regards,
Fraxzi
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Mouse Click outside NoWait Dialog

Postby Enrico Maria Giordano » Thu Nov 05, 2009 9:50 am

This sample works fine here:

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


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    oDlg:bLostFocus = { || oDlg:End() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


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

Re: Mouse Click outside NoWait Dialog

Postby Marcelo Via Giglio » Thu Nov 05, 2009 12:34 pm

Enrico,

I have a similar problem, but with Dialog defined in resource, oDlg:bLostFocus = { || oDlg:End() }
don't work, with FW version 7.1 or previous it works properly.

Regards

Marcelo
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Mouse Click outside NoWait Dialog

Postby Enrico Maria Giordano » Thu Nov 05, 2009 12:40 pm

I just made a test and bLostFocus worked fine here using a dialog from resources (latest FWH).

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

Re: Mouse Click outside NoWait Dialog

Postby fraxzi » Fri Nov 06, 2009 12:18 am

Dear Enrico,

Enrico Maria Giordano wrote:This sample works fine here:

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


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    oDlg:bLostFocus = { || oDlg:End() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG



Yes it works as expected...

but if modal :
Code: Select all  Expand view

    ACTIVATE DIALOG oDlg NoWait;
             CENTER
 


Doesn't.

I need to make it modal so user must respond to dialog and if not will return a value.

The behavior is very much similar to HTMLPOP() function.


Regards.
Fraxzi
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Mouse Click outside NoWait Dialog

Postby Enrico Maria Giordano » Fri Nov 06, 2009 10:30 am

fraxzi wrote:but if modal :


Did you mean "non modal" or "modeless", right?

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

Re: Mouse Click outside NoWait Dialog

Postby Enrico Maria Giordano » Fri Nov 06, 2009 10:32 am

Anyway, I tested all the combination and bLostFocus worked as expected. This is an example:

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


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    ACTIVATE WINDOW oWnd;
             ON INIT TEST( oWnd )

    RETURN NIL


FUNCTION TEST( oWnd )

    LOCAL oDlg

    DEFINE DIALOG oDlg;
           RESOURCE "TEST"

    oDlg:bLostFocus = { || oDlg:End(), oWnd:End() }

    ACTIVATE DIALOG oDlg NOMODAL;
             CENTER

    RETURN NIL


The resource file:

Code: Select all  Expand view
TEST DIALOG 6, 15, 207, 111
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
}


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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 99 guests