MODAL WINDOW

MODAL WINDOW

Postby ukservice » Fri Dec 02, 2011 1: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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: MODAL WINDOW

Postby StefanHaupt » Fri Dec 02, 2011 3:51 pm

Activate Diaog NOWAIT
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: MODAL WINDOW

Postby ukservice » Fri Dec 02, 2011 3: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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: MODAL WINDOW

Postby Enrico Maria Giordano » Fri Dec 02, 2011 4:18 pm

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

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

Re: MODAL WINDOW

Postby ukservice » Fri Dec 02, 2011 4: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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: MODAL WINDOW

Postby Enrico Maria Giordano » Fri Dec 02, 2011 4:29 pm

Code: Select all  Expand view
    if ::oDevice:lPrvModal
         if ::oWndMain == nil
            StopUntil( { || ::lExit } )
         else
            StopUntil( { || ::lExit .or. !IsWindow( WndMain():hWnd ) } )
         endif
     endif


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

Re: MODAL WINDOW

Postby ukservice » Fri Dec 02, 2011 4:34 pm

Thanks.

I didn´t know about StopUntil()
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: MODAL WINDOW

Postby Antonio Linares » Fri Dec 02, 2011 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests