1.  Modified the code to disable the 'Enable/Edit' button when it is not appropriate to click it.
2.  Discovered that there was a difference between Corporate and Daily screens for importing rates.  The Corporate screen correctly alerted you to errors in the import, but the message box was missing in the Daily screen.  In the end I improved both screens so that you now get told how many rows were successfully imported as well as being informed about any row that failed to import.  The message also contains the information that you can import the same file multiple times without adding duplicate rows.  It also informs you that more rows can be added than rows in the file because the code always adds an inverse rate if the file does not specify one.  (Note that the number of rows imported does not include existing rows for the currency pair at the date/time where only the rate itself gets updated.)  By handling the message boxes correctly the exception reported in the original Mantis case when moving from the current row no longer happens.
THis was quite an easy fix.  The PK for the position table has two parts - the position code (which we set in this screen) but also the position_scope which comes from the u_unit_type table.  We don't really use the unit type table, and all our positions use the 'O' code from this table (short for 'Other').  This bug was cause by setting the position_scope to 'Not Used' which is not a valid key to u_unit_type.  The fix was to set the position scope to 'O' like all the other entries.  The SA-DB alos uses 'O' so it obviously applies to Petra 2.x as well.
Fixed a bug with the code to automatically clear the filter controls which occurred when the panel control is a TCmbAutoComplete.  It was caused by the usual thing that these combo boxes only clear when you set the selected index to -1 TWICE!  However it does depend on whether the combo box has a blank first entry or not.  Many times it does and then setting the Text property to empty string is enough.  But the currency code combo box, for example, has a full list and no initial blank.  When we filter on Currency code we ran into this problem on Gift and Recurring gift.
Fixed a bug in recurring gift batch where, if filtering had resulted in no rows in the grid, the details tab was still enabled.  If you clicked it you got an exception.
Made a small change to ShowDetailsManual.  I now check to see if the effective time as a longTimeString ends with "00".  If not I show the time including seconds.  Otherwise it is ok as a short string of hh:mm only.  I needed to do this because the way that times work now is different from earlier versions of Petra.  So when we use an 'old' database we were inadvertently modifying data rows every time we cursored through the grid.
This fixes a bug that was discovered with the grid behaviour.  If you edited a detail in the details panel and then clicked in the grid on the current row, the details panel control reverted to the value it had before your edit (as opposed to the grid updating with your new edit).  The cause was down to the sequence of events.  Of course by clicking the grid oin the same row there was no rowChanged event in which the panel data got updated and verified.  This bug is an 'edige case' and the fix was relatively simple!
Two small changes.  1.  Added some protection to a couple of calls (cannot focus Find tab if it is not shown, and cannot set RowFilter if data source is null).  2.  Removed part of the condition that decides if a filter panel is dynamic.  Previously it was not dynamic if the 'Filter is always on', but that is nothing to do with not responding to changes in the filter controls.
Fixed a bug where it was possible to save invalid data by 1) making the data invalid in the details panel, then 2) making the invalid data disappear from the grid by suitable filter selection.  There already was code in place to already have a filter and THEN edit a row such that it was invalid and not part of the CURRENT filter - but this is the other way round.  In this case we start with invalid data and then set the filter so it is excluded.  There were a few ways that we could do this (filter button, menu etc) and I think I have trapped them all with this check-in.
Added filter'find functionality to these two templates because they are the ones used by Accounts Payable.  The check-in also includes the new change for case 2934 which was the previous check-in.
Added a property to the paged data grid - MinimumPageSize.  This defaults to 1 (row) but, when set to a number such as 200 specifies that the grid should load 200 rows (if available) rather than the number of visible rows (say typically 25).  beyond that the grid works exactly as before.  If the viewport needs to show a row that has not been retrieved it will get the next set of rows (200 more in this example).

This is how the Accounts Payable screen works now.  It specifies 200 rows and then when they have been retrieved it requests to get all the remaining rows, so the grid is fully populated at the outset although it displays the initial rows very quickly because 200 rows is not very many over a network connection.
Added TextBox, CheckBox and TtxtPetraDate to the controls that can be dynamically created on a user defined filter panel.  These are all required by AP because there are no controls cloned from a details panel because the screen doesn't have a details panel!
1. Added protection in a couple of places against getting Exceptions
2. Added delegates for radio button changes inside a group box.  (need to check this does not impact Gift and GL).
Added protection against exceptions for panels that are completely manually defined (such as AP)
The dialog is now be positioned over the owner screen where the owner is specified as part of the constructor.
No material change - just added a new empty method implementation that is now required by the template (the WindowFind template is shared with AP)
AP can now be launched in one of two ways from the main menu - either to show the Suppliers as the initial tab or to show Outstandiung Invoices as the initial tab.
This is the main check-in for the new work on AP.  The screen is now broken down into the main window and two user controls - one for each tab.  Filter/Find has been implemented for both user controls.  I have tried to NOT change the underlying functionality.  All the actions are carried out as server calls which are unchanged.  But the filter panels are always on and guide the user towards the actions that can be performed.  So by selecting 'show all for posting', for example, the option to tag items for posting and then post them is activated.

I have also done a lot of GUI improvements such as autosizing the grid and so the screens work more like Gift and GL.

The work is not finished yet, but this is a good point to commit to my working branch.
Uncrustify
Merge from trunk
These check-ins should get rid of Jenkins warnings about 'declared/assigned but never used'