GOTFOCUS for non Express GET

This forum is for general support of Xbase++
Post Reply
Message
Author
BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

GOTFOCUS for non Express GET

#1 Post by BruceN »

I'm trying to integrate the number pad I modified into our invoice screen which is native xbase, not using express (I think I have it working everywhere else).

We have a GET for price. Under certain conditions, it just grabs price from products file and 'moves on'. Under other conditions, it stops on field to allow price to be entered or changed.

If it should stop for edit, and touch <> 'N' I want the number pad to pop up (PopNumPad() ), and return the value to the array element minvc[itm_ctr][5], then 'move on'.

The value has to validated as well.

Easy to do with DCGET.. but native get I don't think has an GOTFOCUS parameter

Here;s what I have now:
if touch = 'N'
@ rrow, 68 get minvc[itm_ctr][5] pict pd_pic;
valid min_margin(@minvc,itm_ctr,,@dummy)
else
????????

thanks
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: GOTFOCUS for non Express GET

#2 Post by Auge_Ohr »

BruceN wrote:If it should stop for edit, and touch <> 'N' I want the number pad to pop up (PopNumPad() ), and return the value to the array element minvc[itm_ctr][5], then 'move on'.

Easy to do with DCGET.. but native get I don't think has an GOTFOCUS parameter

Here;s what I have now:
if touch = 'N'
@ rrow, 68 get minvc[itm_ctr][5] pict pd_pic;
valid min_margin(@minvc,itm_ctr,,@dummy)
else
????????

thanks
2 Choise :
a.) while it is "before" you can try WHEN and use MyPopUp( @MyVar ) ( @ not need if Array )
b.) modify C:\ALASKA\XPPW32\Source\SYS\GetSys.prg
for GUI = YES C:\ALASKA\XPPW32\Source\SYS\GetSysX.prg
greetings by OHR
Jimmy

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: GOTFOCUS for non Express GET

#3 Post by BruceN »

almost....

if touch = 'N'
@ rrow, 68 get minvc[itm_ctr][5] pict pd_pic;
valid min_margin(@minvc,itm_ctr,,@dummy)
else
@ rrow, 68 get minvc[itm_ctr][5] pict pd_pic;
valid min_margin(@minvc,itm_ctr,,@dummy);
when MyPopUp(minvc[itm_ctr][5])


function MyPopUp(tmp1)
tmp1:=PopNumPad(tmp1,'Enter Price')
return .f.


It calls the number pad popup, but closes it immediately without prompting for value. Everywhere else I use PopNumPad it allows for entry and closes when I click OK on the number pad.

hmmmmm
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GOTFOCUS for non Express GET

#4 Post by rdonnay »

Native Gets DO have a GotFocus. It is called the setInputFocus "callback". Look it up in the Xbase++ docs.
The eXpress train is coming - and it has more cars.

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: GOTFOCUS for non Express GET

#5 Post by BruceN »

I've been playing with this for 2 days with bizarre results.

(remember, this is OLD clipper code modified thru about 8 generations of changes)
Situation: a get on left side of screen for product ID, once that is read, get on right side for price shows (separate read statement). Using a WHEN clause with the call to the number pad for price entry in it, if I type in the ID the price read loads the numpad, then closes it immediately. If I use a button to pop up the keypad to enter the ID in, then everythnig works fine.

So much for the idea of a function being a 'blackbox' with no knowledge of anything except its input parameters.

I gave up and tried a brute force method. I tied the numpad function to a hotkey and then used a PostAppEvent to create that keystroke. It works. I know... not slick, but it appears to work properly.

thanks for thoughts anyway...
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GOTFOCUS for non Express GET

#6 Post by rdonnay »

If you can send me a small sample program, I'll see what I can do.
The eXpress train is coming - and it has more cars.

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: GOTFOCUS for non Express GET

#7 Post by BruceN »

thanks Roger.. but no need. I tried to replicate the 'wrong' behavior in a small sample and couldn't get it to misbehave. In our real convoluted, cludged up code it acts up. I have a workaround so it is now fully functional, albeit even more cludged :)

thanks anyway.
There are only 10 kinds of people - those who understand binary and those who don't :)

Post Reply