dbTalk Databases Forums  

Re: PdoxDOS SHOWDIALOG problem

comp.databases.paradox comp.databases.paradox


Discuss Re: PdoxDOS SHOWDIALOG problem in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dick Rubin
 
Posts: n/a

Default Re: PdoxDOS SHOWDIALOG problem - 06-23-2003 , 04:51 PM






Thanks, I believe I've figured this out -- I wanted to change the
operator's entry in an ACCEPT control, based on some validation rules,
and continue with the event that kicked off the UPDATE trigger --
typically TABbing to the next control. Therefore I was returning TRUE
from my dialogproc.

Turns out when a dialogproc returns TRUE after an UPDATE trigger, the
dialog automatically updates the variable bound to the control being
updated with the value of the control at the time the dialogproc was
called. Any change made before that, in the dialogproc, is overwritten.

My simple solution was to change the variable value to what I want,
RESYNCCONTROL so the ACCEPT control displays the new value, and return
False. The operator has to press TAB once more to finalize the change
and move on.

--Dick

In article <MPG.195be6515390fd0e989688 (AT) pnews (DOT) thedbcommunity.com>,
drubin (AT) earthlink (DOT) net says...
Quote:
SHOWDIALOG "Test"
PROC "dialogboxproc.l"
TRIGGER "OPEN", "UPDATE"

@2,1 HEIGHT 20 WIDTH 57

@5,9
?? "testvar.a = " + testvar.a

ACCEPT @3,9 WIDTH 36
"A25"
TAG "tagTestVar"
TO testvar.a

PUSHBUTTON @15,37 WIDTH 13
"Ok"
CANCEL
TO btn
ENDDIALOG

I initialize testvar.a to "", start the SHOWDIALOG and enter "Hello" in
the ACCEPT control, then tab out of it, triggering UPDATE.
Dialogboxproc.l() calls update.tagtestvar() (thank you, Skip Rowland):

PROC update.tagtestvar()

PRIVATE proc.a
proc.a = "update.tagtestvar"

DEBUG
; CONTROLVALUE("tagtestvar") = "Hello"
; testvar.a = ""

testvar.a = "I changed it"
; CONTROLVALUE("tagtestvar") = "Hello"
; testvar.a = "I changed it"

RESYNCCONTROL "tagtestvar"
; CONTROLVALUE("tagtestvar") = "I changed it"
; testvar.a = "I changed it"

RETURN ; dialogboxproc.l RETURNs True to the SHOWDIALOG

ENDPROC

When control returns to SHOWDIALOG, CONTROLVALUE("tagtestvar") is still
"I changed it", but testvar.a = "Hello" !!!

I've tried reassigning testvar.a = CONTROLVALUE("tagtestvar") after
RESYNCCONTROL, and sprinkling REFRESHDIALOG here and there, but to no

Reply With Quote
  #2  
Old   
Steven Green
 
Posts: n/a

Default Re: PdoxDOS SHOWDIALOG problem - 06-23-2003 , 06:26 PM






Dick Rubin wrote:

Quote:
My simple solution was.. <snip> .. The operator has to press TAB once more
to finalize the change and move on.
so the user has to press the same key twice to get out of the ACCEPT box..
and you can that a simple solution? <sigh>


--

Steve Green - Diamond Software Group, Inc - Waldorf Maryland USA
Corel CTech Paradox - http://www.diamondsg.com - Support/Downloads/Links
---------------------------------------------------------------------------------

Do you need a Sanity Check? http://www.diamondsg.com/sanity.htm
Upgrade/Downgrade versions? http://www.diamondsg.com/upgrade.htm
-------------------------------------------------------------------------




Reply With Quote
  #3  
Old   
Kevin Donaker-Ring
 
Posts: n/a

Default Re: PdoxDOS SHOWDIALOG problem - 06-24-2003 , 12:34 PM



Steve,

Where would you place the REPAINTDIALOG command in the code Dick Rubin
posted?

--
Kevin
(if you email me, make sure to DeSpamulate my address)
------------------------------
- Kevin Donaker-Ring -
- Executive Director, AISE -
- http://www.aise.com -
------------------------------


Steven Green wrote:
Quote:
Dick Rubin wrote:


I didn't make it clear -- the problem is not the display, but the actual
value of the variable.


no, it's the display.. didn't you try what I suggested?

the problem is this.. normally, you'll have a var that gets updated in your
waitproc.. when you REFRESH and cycle back to the dialog, you see the new
value of the var..

but.. in this case, you're reseting the value of the control, then resetting
the var based on that.. it's not the same thing..

when you cycle back to the dialog, the background (including text, vars,
etc) gets done first.. then the controls.. but then you're changing the var
again *after* the control.. that's why you need the REPAINT.. to redo the
background (text, vars, etc.) to reflect changes *after* the CONTROL stuff..



--

Steve Green - Diamond Software Group, Inc - Waldorf Maryland USA
Corel CTech Paradox - http://www.diamondsg.com - Support/Downloads/Links
---------------------------------------------------------------------------------

Do you need a Sanity Check? http://www.diamondsg.com/sanity.htm
Upgrade/Downgrade versions? http://www.diamondsg.com/upgrade.htm
-------------------------------------------------------------------------




Reply With Quote
  #4  
Old   
Steven Green
 
Posts: n/a

Default Re: PdoxDOS SHOWDIALOG problem - 06-24-2003 , 01:09 PM



Kevin Donaker-Ring wrote:

Quote:
Where would you place the REPAINTDIALOG command in the code Dick Rubin posted?
I stuck it right where he tried all the REFRESH stuff.. worked like a champ.. the point
is, it's gotta be the last thing you do.. *after* the control is changed and
refreshed..

FWIW.. it's the *only* way I could make the var update on the dialog..


--

Steve Green - Diamond Software Group, Inc - Waldorf Maryland USA
Corel CTech Paradox - http://www.diamondsg.com - Support/Downloads/Links
---------------------------------------------------------------------------------
Do you need a Sanity Check? http://www.diamondsg.com/sanity.htm
Upgrade/Downgrade versions? http://www.diamondsg.com/upgrade.htm
-------------------------------------------------------------------------




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.