Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Modal forms

16 views
Skip to first unread message

Sinisa

unread,
Jan 6, 2009, 7:37:12 AM1/6/09
to
Does anyone knows how to detect click outside modal form?

I have a modal form, and want to know if someone clicked anywhere but this
form.

Thanks

Stefan Wuebbe

unread,
Jan 7, 2009, 12:03:22 PM1/7/09
to

"Sinisa" <u48623@uwe> wrote in message news:8fc75b6751f70@uwe...

> Does anyone knows how to detect click outside modal form?
>
> I have a modal form, and want to know if someone clicked anywhere but this
> form.

You probably cannot in a "clean" way, I think - the kludgy one using OKL
pasted below seems to work. Out of curiosity, why do you want to do so?


hth
-Stefan

* form_modal_click_elswhere.prg
CLEAR

LOCAL oForm as Form
oForm = CREATEOBJECT('TestForm')
oForm.Show(1)
RETURN

DEFINE CLASS TestForm as Form
AutoCenter = .T.
AllowOutput = .F.

PROCEDURE Activate()
ON KEY LABEL leftmouse ;
IIF( VARTYPE(_screen.ActiveForm)='O' AND
PEMSTATUS(_screen.ActiveForm,'MouseOutside',5), ;
_screen.ActiveForm.MouseOutside(), ;
.T. )
ENDPROC
PROCEDURE Destroy()
ON KEY LABEL leftmouse
ENDPROC
PROCEDURE MouseOutside()
lnCol = MCOL('',3)
lnRow = MROW('',3)
IF BETWEEN(m.lnCol, Thisform.Left,Thisform.Left+Thisform.Width) ;
AND BETWEEN(m.lnRow, Thisform.Top,Thisform.Top+Thisform.Height)
RETURN
ENDIF

? LOWER(PROGRAM())
ENDPROC
ENDDEFINE
* eop

--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------

Sinisa via DBMonster.com

unread,
Jan 9, 2009, 11:27:34 AM1/9/09
to
First, thank you. I havent tried it jet.
Well, I have to make "combo" that has some functions that ordinary combo has
not.
And it has to be a form, not container. And it has to be modal...
So I have made modal form without title bar, and with all advanced features...

And I want to detect if someone have clicked anywhere but form (mine combo),
so I know that combo has to be closed.

Sinisa

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/foxpro-grids/200901/1

Stefan Wuebbe

unread,
Jan 11, 2009, 2:41:19 AM1/11/09
to

"Sinisa via DBMonster.com" <u48623@uwe> wrote in message news:8fef164601382@uwe...

> First, thank you. I havent tried it jet.
> Well, I have to make "combo" that has some functions that ordinary combo has
> not.
> And it has to be a form, not container. And it has to be modal...
> So I have made modal form without title bar, and with all advanced features...
>
> And I want to detect if someone have clicked anywhere but form (mine combo),
> so I know that combo has to be closed.

That sounds reasonable, thanks for the feedback.


-Stefan

Sinisa via DBMonster.com

unread,
Jan 11, 2009, 12:03:34 PM1/11/09
to
:)

Stefan Wuebbe wrote:
>> First, thank you. I havent tried it jet.
>> Well, I have to make "combo" that has some functions that ordinary combo has

>[quoted text clipped - 4 lines]


>> And I want to detect if someone have clicked anywhere but form (mine combo),
>> so I know that combo has to be closed.
>
>That sounds reasonable, thanks for the feedback.
>
>-Stefan

--

0 new messages