[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
I am using the enter key to navigate in the grid when you do a enter key the grid generate a msg begin-entry and you are capable to inquire the value that been enter
INQUIRE GRID-HANDLE
ENTRY-REASON GRID-ENTRY
IF GRID-ENTRY = X"0D"
this meen that the user did a enter key so i moving to the next cell end when i am at the last cell i am moving to the next row and
when the next row past the last row i am moving to the next field.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
I am using the enter key to navigate in the grid when you do a enter key the grid generate a msg begin-entry and you are capable to inquire the value that been enter
INQUIRE GRID-HANDLE
ENTRY-REASON GRID-ENTRY
IF GRID-ENTRY = X"0D"
this meen that the user did a enter key so i moving to the next cell end when i am at the last cell i am moving to the next row and
when the next row past the last row i am moving to the next field.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Thanks for that, I will experiment.
I have decided to disable the USE-TAB property on the grid and just navigate the grid using the arrow keys. As long as they obey the rules the user should cope.
I will then have the TAB key take me out of the grid whatever row I am on.
When ENTER is pressed and the MSG-BEGIN-ENTRY event occurs I set the EVENT-ACTION to EVENT-ACTON-FAIL-TERMINATE.
This causes control to pass back to the 'main' screen accept test.
I have manipulated the main .cbl source to call my own version of the ON EXCEPTION perform -evaluate-func paragraph [Note I am using Workbench to generate most of my source and had originaly done this to address the issue of moving 4 to the ACCEPT-CONTROL so I can use the CONTROL-ID of the field to place the cursor].
In this way I test the explicit CONTROL-ID of the grid (similar to the way the screen tabs function appears to be tested) if the event-type is MSG-BEGIN-ENTRY cause my own processing to occur and place the data and cursor in the apropriate field.
This appears to work fine, although I am still having ssues wth CURSOR-Y and Y properites because when I do an INQUIRE on the grid as I do not yet appear to be retrieving the correct row, but thats todays job/reading.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Thanks for that, I will experiment.
I have decided to disable the USE-TAB property on the grid and just navigate the grid using the arrow keys. As long as they obey the rules the user should cope.
I will then have the TAB key take me out of the grid whatever row I am on.
When ENTER is pressed and the MSG-BEGIN-ENTRY event occurs I set the EVENT-ACTION to EVENT-ACTON-FAIL-TERMINATE.
This causes control to pass back to the 'main' screen accept test.
I have manipulated the main .cbl source to call my own version of the ON EXCEPTION perform -evaluate-func paragraph [Note I am using Workbench to generate most of my source and had originaly done this to address the issue of moving 4 to the ACCEPT-CONTROL so I can use the CONTROL-ID of the field to place the cursor].
In this way I test the explicit CONTROL-ID of the grid (similar to the way the screen tabs function appears to be tested) if the event-type is MSG-BEGIN-ENTRY cause my own processing to occur and place the data and cursor in the apropriate field.
This appears to work fine, although I am still having ssues wth CURSOR-Y and Y properites because when I do an INQUIRE on the grid as I do not yet appear to be retrieving the correct row, but thats todays job/reading.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Originally posted by axc
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy.
Here is a sneaky trick you might try. using the c$keymap routine alter the behavior of the tab key so that it maps to an exception key or something else you can execute code on. Change another key (something not used) so that it behaves like the tab key.
When the user hits tab, he really generates an excpetion. Evaluate your condition and see if you want a real tab to fire. If you do, use w$keybuf and post your special key which you have assigned to tab on the keyboard. I am not sure if this will work in a graphical environment, but I've used it in character and it seems plausible.
Merlin
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Using Msg-Goto-Cell Event, Cursor-x and Cursor-y are the coordinates of the cell you're leaving. Event-data-1 and Event-data-2 are the coordinates of the cell that you are going to.
In addition, try Event-action-fail-terminate instead of Event-action-fail, to use Grid's before procedure event. It helps me to close the program or move to a field when Enter pressed on a particular cell.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Using Msg-Goto-Cell Event, Cursor-x and Cursor-y are the coordinates of the cell you're leaving. Event-data-1 and Event-data-2 are the coordinates of the cell that you are going to.
In addition, try Event-action-fail-terminate instead of Event-action-fail, to use Grid's before procedure event. It helps me to close the program or move to a field when Enter pressed on a particular cell.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Micr4517, Can you explain further how this works (see below) as I am trying to use ENTER key (instead of the TAB) to move to the next cell in the grid? My users do a lot of numerical data entry and want to use the numerical keypad with the ENTER key using one hand. (How do you subsitute, ENTER for Tab key) Please advise.
Thanks, Mary
Micr4517 user posted this below:
I am using the enter key to navigate in the grid when you do a enter key the grid generate a msg begin-entry and you are capable to inquire the value that been enter
INQUIRE GRID-HANDLE
ENTRY-REASON GRID-ENTRY
IF GRID-ENTRY = X"0D"
this meen that the user did a enter key so i moving to the next cell end when i am at the last cell i am moving to the next row and
when the next row past the last row i am moving to the next field.:confused: :confused: :confused: :confused: :confused:
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Micr4517, Can you explain further how this works (see below) as I am trying to use ENTER key (instead of the TAB) to move to the next cell in the grid? My users do a lot of numerical data entry and want to use the numerical keypad with the ENTER key using one hand. (How do you subsitute, ENTER for Tab key) Please advise.
Thanks, Mary
Micr4517 user posted this below:
I am using the enter key to navigate in the grid when you do a enter key the grid generate a msg begin-entry and you are capable to inquire the value that been enter
INQUIRE GRID-HANDLE
ENTRY-REASON GRID-ENTRY
IF GRID-ENTRY = X"0D"
this meen that the user did a enter key so i moving to the next cell end when i am at the last cell i am moving to the next row and
when the next row past the last row i am moving to the next field.:confused: :confused: :confused: :confused: :confused:
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
WHEN MSG-BEGIN-ENTRY
INQUIRE GRID-HANDLE
CURSOR-X = IDX-X
CURSOR-X = IDX-Y
ENTRY-REASON GRID-ENTRY
IF GRID-ENTRY = X"0D"
ADD 1 TO IDX-X
********* you have to now the last cell
IF IDX-X
ADD 1 TO IDX-X
ELSE
************* this will create a new line and go to the first cell
ADD 1 TO IDX-Y
MOVE 1 TO IDX-X
MODIFY GRID-HANDLE
NUM-ROWS IDX-Y
CURSOR-X = IDX-X
CURSOR-Y = IDX-Y
END-IF
END-IF
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
if you want to do a lot of creative things with the keyboard and acucorp screen objects, there are a few functions you need to become very familiar with.
call "C$KEYMAP" using "1". | push keyboard
this pushes the current keyboard onto a configuration stack. This basically means you can make changes to the keyboard layout and set them back later, using
call "C$KEYMAP" using "0". | pop keyboard
The following command hacks the enter key to the tab key:
set environment "Keystroke" to "Edit=Next Terminate=9 ^M".
the following command hacks the shift-tab to give it a termination code, which it normally doesn't:
set environment "Keystroke" to "Terminate=98 kB"
the following command moves the F9 terminate code to #50, so it no longer gets thrown when users hit the tab key:
set environment "Keystroke" to "Edit=Next Terminate=9 ^M".
Another useful command is the W$KEYBUF routine, which you can use to kit keys for the user. For example, in a grid control I like to pop up a hand rolled status box. If the user hits f10 to exit (my exit key), I echo that key to the grid to go to the exiting logic.
Merlin
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
if you want to do a lot of creative things with the keyboard and acucorp screen objects, there are a few functions you need to become very familiar with.
call "C$KEYMAP" using "1". | push keyboard
this pushes the current keyboard onto a configuration stack. This basically means you can make changes to the keyboard layout and set them back later, using
call "C$KEYMAP" using "0". | pop keyboard
The following command hacks the enter key to the tab key:
set environment "Keystroke" to "Edit=Next Terminate=9 ^M".
the following command hacks the shift-tab to give it a termination code, which it normally doesn't:
set environment "Keystroke" to "Terminate=98 kB"
the following command moves the F9 terminate code to #50, so it no longer gets thrown when users hit the tab key:
set environment "Keystroke" to "Edit=Next Terminate=9 ^M".
Another useful command is the W$KEYBUF routine, which you can use to kit keys for the user. For example, in a grid control I like to pop up a hand rolled status box. If the user hits f10 to exit (my exit key), I echo that key to the grid to go to the exiting logic.
Merlin
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
I use the following code in the msg-finish-entry event. This code simulates the pressing of the enter key, so after the user finishes the entry, the next column is selected and the grid comes in entry-mode again. This is very useful when you put default values in the grid.
The only drawback is, that this behaviour is only wanted when the user finishes the entry with the enter key and not with something else like shift-tab or mouseclick. But I have heard in version 6.1.1 there is an enhancement wich allows you to accept FINISH-REASON just as you can now accept the ENTRY-REASON.
grid-msg-finish-entry.
add 1 to idx-x
modify grid-handle, cursor-x = idx-x
call "w$keybuf" using "1" "{^M}"
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
I use the following code in the msg-finish-entry event. This code simulates the pressing of the enter key, so after the user finishes the entry, the next column is selected and the grid comes in entry-mode again. This is very useful when you put default values in the grid.
The only drawback is, that this behaviour is only wanted when the user finishes the entry with the enter key and not with something else like shift-tab or mouseclick. But I have heard in version 6.1.1 there is an enhancement wich allows you to accept FINISH-REASON just as you can now accept the ENTRY-REASON.
grid-msg-finish-entry.
add 1 to idx-x
modify grid-handle, cursor-x = idx-x
call "w$keybuf" using "1" "{^M}"
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Hello, again!! After some reading your suggestions: I have thus far used Micr4517's suggestion. Thanks it works, but I still have a little problem, which is that I have three columns for quantity entries but sometimes a user will not need to enter anything for a cell as the cells are already defaulted to zero. Entering an ENTER key will only work if you put in a quantity amount but if one chose to bypass that field as they want it to be zero, it will not work as pressing the enter key puts in an edit mode on a "non-entered qty cell" so you have to hit Enter key twice to move to the next cell. (Hope I am making sense here.) See below, the second column is zero, in that column you have to hit enter key twice to move to WH3 cell.
Any ideas to get around pressing enter key, twice? (and besides entering manually a zero for that cell)
:rolleyes:
Item WH1 WH2 WH3
M444 5 0 4
Below is my logic:
WHEN msg-finish-entry
INQUIRE GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
IF GRID-X
ADD 001 TO GRID-X
MODIFY GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
ELSE
IF GRID-Y
MOVE 002 TO GRID-X
ADD 001 TO GRID-Y
MODIFY GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
ELSE
MOVE 1 TO CONTROL-VALUE
END-IF
END-IF
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
at msg-finish-entry you have to do your modif at the begining of entry.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
at msg-finish-entry you have to do your modif at the begining of entry.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Thanks to all who helped! I was able to combine two suggestions from the forum into one logic to enable my grid to use either TAB or ENTER key to go foward to the next cell in the grid. However, to make the TAB work alongside with the ENTER key, you need to remove the "USE-TAB" in the grid handle of the screen section to make it work properly. The w$keybuf command is good for when you use default values in your cells.
In order to help others, I enclosed my logic below::D Good Luck!
EVALUATE event-type
WHEN msg-finish-entry
INQUIRE GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
MODIFY GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
CALL "w$keybuf" using "1" "{^M}"
IF GRID-X
ADD 001 TO GRID-X
MODIFY GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
ELSE
IF GRID-Y
MOVE 002 TO GRID-X
ADD 001 TO GRID-Y
MODIFY GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
ELSE
MOVE 1 TO CONTROL-VALUE
END-IF
END-IF
END-EVALUATE.
[Migrated content. Thread originally posted on 05 February 2003]
I have found out how to disable cells in a grid i.e. by placing
move event-action-fail to event-action
in a ev-msg-goto-cell event
Then by effectively adding 1 to cursor-y I am able to push the cursor to the first cell on the following grid row
However I cannot see how to exit the grid when I hit the last row.
The folowing is my code whch works as I tab down the grid but stalls when I ht the last row. I would like to to tab out of the grid and place my cursor in the next control. I have tried it with and without the move of event-acton-fail (and event-action-fail-terminate for that matter) on the else statement but with no joy
Main-MS-payments-Gd-Ev-Msg-Goto-Cell.
* Navigate around grid by pushing cursor to next line
* If the current line is the last line push to the next field
if event-data-1 not = 1
inquire Main-MS-paymeth-Gd, last-row nos-pmeths
if nos-pmeths > event-data-2
move event-action-fail to event-action
modify main-ms-paymeth-Gd,
cursor-y = (event-data-2 1)
cursor-x = 1
else
move event-action-fail to event-action
move 50 to control-id
move 4 to accept-control
end-if
end-if
.
Perhaps bizzarly I am attempting to use a grid more for display purposes than editing as it presents data more attractively than rows and addresses issues I have with proportional fonts and titles.
Ideally when enter is pressed I would like to pull data from the grid populate fields outside the grid and edit them there, writing them back once complete, but agan, whilst I can pull and populate I cannot place my cursor into an external field.
Can ayone help?
Thanks to all who helped! I was able to combine two suggestions from the forum into one logic to enable my grid to use either TAB or ENTER key to go foward to the next cell in the grid. However, to make the TAB work alongside with the ENTER key, you need to remove the "USE-TAB" in the grid handle of the screen section to make it work properly. The w$keybuf command is good for when you use default values in your cells.
In order to help others, I enclosed my logic below::D Good Luck!
EVALUATE event-type
WHEN msg-finish-entry
INQUIRE GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
MODIFY GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
CALL "w$keybuf" using "1" "{^M}"
IF GRID-X
ADD 001 TO GRID-X
MODIFY GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
ELSE
IF GRID-Y
MOVE 002 TO GRID-X
ADD 001 TO GRID-Y
MODIFY GRID-1
CURSOR-X = GRID-X
CURSOR-Y = GRID-Y
ELSE
MOVE 1 TO CONTROL-VALUE
END-IF
END-IF
END-EVALUATE.