PDA

View Full Version : Navigation looking much better with minor changes



Russell McDougall
8-May-2010, 06:04 PM
I am mindful of John's last post to Clives grid questions and some of these will be addressed in the next build.

I mostly have the navigation working like the old grids which as Clive and others explain, -worked well for the heads down data entry and must be retained. Having amended these simple navigation issues I am starting to like the new grids for their far more clean and logical coding style.

Navigation has created a lot of negative debate, John's pack of wolves, which has distracted from other good features. In my opinion two DAC assumptions have caused this. It seems the new grid control was approached more as a spreadsheet type grid rather than a fast way to enter data which would retain the former navigation methodology. Speed is paramount for data entry. Secondly I am puzzled why the normal inheritance rules for the enter key and fonts was broken.

These issues are very simple to change and would put the debate back on track to the more important issues.


:) What i have done:

My assumptions:
1. In accordance with inheritance rules the Enter key must inherit the pbEnterKeyAsTabKey.
2. users should have an option to never be required to do key press's to enter or exit "Edit mode". This doubles the key strokes.
3. Autofind should work like old grids.

It is important when considering navigation to separate the navigation for the grid from navigation within a column

Accordingly I subclassed the cjDbGrid class and added the following code:

It needs code to control the inheritance of pbEnterKeyAsTabKey. I have merely jumped in and assumed this is true for simplicity.

The Home and End on_key mappings were deleted direct because i could not see how to default these back to their normal behaviour using on_key.



Set pbTrapTabKey to False
On_Key Key_Ctrl+Key_End Send MoveToEndOfGrid
On_Key Key_Ctrl+Key_Home Send MoveToBeginningOfGrid
On_Key Key_Ctrl+Key_Left_Arrow Send MoveToFirstEnterableColumn
On_Key Key_Ctrl+Key_Right_Arrow Send MoveToLasttEnterableColumn
On_Key Key_Enter Send Next
End_Procedure

Procedure MoveToEndOfGrid
Send MoveToFirstEnterableColumn
Send MovetoLastRow
End_Procedure

Procedure MoveToBeginningOfGrid
Send MoveToFirstEnterableColumn
Send MovetoFirstRow
End_Procedure


The reason for using Control Left and right arrows was to extend the control up and down arrow for row up and row down logic. Debateable I know.

I believe the jump to first row should also imcorporate a jump the first enterable column.
I would be open to an argument the end of grid should also goto the last enterable column but in my experience most high speed data entry users mostly want to reposition themselves at the first enterable column. Even for row up and down but I keep out of that for simplicity.

In the cCjGridColumnEdit class, I cheated and changed the base class because this class is incorporated in a heirachy of vdf classes.

The enter key should send next rather than toggle edit mode.
This duplicates the behaviour of the tab key.

Lastly I failed to comprehend why autofinding on the main file was disabled as it is in cCjDbGrid.
Disabling this in a header detail grid is logical but not in a Grid only view such as the customer grid view in the grid samples.

On any line type a customer number that is say higher than the line you are on. In old grids this would jump to the code keyed. Similarly in old grids if you inserted or appended a line and the customer number already was contained in the grid it would cancel the insert or append and latch onto the code without any prompt help.