FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour MODAL WINDOW
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
MODAL WINDOW
Posted: Fri Dec 02, 2011 01:32 PM

Hello,

How is possible to define a Window Modal like a Dialog?.

Thanks.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: MODAL WINDOW
Posted: Fri Dec 02, 2011 03:51 PM

Activate Diaog NOWAIT

kind regards

Stefan
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: MODAL WINDOW
Posted: Fri Dec 02, 2011 03:59 PM

Hello,

This for non modal dialog.

I want a Window acting Modal as a Dialog.

Thanks.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: MODAL WINDOW
Posted: Fri Dec 02, 2011 04:18 PM

Please have a look at how rpreview.prg makes a modal window.

EMG

Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: MODAL WINDOW
Posted: Fri Dec 02, 2011 04:25 PM

Hello,

Enrico, I am afraid I don´t see how it works.

Any clue please?.

Thanks.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: MODAL WINDOW
Posted: Fri Dec 02, 2011 04:29 PM
Code (fw): Select all Collapse
     if ::oDevice:lPrvModal
         if ::oWndMain == nil
            StopUntil( { || ::lExit } )
         else
            StopUntil( { || ::lExit .or. !IsWindow( WndMain():hWnd ) } )
         endif
     endif


EMG
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: MODAL WINDOW
Posted: Fri Dec 02, 2011 04:34 PM

Thanks.

I didn´t know about StopUntil()

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: MODAL WINDOW
Posted: Fri Dec 02, 2011 09:33 PM

John,

The risk of calling SysRefresh() (StopUntil() uses it) is that it could process an unwanted event.

So an alternative solution to simulate a modal window is to disable the other windows where we don't want the focus to go to:

oWndOther:Disable()

...

oWndOther:Enable()

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion