Slow down MSGYESNO()
Moderator: Rathinagiri
Slow down MSGYESNO()
Is there a way to go into hmg`s msgyesno function to slow down input by using something like
IIF(ISWINDOWACTIVE(WINDOWMSGYESNO),CONTINUE,NIL)
I created my own yesnobox with public variabel YN which works well. On my yes and no buttons I use
button Y Action IIF(ISWINDOWACTIVE(WINDOWMYYESNO),(YN := .T. , myyesno.release),NIL)
button N Action IIF(ISWINDOWACTIVE(WINDOWMYYESNO),(YN := .F. , myyesno.release),NIL)
Nothing happens until the window is active
It would be more convenient to just use use msgyesno.
The reason is I have a grid with a ON KEY F3 IF MSGYESNO .. DELETE and if a person wants delete a lot of grid items they get going very fast and
crash the progam. With my box YN does happen until window is active so it just loops.
Any thoughts ........ Franco
IIF(ISWINDOWACTIVE(WINDOWMSGYESNO),CONTINUE,NIL)
I created my own yesnobox with public variabel YN which works well. On my yes and no buttons I use
button Y Action IIF(ISWINDOWACTIVE(WINDOWMYYESNO),(YN := .T. , myyesno.release),NIL)
button N Action IIF(ISWINDOWACTIVE(WINDOWMYYESNO),(YN := .F. , myyesno.release),NIL)
Nothing happens until the window is active
It would be more convenient to just use use msgyesno.
The reason is I have a grid with a ON KEY F3 IF MSGYESNO .. DELETE and if a person wants delete a lot of grid items they get going very fast and
crash the progam. With my box YN does happen until window is active so it just loops.
Any thoughts ........ Franco
All The Best,
Franco
Canada
Franco
Canada
Re: Slow down MSGYESNO()
I do not really understand why there is a problem, because MsgYesNo opens a Modal window, so other events (unless the exception is a timer) should not be handled until you close MsgYesNo. Theoretically you can not be called repeatedly ON KEY F3 event until it is serviced MsgYesNo the previous call event.
But maybe try something like this:
But maybe try something like this:
Code: Select all
ON KEY F3 ACTION SomeFunc()
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
FUNCTION SomeFunc()
STATIC ISinProgress := .F.
IF ISinProgress
RETURN Nil
ENIDF
ISinProgress := .T.
IF MsgYesNo
ELSE
ENDIF
ISInProgress := .F.
RETURN Nil
Re: Slow down MSGYESNO()
Originally when Serge had this problem, it was the forums thought the yesno window was trying to release before it was active.
The error is ..... window not active.
myyesno works fine but I thought there must be something in the hmg msgyesno could be changed. I am going to keep using myyesno as it does
not crash program.
I have public variable 'YN' := .F.
TIT parameter := label message
Thanks .. Franco
The error is ..... window not active.
myyesno works fine but I thought there must be something in the hmg msgyesno could be changed. I am going to keep using myyesno as it does
not crash program.
I have public variable 'YN' := .F.
TIT parameter := label message
Code: Select all
DEFINE WINDOW Myyesno ;
AT getDeskTopHeight()/2-70 ,getdesktopWidth() /2-175 ;
WIDTH 350 ;
HEIGHT 140 ; //TITLE TIT ;
MODAL ;
SIZABLE .F. ; //
BACKCOLOR {0,128,192 } ;
SYSMENU .F. ;
TITLEBAR .F.
DEFINE LABEL LAB1
ROW 10
COL 10
WIDTH 330
HEIGHT 80
BACKCOLOR {255,255,255}
VALUE ''
END LABEL
DEFINE LABEL LAB11
ROW 35
COL 10
WIDTH 330
HEIGHT 20
FONTNAME 'ARIAL'
FONTSIZE 11
FONTBOLD .F.
ALIGNMENT CENTER
BACKCOLOR {255,255,255}
VALUE LABV //'Enter Text (Escape/Blank to Exit)'
END LABEL
DEFINE BUTTON BUT1
ROW 100
COL 40
WIDTH 100
HEIGHT 30
CAPTION '&Yes'
ACTION IIF(ISWINDOWACTIVE(MYYESNO),{YN := .T. , MyYESNO.Release} ,NIL)
END BUTTON
DEFINE BUTTON BUT2
ROW 100
COL 210
WIDTH 100
HEIGHT 30
CAPTION '&No'
ACTION IIF(ISWINDOWACTIVE(MYYESNO),{YN := .F. , MyYESNO.Release} ,NIL)
END BUTTON
ON KEY F1 ACTION Helping('CRSWin.hlp')
ON KEY ESCAPE OF Myyesno Action IIF(ISWINDOWACTIVE(MYYESNO),{YN := .F. , MyYESNO.Release} ,NIL )
END WINDOW
MYYESNO.BUT1.SetFocus
Myyesno.Activate
Return YN
All The Best,
Franco
Canada
Franco
Canada
Re: Slow down MSGYESNO()
Hola Franco
Segun lo entiendo, yo lo haría de esta forma.
En el grid, poner otro campo en donde marquen cuales lineas se borrarán,
ya marcadas, oprimir un botón que que diga "Borrar lo marcado" y poner un mensaje
de que esperen a que termine el proceso.
--------------------------------------------------------------------------------------------------------------
Hello Franco
As I understand it, I would do it this way.
In the grid, put another field where they mark which lines will be deleted,
already checked, press a button that says "Delete what is marked" and put a message
that they wait for the process to end.
Segun lo entiendo, yo lo haría de esta forma.
En el grid, poner otro campo en donde marquen cuales lineas se borrarán,
ya marcadas, oprimir un botón que que diga "Borrar lo marcado" y poner un mensaje
de que esperen a que termine el proceso.
--------------------------------------------------------------------------------------------------------------
Hello Franco
As I understand it, I would do it this way.
In the grid, put another field where they mark which lines will be deleted,
already checked, press a button that says "Delete what is marked" and put a message
that they wait for the process to end.
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: Slow down MSGYESNO()
oninit CLEAR TYPEAHEAD ?
Angel Pais
Web Apps consultant/architect/developer.
Web Apps consultant/architect/developer.
Re: Slow down MSGYESNO()
Remember myyesno above works fine.
How could we put clear typeahead in hmg`s msgyesno.
This is the problem. If someone hits Y before window is active The error appears.
I can shut down on F3 until the grid updates after F3, but this can be a potential problem in all msgyesno commands.
My myyesno works fine. Hmg`s msgyesno needs Apais idea.
Thanks for thoughts.
How could we put clear typeahead in hmg`s msgyesno.
This is the problem. If someone hits Y before window is active The error appears.
I can shut down on F3 until the grid updates after F3, but this can be a potential problem in all msgyesno commands.
My myyesno works fine. Hmg`s msgyesno needs Apais idea.
Thanks for thoughts.
All The Best,
Franco
Canada
Franco
Canada
Re: Slow down MSGYESNO()
Cada cabeza es un mundo...
--------------------------------------
Each head is a world...
--------------------------------------
Each head is a world...
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: Slow down MSGYESNO()
Help again, how can I set default to no in msgyesno. I have spent an hour searching forum.
Franco
Franco
All The Best,
Franco
Canada
Franco
Canada
Re: Slow down MSGYESNO()
MsgYesNo ( <xData> , [<cTitle>] , [<lRevertDefault>] ) --> lResponse
MsgYesNo ( <xData> , [<cTitle>] ) or MsgYesNo ( <xData> , [<cTitle>], .F. ) default "Yes" button
MsgYesNo ( <xData> , [<cTitle>] , .T. ) default "No" button
MsgYesNo ( <xData> , [<cTitle>] ) or MsgYesNo ( <xData> , [<cTitle>], .F. ) default "Yes" button
MsgYesNo ( <xData> , [<cTitle>] , .T. ) default "No" button
Re: Slow down MSGYESNO()
Thanks for response. I was using this but never thought .T. would be NO. I kept trying .F.
Franco
Franco
All The Best,
Franco
Canada
Franco
Canada