PDA

View Full Version : {On_key=Enter} Problem


ABC123

James Smith
02-02-2005, 06:55 AM
I've noticed in several of my dlg_box scripts that when I use {On_key=Enter} and have regular buttons or radio buttons mixed in with text boxes, when I use the ENTER key to tab from one field to next that when focus is on a button and I hit ENTER that the following field is skipped. If I use the TAB key this does not happen. Here's a sample script that demonstrates the problem.

When the dialog box opens, choose "Multiple Carton Entry".

'Date Created: 06-Jan-2005 12:34:37 PM
'Last Updated: 02-Feb-2005 10:30:35 AM
'Created By : James Smith
'Updated By : James Smith


'var-"costmethodvar=costmethod.value
dim shared Cartontxt as c
crlf=chr(13)+chr(10)

dim shared IncrementByvar as n
IncrementByvar=1
dim shared Incrementvar as n
Incrementvar=1
dim shared Updatevar as n
Updatevar=0
dim shared choosevar as n
choosevar=0
DIM SHARED Firstcarton as N
Firstcarton=0
DIM SHARED Lastcarton as N
Lastcarton=0
DIM SHARED Location as C
'Location=LOCATION.value
Location="TRIO DYEING AND FINISHING"
DIM SHARED PL_Lot_Var as C
'Pl_Lot_Var=PL_LOT.value
Pl_Lot_Var="ca59"
DIM SHARED Status as C
'Status=STATUS.value
Status="OPEN"
DIM SHARED Div as C
'Div=DIV.value
Div="D"
DIM SHARED PL_Lot_Key as C
'PL_Lot_Key=INVENTORY_KEY.value
PL_Lot_Key="99999"
DIM SHARED Type as C
Type="F"
DIM SHARED Product_ID as C
'Product_ID=PRODUCT_ID.value
Product_ID="68X68-59/60F"
DIM SHARED Pattern as C
'Pattern=PATTERN.value
Pattern="kkk222lll"
DIM SHARED Description as C
'Description=PRODDESC.value
Description="'48' 100% CARDED COTTON PLAIN WEAVE FABR"
DIM SHARED Date as D
Date=Date()
DIM SHARED Carton_No as N
Carton_no=0
DIM SHARED Carton_Suffix as C
Carton_Suffix=""
DIM SHARED Yards_Out as N
Yards_Out=0
DIM GLOBAL Color_No as C
Color_No=""
DIM Global Color as C
Color=""
DIM SHARED Quality as C
Quality="Finished Firsts"
DIM SHARED Secorsamp as N
Secorsamp=0


getquality_button_label = "..."
getdescription_button_label = "..."
getcolor_button_label = "..."
ok_button_label = "&CREATE"
cancel_button_label = "&Cancel"
ui_modeless_dlg_box("Add Multiple Inventory Cartons",""%dlg%
{On_key=Enter}
{can_exit=on_exit}
{can_exit=close}
{xmargin=2,1}
{region}
;
;
;
{'%O={C=Dark Blue}Select:%}{sp=3.25}(Choosevar:Single Carton Entry!changeradio_)(Choosevar:Multiple Carton Entry!changeradio2_){sp=30}{condition=(choosevar""0)}"%I=$a5_refresh;O= {I=1}{C=Dark Red}%!GETDQ"{condition=.t.}{sp=5}"%I=$a5_record_cancel;O= {I=1}{C=Dark Red} Exit %!EXIT";
{endregion};
{condition=(choosevar""0)}
{region}
{frame=1,2}{sp=.5}
{region}
{sp=2}{'%O={C=Dark Blue}Location:%}| {text=33,Location};
;
;
;
;
;
;
;
{'%O={C=Dark Blue}Product ID:%}| [.30Product_ID] ;
;
;
{'%O={C=Dark Blue}Pattern:%}| [.30Pattern];
;
;
{'%O={C=Dark Blue}Description:%}| [.30Description];
;
{'%O={C=Dark Blue}Date::%}| [%DATE%.15Date!Date_*];
;
;
{'%O={C=Dark Blue}Color #:%}| "*3=getcolor_button_label!GETCOLOR"{sp=1.5}[.24Color_No];
;
;
{'%O={C=Dark Blue}Color:%}| [.30Color!Colorchange_];
;
;
{'%O={C=Dark Blue}Quality:%}| [.30Quality];
;
;
{'%O={C=Dark Blue}2nds/Sample:%}| [.15Secorsamp];
;
;
{endregion};
{frame=1,2}
{region}
;
;
{lf};
;
;
;
;
;
;
{endregion};
{endregion}
{region}
{frame=1,2}
{region}
{'%O={C=Dark Blue}PL Lot:%}| {text=20,Pl_Lot_Var};
;
;
{'%O={C=Dark Blue}Status:%}| {text=10,Status};
;
;
{'%O={C=Dark Blue}Div:%}| {text=10,Div};
;
;
{'%O={C=Dark Blue}PL Lot Key:%}| {text=10,PL_Lot_Key};
;
;
{'%O={C=Dark Blue}Type:%}| {text=10,Type};
;
{line=2,0};
;
;
{condition=(choosevar=2)} {'%O={C=Dark Blue}Increment By:%}{sp=1}|(IncrementByvar:Carton #)(IncrementByvar:Carton Suffix);{condition=.t.}
;
;
{condition=(choosevar""0)} {text=15,Cartontxt}| [%z%.15Firstcarton]{condition=.t.};
;
;
{condition=(choosevar=2)} {'%O={C=Dark Blue}Last Carton #:%}| [%z%.15Lastcarton]{condition=.t.}{condition=(choosevar""0)};
;
;
{'%O={C=Dark Blue}Carton Suffix:%}| [.10Carton_Suffix];
;
;
{'%O={C=Dark Blue}Yards:%}| [%z%.15Yards_Out!YardsOut_*];
;
;
{endregion};
{frame=1,2}
{region}
;
;
{sp=8}{condition=(choosevar=1)}{'%O={C=Dark Blue}Auto Increment?:%}{sp=1}(Incrementvar:Yes!changeradioA_)(Incrementvar:No!changeradioAA_){condition=.t.};
;
;
;
;
;
{endregion};
{endregion};
{endregion};
{condition=.t.}
;
;
;
;
{justify=Center}
{region}
{condition=(choosevar=1)}"%I=$a5_x_execute;O= {I=1}{C=Dark Blue} Create %!SINGLE"{condition=.t.}{condition=(choosevar""0)} "%I=$a5_record_cancel;O= {I=1}{C=Dark Red} Cancel %!CANCEL" {condition=(choosevar=2)} "%I=$a5_x_execute;O= {I=1}{C=Dark Blue} Create %!Multiple"{condition=.t.}
{endregion};
%dlg%,""%code%
IF a_dlg_button = "EXIT" THEN
ui_modeless_dlg_close("Add Multiple Inventory Cartons")

END IF
IF a_dlg_button = "GETCOLOR" THEN
script_play("Dlg_ColorSelectList")
END IF
IF left(a_dlg_button,9) = "YardsOut_" THEN
IF Quality="Sample" THEN
Secorsamp=Yards_Out
END IF
IF a_dlg_button = "YardsOut_killfocus" THEN
a_dlg_button = ""
IF choosevar=1 THEN
a_dlg_button = "Single"
END IF
IF choosevar=2 THEN
a_dlg_button = "Multiple"
END IF
END IF
END IF
IF a_dlg_button="GETDQ" THEN
script_Play("Dlg_UpdateDQ")
a_dlg_button=""
end if


IF a_dlg_button="changeradio_" THEN
ui_dlg_ctl_goto("Add Multiple Inventory Cartons","Product_ID")
Cartontxt="Carton #:"
END IF
IF a_dlg_button="changeradio2_" THEN
ui_dlg_ctl_goto("Add Multiple Inventory Cartons","Product_ID")
Cartontxt="First Carton #:"
END IF
IF a_dlg_button = "Enter" THEN
'a_dlg_button = ""
sys_send_keys("{TAB}")
END IF
IF a_dlg_button = "Cancel" THEN
code1=UI_YES_NO
result=ui_msg_box("","This action will CANCEL all changes. CONTINUE??",code1)
IF result=UI_YES_SELECTED THEN
Product_Id=""
Pattern=""
Description=""
Date=ctod("")
Carton_No=0
Carton_Suffix=""
Yards_Out=0
Color_No=""
Color=""
Quality=""
Secorsamp=0
ELSE
END IF
END IF
IF left(a_dlg_button,5) = "Date_" THEN
IF a_dlg_button = "Date_killfocus" THEN
Date = ctod(dtoc(Date))
END IF
a_dlg_button = ""
END IF
IF a_dlg_button = "Close" THEN

ui_modeless_dlg_close("Add Multiple Inventory Cartons")

END IF

%code%)