[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: Disabling quitting the program.

Thanks a lot for the help. The solution is in fact in overriding the
myApp::CloseAppWin in sucj a way:

int myApp::CloseAppWin(vWindow* win)
    if (disable) return 0;
    else return vApp::CloseAppWin(win);
(note that the version of V, I am using is 1.20)
This really locks the window. So you cannot exit it till disable is true.
The only problem now, is that the "x" in right upper corner "seems to be
available", that is it is "sensetive", while for exemple File/Exit is set to
"non sensetive" each time I need the disabling (and restored after surely).
So the ideal sollution whould be to make the "x" in right upper corner to be
"non sensetive", but I think it is not in the scope of V since this "x" is
something related to Windows, rather than to V. Am I right? So, maybe it
must be looked for in the possibilities of CygWinB20 compiler rather than in
V, doesn't it?

The original messages follow:
> > Hi everybody.
> >
> > I'm using V at Win98 box with CygWinB20 compiler. I am writig some program
> > which must not be closed during certain computations (I must not to allow
> > interrupting the computations). The computations are heavy and long, so
> > while computing I do periodically "CheckEvents", in order to allow the
> > window to be moved/resized/etc during computation, but I have do disable
> > closing!!! It is easily acheeved for "Exit" entry in "File" menu and for
> > "Exit" button that I have in my ToolBar/CommandPane, by setting their
> > Sensetive to 0. But one can still close the application by doubleclicking
> > the upperleft corner, or simpleclicking the upperright corner of the window
> > (don't forget I am under Win98). So the question is: can I disable this
> > buttons too, or not???  Or mayby this is a question about CygWinB20
> > compiler, rather than about V???

> I guess it's about some virtual functions of vApp and vWindow
> You can override vWindow::CloseWin() in a way:
> // I guess it will be done in command window
> void my_cmd_win::CloseWin()
> {
>    if (disable)
>    {
>        note("cannot close window ...");
>        return;
>    }
>    vCmdWindow::CloseWin();
> }
> That will lock the wimdow.
> And the application call Exit() method to initiate normal program
> termination, which can be override in a similar way. This method is usually
> called (in command window by WindowCommand()) when File/Exit is selected and
> with other "legal" exit methodds, like Alt+F4 or "x" in right upper corner.
Laboratoire de Statistique et Processus,
Universite du Maine, Av. Olivier Messiaen
72085 Le Mans CEDEX 9, FRANCE
Tel.   : +33 (0)2 43 83 37 18
Fax.   : +33 (0)2 43 83 35 79
E-mail : Serguei.Dachian@univ-lemans.fr
WWW    : http://www.univ-lemans.fr/sciences/statist/cvs/thesard.html#dachian

Reply to: