Added classes to manage simple tabular data of known structure using a

popup containing a wxGrid object.

BasePicker : Abstract class adding a popup to wxPickerBase  styled with
a wxTextCtrl.
BaseGridPicker : Abstract class adding a wxGrid in the popup.

JsonGridPickerCtrl : UI control storing the tabular data in a JSON
array.
LBoundJsonGridPicker : connect JsonGridPicker to database.
LGridJsonCellEditor : use LBoundJsonGridPicker in other wxGrid objects.
LGridJsonCellRenderer : render cell JSON data.

XmlGridPickerCtrl : UI control storing the tabular data in as XML
document.
LBoundXmlGridPicker : connect XmlGridPicker to database.
LGridXmlCellEditor : grid editor for LBoundXmlGridPicker.
LGridXmlCellRenderer : grid renderer for LBoundXmlGridPicker.

JsonHelper and XmlHelper : for applications to quickly get intent value
from database data..

The structure of managed tabular data :

Column 1 : Intent - this is what we want to store/edit. This can be
telephone numbers, email addresses, instant messaging addresses...
any single line piece of information that can exist many times for one
entity (person, company...).
Column 2 : Type - A short description of the intent : 'Home, Work,
Mobile, Fax, Other...'. It is displayed in a non editable wxComboBox.
Column 3 : Preferred - One line of data can be selected as the preferred
one. It is not mandatory, but it must be a single choice.
Column 4 : Notes - single line notes.

Adjust sql scripts and L7.dox.
Applied ANSI formatting style to all files.

Other changes :

Work around a nasty misbehavior.
Grid columns edited by a translated combobox expect full string
data as cell values. LResultSet::BEData() will report these mapped strings,
instead of database real data. LBoundComboBox::IsDirty() will always be
true even if the editor is unchanged once created.
Simplest workaround : disconnect m_BoundComboBox if unchanged.

LGridTextEditor::ProvideFormEditor() : set the form editor's value
explicitely.; wxTextCtrl does not interpret data it receives

LBoundControl::SetNull must be void.

LBoundGrid : Unbind:: instructions should limit to the widget's id, like Bind::

LConnection::GetReturnedKeys should return NULL.
LConnection::SetData should return void.

Notes : wxJSON must be configured with the same prefix as wxWidgets,
here /usr/local/{wxWidgets,wxWidgets-Release}.
This commit is contained in:
SET
2019-12-22 16:35:16 +01:00
parent 1ec23950c0
commit aaacf88071
82 changed files with 3368 additions and 595 deletions

View File

@@ -4,6 +4,20 @@
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<logicalFolder name="f1" displayName="special" projectFiles="true">
<itemPath>special/BaseGridPicker.h</itemPath>
<itemPath>special/BasePicker.h</itemPath>
<itemPath>special/JsonGridPickerCtrl.h</itemPath>
<itemPath>special/JsonHelper.h</itemPath>
<itemPath>special/LBoundJsonGridPicker.h</itemPath>
<itemPath>special/LBoundXmlGridPicker.h</itemPath>
<itemPath>special/LGridJsonCellEditor.h</itemPath>
<itemPath>special/LGridJsonCellRenderer.h</itemPath>
<itemPath>special/LGridXmlCellEditor.h</itemPath>
<itemPath>special/LGridXmlCellRenderer.h</itemPath>
<itemPath>special/XmlGridPickerCtrl.h</itemPath>
<itemPath>special/XmlHelper.h</itemPath>
</logicalFolder>
<itemPath>LBoundCheckBox.h</itemPath>
<itemPath>LBoundComboBox.h</itemPath>
<itemPath>LBoundControl.h</itemPath>
@@ -44,6 +58,20 @@
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<logicalFolder name="f1" displayName="special" projectFiles="true">
<itemPath>special/BaseGridPicker.cpp</itemPath>
<itemPath>special/BasePicker.cpp</itemPath>
<itemPath>special/JsonGridPickerCtrl.cpp</itemPath>
<itemPath>special/JsonHelper.cpp</itemPath>
<itemPath>special/LBoundJsonGridPicker.cpp</itemPath>
<itemPath>special/LBoundXmlGridPicker.cpp</itemPath>
<itemPath>special/LGridJsonCellEditor.cpp</itemPath>
<itemPath>special/LGridJsonCellRenderer.cpp</itemPath>
<itemPath>special/LGridXmlCellEditor.cpp</itemPath>
<itemPath>special/LGridXmlCellRenderer.cpp</itemPath>
<itemPath>special/XmlGridPickerCtrl.cpp</itemPath>
<itemPath>special/XmlHelper.cpp</itemPath>
</logicalFolder>
<itemPath>LBoundCheckBox.cpp</itemPath>
<itemPath>LBoundComboBox.cpp</itemPath>
<itemPath>LBoundControl.cpp</itemPath>
@@ -101,6 +129,7 @@
<incDir>
<pElem>/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1</pElem>
<pElem>/usr/local/wxWidgets/include/wx-3.1</pElem>
<pElem>/usr/local/wxWidgets/include</pElem>
</incDir>
<preprocessorList>
<Elem>USE_LIBPQ</Elem>
@@ -118,6 +147,8 @@
<linkerLibItems>
<linkerLibLibItem>wx_baseu-3.1</linkerLibLibItem>
<linkerLibLibItem>wx_gtk2u_core-3.1</linkerLibLibItem>
<linkerLibLibItem>wx_baseu_xml-3.1</linkerLibLibItem>
<linkerLibLibItem>wxcode_gtk2ud_wxjson-3.1</linkerLibLibItem>
</linkerLibItems>
</linkerTool>
</compileType>
@@ -247,6 +278,54 @@
</item>
<item path="LVersion.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/BaseGridPicker.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/BaseGridPicker.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/BasePicker.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/BasePicker.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/JsonGridPickerCtrl.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/JsonGridPickerCtrl.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/JsonHelper.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/JsonHelper.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LBoundJsonGridPicker.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LBoundJsonGridPicker.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LBoundXmlGridPicker.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LBoundXmlGridPicker.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LGridJsonCellEditor.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LGridJsonCellEditor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LGridJsonCellRenderer.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LGridJsonCellRenderer.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LGridXmlCellEditor.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LGridXmlCellEditor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LGridXmlCellRenderer.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LGridXmlCellRenderer.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/XmlGridPickerCtrl.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/XmlGridPickerCtrl.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/XmlHelper.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/XmlHelper.h" ex="false" tool="3" flavor2="0">
</item>
</conf>
<conf name="Release" type="2">
<toolsSet>
@@ -264,6 +343,7 @@
<incDir>
<pElem>/usr/local/wxWidgets-Release/include/wx-3.1</pElem>
<pElem>/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1</pElem>
<pElem>/usr/local/wxWidgets-Release/include</pElem>
</incDir>
<preprocessorList>
<Elem>USE_LIBPQ</Elem>
@@ -288,6 +368,8 @@
<linkerLibItems>
<linkerLibLibItem>wx_baseu-3.1</linkerLibLibItem>
<linkerLibLibItem>wx_gtk2u_core-3.1</linkerLibLibItem>
<linkerLibLibItem>wx_baseu_xml-3.1</linkerLibLibItem>
<linkerLibLibItem>wxcode_gtk2u_wxjson-3.1</linkerLibLibItem>
</linkerLibItems>
</linkerTool>
</compileType>
@@ -417,6 +499,54 @@
</item>
<item path="LVersion.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/BaseGridPicker.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/BaseGridPicker.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/BasePicker.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/BasePicker.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/JsonGridPickerCtrl.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/JsonGridPickerCtrl.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/JsonHelper.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/JsonHelper.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LBoundJsonGridPicker.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LBoundJsonGridPicker.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LBoundXmlGridPicker.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LBoundXmlGridPicker.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LGridJsonCellEditor.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LGridJsonCellEditor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LGridJsonCellRenderer.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LGridJsonCellRenderer.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LGridXmlCellEditor.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LGridXmlCellEditor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/LGridXmlCellRenderer.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/LGridXmlCellRenderer.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/XmlGridPickerCtrl.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/XmlGridPickerCtrl.h" ex="false" tool="3" flavor2="0">
</item>
<item path="special/XmlHelper.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="special/XmlHelper.h" ex="false" tool="3" flavor2="0">
</item>
</conf>
</confs>
</configurationDescriptor>