Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #985 > unrolled thread

SetModal(lModal)

Started by"Bob Lamens [Marti Orbak Software]" <bobatmartiorbakdotnl@org.org>
First post2011-04-29 11:47 +0200
Last post2011-05-03 18:52 +0200
Articles 10 — 7 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  SetModal(lModal) "Bob Lamens [Marti Orbak Software]" <bobatmartiorbakdotnl@org.org> - 2011-04-29 11:47 +0200
    Re: SetModal(lModal) "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2011-04-29 20:22 +1000
    Re: SetModal(lModal) "Geoff Schaller" <geoffx@softwarexobjectives.com.au> - 2011-04-30 00:00 +0000
      Re: SetModal(lModal) "Marc Verkade [Marti]" <marcatm@rti.nl> - 2011-05-01 23:49 +0200
        Re: SetModal(lModal) "Geoff Schaller" <geoffx@softwarexobjectives.com.au> - 2011-05-01 22:22 +0000
          Re: SetModal(lModal) Massimo Bighelli <info@arcasistemi.it> - 2011-05-02 12:59 +0200
            Re: SetModal(lModal) "Geoff Schaller" <geoffx@softwarexobjectives.com.au> - 2011-05-02 21:59 +0000
              Re: SetModal(lModal) "richard.townsendrose" <richard.townsendrose@gmail.com> - 2011-05-03 05:42 -0700
              Re: SetModal(lModal) Massimo Bighelli <info@arcasistemi.it> - 2011-05-03 18:33 +0200
    Re: SetModal(lModal) "Alessandro Vacchiano" <alessandro@computerscenter.com> - 2011-05-03 18:52 +0200

#985 — SetModal(lModal)

From"Bob Lamens [Marti Orbak Software]" <bobatmartiorbakdotnl@org.org>
Date2011-04-29 11:47 +0200
SubjectSetModal(lModal)
Message-ID<4dba89d5$0$776$58c7af7e@news.kabelfoon.nl>
Hi all,

Im trying to set a DataWindow to modal with a piece of code i picked up from 
the newsgroup;

****************
METHOD SetModal(lModal) CLASS MC_DataWindow
LOCAL nHandle AS PTR
    nHandle:=GetWindow(SELF:handle(),GW_HWNDFIRST)
    DO WHILE nHandle!=0
        EnableWindow(nHandle,.NOT. lModal)
        nHandle:=GetWindow(nHandle,GW_HWNDNEXT)
    ENDDO
    EnableWindow (SELF:handle(),TRUE)
RETURN NIL
****************

It works great, however my MainShellWindow is still accessible for the user.
Is there any way i can make the DataWindow im using the only 'clickable' 
window when I set it to modal with SetModal(lModal)?

Any advice is appreciated!

Grtz,
Bob 

[toc] | [next] | [standalone]


#988

From"Stephen Quinn" <stevejqNO@bigpondSPAM.net.au>
Date2011-04-29 20:22 +1000
Message-ID<tiwup.2829$aH5.1582@viwinnwfe02.internal.bigpond.com>
In reply to#985
Bob

Try having the SHELLWINDOW be the owner of the DataWindow.

CYA
Steve 

[toc] | [prev] | [next] | [standalone]


#993

From"Geoff Schaller" <geoffx@softwarexobjectives.com.au>
Date2011-04-30 00:00 +0000
Message-ID<4dbb5104$0$77724$c30e37c6@exi-reader.telstra.net>
In reply to#985
Yes - use a Dialog Window instead.

That is its purpose. Being modal.

Geoff



"Bob Lamens [Marti Orbak Software]" <bobatmartiorbakdotnl@org.org> wrote 
in message news:4dba89d5$0$776$58c7af7e@news.kabelfoon.nl:

> Hi all,
>
> Im trying to set a DataWindow to modal with a piece of code i picked up from
> the newsgroup;
>
> ****************
> METHOD SetModal(lModal) CLASS MC_DataWindow
> LOCAL nHandle AS PTR
>     nHandle:=GetWindow(SELF:handle(),GW_HWNDFIRST)
>     DO WHILE nHandle!=0
>         EnableWindow(nHandle,.NOT. lModal)
>         nHandle:=GetWindow(nHandle,GW_HWNDNEXT)
>     ENDDO
>     EnableWindow (SELF:handle(),TRUE)
> RETURN NIL
> ****************
>
> It works great, however my MainShellWindow is still accessible for the user.
> Is there any way i can make the DataWindow im using the only 'clickable'
> window when I set it to modal with SetModal(lModal)?
>
> Any advice is appreciated!
>
> Grtz,
> Bob

[toc] | [prev] | [next] | [standalone]


#1007

From"Marc Verkade [Marti]" <marcatm@rti.nl>
Date2011-05-01 23:49 +0200
Message-ID<4dbdd62f$0$831$58c7af7e@news.kabelfoon.nl>
In reply to#993
That was what I said too..
Grtz, Marc

"Geoff Schaller"  schreef in bericht 
news:4dbb5104$0$77724$c30e37c6@exi-reader.telstra.net...

Yes - use a Dialog Window instead.

That is its purpose. Being modal.

Geoff



"Bob Lamens [Marti Orbak Software]" <bobatmartiorbakdotnl@org.org> wrote
in message news:4dba89d5$0$776$58c7af7e@news.kabelfoon.nl:

> Hi all,
>
> Im trying to set a DataWindow to modal with a piece of code i picked up 
> from
> the newsgroup;
>
> ****************
> METHOD SetModal(lModal) CLASS MC_DataWindow
> LOCAL nHandle AS PTR
>     nHandle:=GetWindow(SELF:handle(),GW_HWNDFIRST)
>     DO WHILE nHandle!=0
>         EnableWindow(nHandle,.NOT. lModal)
>         nHandle:=GetWindow(nHandle,GW_HWNDNEXT)
>     ENDDO
>     EnableWindow (SELF:handle(),TRUE)
> RETURN NIL
> ****************
>
> It works great, however my MainShellWindow is still accessible for the 
> user.
> Is there any way i can make the DataWindow im using the only 'clickable'
> window when I set it to modal with SetModal(lModal)?
>
> Any advice is appreciated!
>
> Grtz,
> Bob 

[toc] | [prev] | [next] | [standalone]


#1008

From"Geoff Schaller" <geoffx@softwarexobjectives.com.au>
Date2011-05-01 22:22 +0000
Message-ID<4dbddd0d$0$99948$c30e37c6@exi-reader.telstra.net>
In reply to#1007
<g>

Great minds think alike.

But on the serious side, I see way too many people using DataWindows 
when they shouldn't. It is simple enough to give a dialog a menu and 
toolbar if required and it can be resizable. So why folks want to go and 
cause all that extra overhead in a datawindow is beyond me.

Geoff


"Marc Verkade [Marti]" <marcatm@rti.nl> wrote in message 
news:4dbdd62f$0$831$58c7af7e@news.kabelfoon.nl:

> That was what I said too..
> Grtz, Marc
>
> "Geoff Schaller"  schreef in bericht
> news:4dbb5104$0$77724$c30e37c6@exi-reader.telstra.net...
>
> Yes - use a Dialog Window instead.
>
> That is its purpose. Being modal.
>
> Geoff
>
>
>
> "Bob Lamens [Marti Orbak Software]" <bobatmartiorbakdotnl@org.org> wrote
> in message news:4dba89d5$0$776$58c7af7e@news.kabelfoon.nl:
>
>
> > Hi all,
> >
> > Im trying to set a DataWindow to modal with a piece of code i picked up
> > from
> > the newsgroup;
> >
> > ****************
> > METHOD SetModal(lModal) CLASS MC_DataWindow
> > LOCAL nHandle AS PTR
> >     nHandle:=GetWindow(SELF:handle(),GW_HWNDFIRST)
> >     DO WHILE nHandle!=0
> >         EnableWindow(nHandle,.NOT. lModal)
> >         nHandle:=GetWindow(nHandle,GW_HWNDNEXT)
> >     ENDDO
> >     EnableWindow (SELF:handle(),TRUE)
> > RETURN NIL
> > ****************
> >
> > It works great, however my MainShellWindow is still accessible for the
> > user.
> > Is there any way i can make the DataWindow im using the only 'clickable'
> > window when I set it to modal with SetModal(lModal)?
> >
> > Any advice is appreciated!
> >
> > Grtz,
> > Bob

[toc] | [prev] | [next] | [standalone]


#1017

FromMassimo Bighelli <info@arcasistemi.it>
Date2011-05-02 12:59 +0200
Message-ID<ipm2pt$oht$1@speranza.aioe.org>
In reply to#1008
Geoff,

> But on the serious side, I see way too many people using DataWindows
> when they shouldn't. It is simple enough to give a dialog a menu and
> toolbar if required and it can be resizable. So why folks want to go and
> cause all that extra overhead in a datawindow is beyond me.
>

because it's easier when you have lot of windows opened (I don't like to 
control the z-order) to avoid the foreground persistence of the 
dialog... and what about the menu?
.or.
never never use datawindows, only dialogs in the app.

Massimo

[toc] | [prev] | [next] | [standalone]


#1022

From"Geoff Schaller" <geoffx@softwarexobjectives.com.au>
Date2011-05-02 21:59 +0000
Message-ID<4dbf2929$0$99958$c30e37c6@exi-reader.telstra.net>
In reply to#1017
Massimo.

I have three rules of thumb: if it is a browser, let them have the 
browser open along with other windows so I use a datawindow. If it is 
data entry - I use a dialog and force the user to finish with it before 
they do anything else. If it is a reference window, I use a modeless 
dialog. Simple. Works very well. No issues with Z order or worrying 
about who, what and where.

And yes of course a dialog can have a menu and toolbar. No problem. Just 
like it can have a SELF:Server.

Geoff



"info@arcasistemi.it" <info@arcasistemi.it> wrote in message 
news:ipm2pt$oht$1@speranza.aioe.org:

> Geoff,
>
>
> > But on the serious side, I see way too many people using DataWindows
> > when they shouldn't. It is simple enough to give a dialog a menu and
> > toolbar if required and it can be resizable. So why folks want to go and
> > cause all that extra overhead in a datawindow is beyond me.
> >
>
>
> because it's easier when you have lot of windows opened (I don't like to
> control the z-order) to avoid the foreground persistence of the
> dialog... and what about the menu?
> .or.
> never never use datawindows, only dialogs in the app.
>
> Massimo

[toc] | [prev] | [next] | [standalone]


#1030

From"richard.townsendrose" <richard.townsendrose@gmail.com>
Date2011-05-03 05:42 -0700
Message-ID<1f86f967-89c1-45e5-903b-1c7b93efd5e7@18g2000prd.googlegroups.com>
In reply to#1022
Hi

there are cases when suddeenly one wantys to have adatwindow act
modally .. not often, but occasionally.

in the shell window
	PROTECT lModal			:= FALSE AS LOGIC 	// closing checks
	PROTECT aModal			:= {} AS ARRAY      // of modal windows

METHOD AmIModal(oWin) CLASS TDOCShellWindow
	LOCAL wPos	:= 0 AS WORD
	wPos := AScan(SELF:aModal,oWin)
RETURN IIF(wPos == 0,FALSE,TRUE)

METHOD MakeModal(oWin, lValue) CLASS TDOCShellWindow
	LOCAL wPos	:= 0 AS WORD
	IF lValue
		AAdd(SELF:aModal,oWin)
	ELSE
		wPos := AScan(SELF:aModal,oWin)
		IF wPos <> 0
			ADel(SELF:aModal,wPos)
			ASize(SELF:aModal,ALen(SELF:aModal)-1)
		ELSE
			TextBoxEnh{SELF, 'Internal Error', 'Modal problem'}:Show()
		ENDIF
	ENDIF
	IF ALen(SELF:aModal) > 0
		SELF:lModal := TRUE
	ELSE
		SELF:lModal := FALSE
	ENDIF
RETURN SELF:lModal

and this is the key bit ...

METHOD QueryClose( oEvent ) CLASS TDOCShellWindow
	LOCAL lOk AS LOGIC

	IF SELF:lModal
		lOk := FALSE  // wait till not...

	ELSE
		IF SELF:UserSet == NULL_OBJECT  // appini exists
			// cannot be the case ... but ... anyway cannot test for
exitconfirm
			lOk:=TRUE
		ELSE
			IF SELF:GetSet(ConfirmExit) .AND. ! SELF:lForceClose
				IF TextBoxEnh{ SELF, SELF:AppName,	LoadResString('Are you sure you
want to leave?',IDS_SUREYOUWANTTOLEAVE,nPLH), BOXICONQUESTIONMARK +
BUTTONYESNO }:Show() == BOXREPLYYES
					lOk:=TRUE
				ELSE
					lOk:=FALSE
					IF SELF:Appno == TDOC_CR_APPNO
					// fix easystart and dashboard windows
						IF SELF:GetSet(QStartOpen)
							SysObject():oSWin:lCanKillme:=FALSE
						ELSEIF SELF:GetSet(DashOpen)
							SysObject():oDWin:lCanKillme:=FALSE
						ENDIF
					ENDIF
				ENDIF
			ELSE  // confirmation NOT required
				lOk:=TRUE
			ENDIF
		ENDIF

		IF lOk                // logout ....
			SELF:MenuOff()
			IF SELF:Licence <> NULL_OBJECT
				SELF:Licence:Logout()
				SELF:Licence := NULL_OBJECT
			ENDIF
		ENDIF

	ENDIF

RETURN lOk

so basically one has an array of modal data windows
no closing if one is there ... and i have added no closing if our
quickstart or dashboard are open... these are "background" windows
whatever that means

the APP needs to know that a modal window exists ... came off
compuserve in the good old days ... before geoff was born ! compuserve
WAS "OurWorld" and pre-dated www

easy

richard

[toc] | [prev] | [next] | [standalone]


#1037

FromMassimo Bighelli <info@arcasistemi.it>
Date2011-05-03 18:33 +0200
Message-ID<ippans$mhd$1@speranza.aioe.org>
In reply to#1022
Geoff,

> I have three rules of thumb: if it is a browser, let them have the
> browser open along with other windows so I use a datawindow.

same here

> If it is data entry - I use a dialog and force the user to finish with it before
> they do anything else.

different here, because I like to open many dataentry (starting from the 
same browser) and, say, copy and paste from one to another, etc... as I 
can open different browsers, each one with it's own child dataentries...
so, in certain scenarios you have a mix of datawindows and dialogs...

> If it is a reference window, I use a modeless dialog.

same here

> And yes of course a dialog can have a menu and toolbar. No problem. Just
> like it can have a SELF:Server.

yes, ... I was referring to differences managing/assigning owner menu to 
the called window, or the datawindow's menu displayed in the shell, an 
so on.

Massimo

[toc] | [prev] | [next] | [standalone]


#1038

From"Alessandro Vacchiano" <alessandro@computerscenter.com>
Date2011-05-03 18:52 +0200
Message-ID<4dc032d1$0$38640$4fafbaef@reader1.news.tin.it>
In reply to#985
Ciao Bob ,

hope to help whit this :

DATADIALOG is INHERITH from DATAWINDOW , you can change at runtime its 
properties .

If you use this example you solve any modal things.

Just create a sysobject variable named SettoModale and inherit your windows 
from MiaDialog . Example :

SysObject():SettoModale := TRUE
oWnd := Mywin{self}:Show()

Alessandro

********************* code **********************
CLASS MiaDialog INHERIT DataDialog
    PROTECT SymTipoClasse AS SYMBOL

METHOD Activate(oE) CLASS MiaDialog
    IF SELF:SymTipoClasse == #DATADIALOG
          SUPER:Activate(oE)
    ELSE
        SendClass(SELF,#ACTIVATE,#DATAWINDOW,oE)
    ENDIF

METHOD Init(oOwner,oSource,nResourceID) CLASS MiaDialog

    IF SysObject():SettoModale
        SELF:SymTipoClasse := #DATADIALOG
    ELSE
        SELF:SymTipoClasse := #DATAWINDOW
    ENDIF

    IF SELF:SymTipoClasse == #DATADIALOG
        SUPER:init(oOwner,oSource,nResourceID)
    ELSE
        SendClass(SELF,#INIT,#DATAWINDOW,SysObject(),oSource,nResourceID)
    ENDIF

    SysObject():SettoModale := FALSE  // ripristino sempre DATAWINDOW

METHOD Resize(oResizeEvent) CLASS MiaDialog
    SUPER:Resize(oResizeEvent)

    SELF:Repaint()

RETURN NIL






"Bob Lamens [Marti Orbak Software]"  ha scritto nel messaggio 
news:4dba89d5$0$776$58c7af7e@news.kabelfoon.nl...

Hi all,

Im trying to set a DataWindow to modal with a piece of code i picked up from
the newsgroup;

****************
METHOD SetModal(lModal) CLASS MC_DataWindow
LOCAL nHandle AS PTR
    nHandle:=GetWindow(SELF:handle(),GW_HWNDFIRST)
    DO WHILE nHandle!=0
        EnableWindow(nHandle,.NOT. lModal)
        nHandle:=GetWindow(nHandle,GW_HWNDNEXT)
    ENDDO
    EnableWindow (SELF:handle(),TRUE)
RETURN NIL
****************

It works great, however my MainShellWindow is still accessible for the user.
Is there any way i can make the DataWindow im using the only 'clickable'
window when I set it to modal with SetModal(lModal)?

Any advice is appreciated!

Grtz,
Bob

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web