Hi fellow developers,
During the development of the Partner Contact Details feature I developed several features and made some changes to existing features.
Here is a list of the most important ones so you know that these things are available for your use, too! If you have questions on any do come back to me.
I will update documentation in the OpenPetra Wiki where relevant once the next development deadline has passed. None of these changes/additions should be breaking existing code nor do they necessitate changes in existing code.
YAML Forms:
** New 'DependentChildUserControl' Element. If the YAML file has got the 'DependentChildUserControl' Element and its value is 'true' then generate the usual calls that integrate UserControls into their hosting Forms. This will work also if the hosting Forms' YAML file has 'MasterTable' or 'DetailTable' Elements. At present utilised only in the ContactCategoriesAndTypesSetup and ContactAttributeSetup Forms.
** Introduced common 'Condition' for 'Edit' Forms that allows the Enabling/Disabling of all Filter/Find-related Menu Items and the 'Filter' Button with one Method call.
*** WinForms Generator:
**** All Forms that derive from PetraEditForm.yaml have got the Actions 'actEditFindNext', 'actEditFindPrevious', 'actEditFilter' and 'actEditFind' specified. Those Actions' 'Enabled' Elements' Attribute is now set to a new Condition, 'cndFindFilterAvailable', which is also defined in PetraEditForm.yaml.
*** YAML Form Templates
**** Templates that support Filter/Find functionality: the new Condition 'cndFindFilterAvailable' enables/disables the 'chkToggleFilter' (Filter) Button.
*** Usage
**** Enabling of the above mentioned Menu Items and the 'Filter' button: ActionEnabledEvent(null, new ActionEventArgs("cndFindFilterAvailable", true));
**** Disabling of the above mentioned Menu Items and the 'Filter' button: ActionEnabledEvent(null, new ActionEventArgs("cndFindFilterAvailable", false));
** New WinForms Event related to saving of data:
*** Introduced 'NoMasterDataToSave' Event in PetraEditForm.cs.
*** This Event allows the saving of data of a 'Child' UserControl before saving 'Master' data held in the 'Form' in case all 'Child' records get deleted. This is to allow the deletion of the 'Master' record, which would otherwise not be possible as it would still have references to the 'Child' records in the DB!
*** At present (Oct. 2014) only raised by the windowMaintainCacheableTable.cs Template, but could be added to other Templates, too, if needed. At present utilised only in the ContactCategoriesAndTypesSetup and ContactAttributeSetup Forms.
** New public Methods 'ShowDefaultCursor' and 'ShowWaitCursor' in PetraEditForm.cs that can be called to set the respective Cursor on the Form. This will work also when called from a UserControl, i.e. calling those Methods from a UserControl will set the respective Cursor on the Form, not the UserControl!
** Dynamic TabPage code generation: introduce new Partial Method 'PostInitUserControl'.
*** This Method CAN be implemented in ManualCode to perform special initialisations after InitUserControl() gets called.
Control improvements, new Controls
** cmbAutoPopulatedComboBox
*** New 'Text' Property.
*** New Method 'GetSelectedItemsDataRow'.
** Grid
*** Introduced Inner Class 'IndexedGridRowsHelper', which is a 'Helper Class' for Grids that are sorted based on an 'Index' Column.
**** At present (Oct. 2014) used only by ContactCategoriesAndTypesSetup, ContactAttributeSetup, and LocalDataFieldOrderSetup Forms.
** new UserControl 'txtLinkTextBox.cs' - A specialised TextBox that allows editing and 'launching' of various kinds of Hyperlinks. Restriction: only one link can be present.
** new UserControl: 'rtbHyperlinks.cs' = 'txtLinkTextBox.cs on steroids'. A specialised RichTextBox that supports arbitrary 'Hyperlinks', and any number of Links can be present. It supports multi-line text and a mix of plain text and 'hyperlinks', and 'launching' of those links. Still in development!
Other functionality
** DeleteGridRows.cs
*** Added new static Method 'MasterDetailFormsSpecialPreDeleteCheck'. Called only by Setup screens (Maintain Table screens) that feature Master/Detail record maintenance. Such screens call this Method from within their 'PreDeleteManual' Method to determine whether the last 'Detail' record can be deleted, or if the user needs to press 'Save' before that is allowed.
** ExceptionHandling.cs:
*** Show Exception.Message if a NotImplementedException has got a Message and not the generic 'This functionality is not yet implemented in OpenPetra.' Message.
** StringHelper.cs:
*** Added new Method 'SplitEmailAddresses' for centralisation of how we do that.
*** Added new Methods 'StrArrayToString' and 'StrCollToString'. I introduced those to conveniently log string[] and StringCollection to the log file, but there might be other uses.
** Cacheable DataTables:
*** TDataCache Class and its internal Classes:
**** Added overloads to various Methods that make it possible for the caller of those Methods to specify a different TableName for the DataTable that is returned from the Cache.
***** The new Methods' names are identical to the existing Methods except that the number '2' is appended to the Method name (e.g. GetCacheableCommonTable2 instead of GetCacheableCommonTable).
*** Calculated Cacheable DataTables can be written to the DB, which was previously not possible. This is done by specifying the Element 'IsStorableToDBTable' in CacheableTablesAndLists.yaml for calculated Cacheable DataTables. The value of that Element needs to be the name of the DB Table as used in OpenPetra C# code (eg. PPartnerAttributeCategory).
- Main Menu: 'TestAction' improvements
** A Form that gets launched right when the OpenPetra Main Menu is opened by specifying 'TestAction' in the Client config file is no longer shown 'behind' the OpenPetra Main Menu and now has the input focus!
** Introduced new keyboard shortcut for developers: 'CTRL+SHIFT+T'. On pressing this, the 'TestAction' is executed (again and again). That particular key combination is convenient for the re-opening of a screen that the developer needs to close and re-open while testing/debugging!
- Application Server Menu:
** New menu item that marks all Cacheable DataTables as 'needing to be refreshed' ('r' key in the Server/ServerAdmin Menu).
Kind regards,
ChristianK