PDA

View Full Version : Grid Object Entering logic: A Unified Option.



Clive Richmond
10-Jun-2010, 12:16 PM
John,

After reading your post Grid Object Entering logic (http://support.dataaccess.com/forums/showthread.php?t=43012) Tom and I have been looking at ways to unify 'The Object Enable / Disable Approach' versus 'The Post Entering Approach'. We like the easy of programming that the first approach offers but not its navigation restrictions while the second approach is more familiar but it has its own navigation restrictions.

We've been able to combine the two by placing a container overlaying the grid. While the grid is disabled any mouse click 'falls through' and is trapped. The co-ordinates are recorded and the equivalent of child entering processed. Assuming this was successful the grid is re-enabled and using the previously record co-ordinates a mouse click done with focus going to the correct row in the grid. Combining this with the property pbGrayIfDisable the new grid head / line navigation is very similar to the way old girds behave.

Tom will add (and correct) anything I've missed tomorrow plus post our prototype. Our question is can a similar sort of 'psuedo' behaviour be implemented in the runtime to do something similar and provide a unified approach?

Chris Spencer
10-Jun-2010, 05:56 PM
Clive
Why all the voodo with the grid??
The legacy way works fine I have subclassed the grid to add the behaviour required with no overlays etc

Maybe I am missing something?

Tom Murphy
10-Jun-2010, 11:24 PM
Hi John

Attached is our prototype view which Clive described.

3482




The advantages of this way are:

The grid doesn't take the focus un-necessarily, and you don't require the OnEntering, OnPostEntering, phoPriorScopeFocus methods and properties etc.
You can still click on the grid and have it save the header when needed and take the focus like the old grid.
Where you clicked in the grid is also remembered i.e. if you clicked on row 3 cell 4 the focus goes there. In the legacy view it doesn't, the focus returns to the last cell that the grid previously had.
This is your preferred way to work with the new Grid.
It offers the best of worlds in a single approach.
The disadvantage is having to have an underlying container to capture the mouse click, if this could be replaced by something in the runtime that would be cool.

The attached example is based on new order entry style and still has the auto save from the last control on the header and the idle handler to enable/disable the grid. But the save header button has been commented out as it is no longer needed and we have set the pbGrayIfDisable to false and enabled row highlighting similar to the old grid. All the changes are marked with a ToDo so a ctrl+T will take you through them all. And of course you can now click on the grid at any time and it prompts to save the header if needed.

Clive Richmond
11-Jun-2010, 12:25 AM
Why all the voodo with the grid??
The legacy way works fine I have subclassed the grid to add the behaviour required with no overlays etc

Maybe I am missing something?

The current legacy approach works up to a point. As soon as you introduce a header confirmation the event navigation no longer does what I believe any reasonable user would expect.

Take a look at the sequence of images below. I've made a change to the Order By column and decided to click on the fourth row's description column. After I agree to make the change where would you expect the focus to be in the grid? The first row or the fourth row? For me it's the fourth i.e. my intention has been honoured.

3483 3484 3485

What we're suggesting would provide a single approach covering both 'The Object Enable / Disable Approach' versus 'The Post Entering Approach'. If this could be handle in the runtime do we really need two different approaches?

Chris if you've a better way to solve this problem perhaps you may like to share your code? However I still believe if DAW had a unified approach, combining the benefits of both approaches, it would be much simpler all round.

Chris Spencer
11-Jun-2010, 03:13 AM
John
I have checked out what the Western Alchemists have come up with here.
If this solution re mouse clicks could be integrated into the RT this indeed looks like almost the perfect solution for the legacy crowd (of which I am one)

Clive Richmond
11-Jun-2010, 06:04 AM
Just like to point out to anyone reading this that we are not advocating another option i.e. a third option. We are more interested in a single, or unified, option.

I have tried to edit the title but, while the change is recorded on the individual posts, it is not reflected in the main forum.