Modified the portion of the template that creates a new record.  I have at last managed to code a simple way to discover the control that should initially be focused - basing the working out on the true tab order.  This needs to take into account the fact that an item on a panel may have a TabIndex that is smaller than any other - but this represents the TabIndex on the sub-panel itself, which has a TabIndex of its own.  The controls on this sub-panel will not be reached until the panel itself is reached.

So although in a previous checkin I added the ability to specify the initial focused control in YAML, we probably won't need that any more because the current code should get it right!
Fixed a small bug that I found in the generator for Filter/Find and the call to the manual method ApplyFilterManual.  The codelet passed  the wrong variable name as parameter so the generated code would not compile.  No code uses this codelet yet anyway.
Fixed a simple unreported issue where these two screens did not highlight the initial row correctly because they were missing SelectRowInGrid(1)
Removed the manual code to set the initial focus to the comboBox because the auto generated code now gets the correct control for initial focus.  (I added this line in a recent check-in as a temporary measure.  Now we don't need it.)
Added a message box that gets displayed when you choose to run any test.  It tells you which database is current and reminds you that all data will be lost.  If the active database is called nantTest the message is not displayed.
Three changes to the grid:
1. The main change is to the PerformStretch() method.  This is only called from one place and the column autosize has just been called.  Yes this method called it again - and on all rows.  The result was strange in that each time it was called (by repeatedly maximizing and restoring the window, for example) it took longer and longer!!  This change comments out the calls to autosize and that fixes the problem with no loss of behaviour.
2. Small amendment to aprevious change: the code that makes a mouse click always appear to be in column1 now depends on the selection mode beiing full row select.  We have a few screens that use full column select (reporting) and in this case it makes no sense to always click on column 1!!
3. In the light of the need for column selection above, I have enabled the use of the left/right arrow keys - but only when in column select mode.  In fact this change does nothoing because the OP code effectively disables the use of the arrow keys by forcing the selected position to always be -1,-1.  In this state the arrow keys do not do anything.  But one day it may be that we would like to change the OP code to allow the arrow keys.
The hourglass cursor while loading gifts has been moved from the transactions class to here.  It is not reliable to place it in the LoadGifts method of the transactions class - I am guessing because the gifts screen does not exactly mimic the GL screen and because the gift transaction class does not have a cursor at the critical moment, whereas the parent form obviously does.  So this fix solves the bug where we did not get an hourglass cursor while the gift transactions were being loaded.
A number of small fixes and changes to the code to make these screens work correctly after the integration of filter/find.  There were a number of issues surrounding deleting records and renumbering transactions.  Some lines of code needed re-ordering so as to work correctly.  In a few cases there were lines that were missing.  I have now tested the deletion so that I am sure that renumbering works and the storage of the last transaction number also works right.

The button for the DeleteAllGifts method is now disabled if the discretionary part of the filter has been set, since the method really does delete all the gifts, not just the ones that are being shown by the filter.  In the future we may decide that we will delete the complete filtered subset - but that would involve alll the renumbering routines to be applied.
I noticed that these templates generated a comment that explicitly referred to a PBusiness record rather than the comment having {#DETAILTABLETYPE} so that the correct record type was substituted.  This change only affects auto-generated comments.
merge from trunk
uncrustify
Merge from lp:~alan-paterson/openpetraorg/dev0001853_dec2013_release_fixes