Grids/Combos/CurFld

More advanced topics discussed.

Moderators: Susan Smith, admin, Gabriel

Post Reply
ranjsuri
Posts: 10
Joined: Wed Aug 17, 2011 11:00 am

Grids/Combos/CurFld

Post by ranjsuri »

Questions continue..

Can someone explain why in this example, curfld always returns 1, even if the cursor is returned from the comboboxes

Code: Select all

00020   DIM Combovalues$(3)*10
00040   DATA "Value 1","Value 2","Value 3"
00060   READ Mat Combovalues$
00080   DIM Headings$(5), Widths(5), Forms$(5)*25
00100   LET Headings$(1)="Col 1": LET Headings$(2)="Col 2": LET Headings$(3)="Col 3": LET Headings$(4)="Col 4": LET Headings$(5)="Col 5"
00120   MAT Widths=(4)
00140   MAT Forms$=("CC 2,^nosortLAEX")
00160   DATA "1","2","3","4","5","6","7","8","9","10"
00180   READ Mat Gridvalues$
00200   EXECUTE "con gui on"
00220   OPEN #(Cal:=2): "Srow=5,Scol=5,Rows=13,Cols=30,Caption=GRID COMBO,Parent=none,font=calibri:light:small", DISPLAY, OUTIN  !
00240   PRINT #Cal: Newpage
00260   PRINT #Cal, FIELDS "2,4,9/combo 9,=,SELECT ": Mat Combovalues$ !:
        PRINT #Cal, FIELDS "2,15,9/combo 9,=,SELECT ": Mat Combovalues$
00280   PRINT #Cal, FIELDS "4,2,grid 7/28,headers": (Mat Headings$,Mat Widths,Mat Forms$)
00300   PRINT #Cal, FIELDS "4,2,grid 7/28,=S,500": (Mat Gridvalues$)
00320 INP: RINPUT #Cal, FIELDS "4,2,grid 7/28,CNT,SELONE,1001;2,4,9/combo 9;2,15,9/combo 9": X,Selectedcombovalue$,S$
00340   PRINT #Cal, FIELDS "11,16,CL 14": Str$(Fkey)
00360   PRINT #Cal, FIELDS "12,16,CL 14": Str$(Curfld) & " " & Str$(Curcol) & " " & Str$(Currow)
00390   GOTO INP
00420   END 
Thanks
GomezL
Posts: 239
Joined: Wed Apr 29, 2009 5:51 am
Contact:

Post by GomezL »

It turns out that the "X" in line 140 traps the FKEY, so the "Automatic Tab Navigation" doe not happen.

I added lines 370 & 371 to trap for 110/111 to move the cursor.

"X" give significant control over the process, but also requires the programer to trap for all navigation options.

Code: Select all

00020   DIM Combovalues$(3)*10
00040   DATA "Value 1","Value 2","Value 3"
00060   READ Mat Combovalues$
00080   DIM Headings$(5), Widths(5), Forms$(5)*25
00100   LET Headings$(1)="Col 1": LET Headings$(2)="Col 2": LET Headings$(3)="Col 3": LET Headings$(4)="Col 4": LET Headings$(5)="Col 5"
00120   MAT Widths=(4)
00140   MAT Forms$=("CC 2,^nosortLAEX") ! <----- The "X" In this field is trapping the "TAB KEY"
00160   DATA "1","2","3","4","5","6","7","8","9","10"
00180   READ Mat Gridvalues$
00200   EXECUTE "con gui on"
00220   OPEN #(Cal:=2): "Srow=5,Scol=5,Rows=13,Cols=30,Caption=GRID COMBO,Parent=none,font=calibri:light:small", DISPLAY, OUTIN  ! 
00240   PRINT #Cal: Newpage
00260   PRINT #Cal, FIELDS "2,4,9/combo 9,=,SELECT ": Mat Combovalues$ !:
        PRINT #Cal, FIELDS "2,15,9/combo 9,=,SELECT ": Mat Combovalues$
00280   PRINT #Cal, FIELDS "4,2,grid 7/28,headers": (Mat Headings$,Mat Widths,Mat Forms$)
00300   PRINT #Cal, FIELDS "4,2,grid 7/28,=S,500": (Mat Gridvalues$)
00320 INP: RINPUT #Cal, FIELDS "4,2,grid 7/28,CNT,SELONE,1001;2,4,9/combo 9;2,15,9/combo 9": X,Selectedcombovalue$,S$
00340   PRINT #Cal, FIELDS "11,16,CL 14": Str$(Fkey)
00360   PRINT #Cal, FIELDS "12,16,CL 14": Str$(Curfld) & " " & Str$(Nxtfld) & " " & Str$(Curcol) & " " & Str$(Currow)
00370   IF Curfld=1 And Fkey=110 THEN LET Curfld(2) ! <-- The Tab key has been trapped, but the FKEY does not move the curfld
00371   IF Curfld=1 And Fkey=111 THEN LET Curfld(3) ! <-- The Tab key has been trapped, but the FKEY does not move the curfld
00390   GOTO INP
00420   END 
[/code]
Post Reply