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:
5
L7/.dep.inc
Normal file
5
L7/.dep.inc
Normal file
@@ -0,0 +1,5 @@
|
||||
# This code depends on make tool being used
|
||||
DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES}))
|
||||
ifneq (${DEPFILES},)
|
||||
include ${DEPFILES}
|
||||
endif
|
||||
@@ -831,7 +831,7 @@ FILE_PATTERNS = *.c \
|
||||
# be searched for input files as well.
|
||||
# The default value is: NO.
|
||||
|
||||
RECURSIVE = NO
|
||||
RECURSIVE = YES
|
||||
|
||||
# The EXCLUDE tag can be used to specify files and/or directories that should be
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
|
||||
@@ -10,16 +10,15 @@
|
||||
#include "LBoundCheckBox.h"
|
||||
|
||||
LBoundCheckBox::LBoundCheckBox(wxWindow* parent, wxWindowID id, long style)
|
||||
: wxCheckBox(parent, id, _T("LCheckBox"), wxDefaultPosition, wxDefaultSize, style)
|
||||
{
|
||||
: wxCheckBox(parent, id, _T("LCheckBox"), wxDefaultPosition, wxDefaultSize, style) {
|
||||
m_sqlQuote = wxEmptyString;
|
||||
SetNull();
|
||||
}
|
||||
|
||||
LBoundCheckBox::~LBoundCheckBox()
|
||||
{
|
||||
LBoundCheckBox::~LBoundCheckBox() {
|
||||
if (m_rs) m_rs->UnRegisterControl(this);
|
||||
}
|
||||
|
||||
const wxAny LBoundCheckBox::GetData() {
|
||||
if (Is3State()) {
|
||||
if (Get3StateValue() == wxCHK_UNDETERMINED) return L_SQLNULL;
|
||||
@@ -30,7 +29,8 @@ const wxAny LBoundCheckBox::GetData() {
|
||||
if (GetValue() == wxCHK_CHECKED) return 1;
|
||||
}
|
||||
}
|
||||
bool LBoundCheckBox::SetData(const wxAny& newData) {
|
||||
|
||||
void LBoundCheckBox::SetData(const wxAny& newData) {
|
||||
/* The interpretation of literal non is not documented
|
||||
* as it's for internal use.
|
||||
*/
|
||||
@@ -40,7 +40,7 @@ bool LBoundCheckBox::SetData(const wxAny& newData) {
|
||||
if (snewData.IsEmpty()
|
||||
|| snewData == L_SQLNULL) {
|
||||
Set3StateValue(wxCHK_UNDETERMINED);
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
if (snewData == _T("0")
|
||||
|| snewData.Lower() == _T("no")) {
|
||||
@@ -48,7 +48,7 @@ bool LBoundCheckBox::SetData(const wxAny& newData) {
|
||||
} else {
|
||||
Set3StateValue(wxCHK_CHECKED);
|
||||
}
|
||||
return true;
|
||||
return;
|
||||
} else {
|
||||
if (snewData == _T("0")
|
||||
|| snewData.IsEmpty()
|
||||
@@ -58,14 +58,14 @@ bool LBoundCheckBox::SetData(const wxAny& newData) {
|
||||
SetValue(wxCHK_CHECKED);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void LBoundCheckBox::SetResultSet(LResultSet* newResultSet)
|
||||
{
|
||||
|
||||
void LBoundCheckBox::SetResultSet(LResultSet* newResultSet) {
|
||||
m_rs = newResultSet;
|
||||
if (m_rs == NULL) return;
|
||||
m_rs->RegisterControl(this);
|
||||
}
|
||||
|
||||
bool LBoundCheckBox::IsNull() {
|
||||
if (Is3State()) {
|
||||
return (Get3StateValue() == wxCHK_UNDETERMINED);
|
||||
@@ -73,14 +73,17 @@ bool LBoundCheckBox::IsNull() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool LBoundCheckBox::SetNull() {
|
||||
return SetData(wxEmptyString);
|
||||
|
||||
void LBoundCheckBox::SetNull() {
|
||||
SetData(wxEmptyString);
|
||||
}
|
||||
|
||||
bool LBoundCheckBox::IsDirty() {
|
||||
wxASSERT_MSG(m_rs != NULL, "m_rs est NULL.");
|
||||
wxAny ctrlData = GetData(); // 0, 1 or L_SQLNULL
|
||||
wxAny BEData = m_rs->GetData(m_columnName);
|
||||
int iBEData; BEData.GetAs(&iBEData);
|
||||
int iBEData;
|
||||
BEData.GetAs(&iBEData);
|
||||
if (Is3State()) {
|
||||
if (BEData.IsNull()
|
||||
|| BEData.As<wxString>().IsEmpty()) {
|
||||
@@ -99,6 +102,7 @@ bool LBoundCheckBox::IsDirty() {
|
||||
}
|
||||
return (ctrlData.As<wxString>() != BEData.As<wxString>());
|
||||
}
|
||||
|
||||
const wxString LBoundCheckBox::GetDisplayedData() {
|
||||
if (Is3State()) {
|
||||
if (Get3StateValue() == wxCHK_UNDETERMINED) return L_SQLNULL;
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
#include "LBoundControl.h"
|
||||
#include "LResultSet.h"
|
||||
|
||||
class LBoundCheckBox : public wxCheckBox, public LBoundControl
|
||||
{
|
||||
class LBoundCheckBox : public wxCheckBox, public LBoundControl {
|
||||
public:
|
||||
LBoundCheckBox(wxWindow* parent, wxWindowID id = wxID_ANY, long style = 0);
|
||||
virtual ~LBoundCheckBox();
|
||||
@@ -32,9 +31,8 @@ public:
|
||||
* and any other value to checked status.
|
||||
*
|
||||
* @param newData
|
||||
* @return
|
||||
*/
|
||||
bool SetData(const wxAny& newData);
|
||||
void SetData(const wxAny& newData);
|
||||
/**
|
||||
* Sets the resultset member and registers the control in the resultset.
|
||||
* @param newResultSet
|
||||
@@ -49,7 +47,7 @@ public:
|
||||
* If control is tristate, it is set to undetermined state. Else, it is set to unchecked state.
|
||||
* @return
|
||||
*/
|
||||
bool SetNull();
|
||||
void SetNull();
|
||||
bool IsDirty();
|
||||
/**
|
||||
* If the control is checked, returns literal Oui
|
||||
|
||||
@@ -163,7 +163,7 @@ void LBoundComboBox::Clear()
|
||||
SetWindowStyleFlag(wsflags);
|
||||
}
|
||||
|
||||
bool LBoundComboBox::SetData(const wxAny& data)
|
||||
void LBoundComboBox::SetData(const wxAny& data)
|
||||
{
|
||||
const wxString sData = data.As<wxString>();
|
||||
if (IsTranslated())
|
||||
@@ -173,7 +173,7 @@ bool LBoundComboBox::SetData(const wxAny& data)
|
||||
|| sData == L_SQLNULL)
|
||||
{
|
||||
SetNull();
|
||||
return (GetSelection() != wxNOT_FOUND); // ?
|
||||
return;
|
||||
}
|
||||
for (unsigned int i = 0; i < GetCount(); i++)
|
||||
{
|
||||
@@ -183,18 +183,16 @@ bool LBoundComboBox::SetData(const wxAny& data)
|
||||
if (x->GetData().As<wxString>() == sData)
|
||||
{
|
||||
SetSelection(i);
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bool hasData = FindString(sData, true);
|
||||
//bool hasData = FindString(sData, true);
|
||||
SetValue(sData);
|
||||
return hasData;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const wxAny LBoundComboBox::GetData()
|
||||
@@ -245,7 +243,7 @@ bool LBoundComboBox::IsNull()
|
||||
}
|
||||
}
|
||||
|
||||
bool LBoundComboBox::SetNull()
|
||||
void LBoundComboBox::SetNull()
|
||||
{
|
||||
if (IsTranslated())
|
||||
{
|
||||
@@ -255,17 +253,16 @@ bool LBoundComboBox::SetNull()
|
||||
if (x == NULL)
|
||||
{
|
||||
SetSelection(i);
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
long wsflags = GetWindowStyleFlag();
|
||||
SetWindowStyleFlag(0);
|
||||
SetSelection(wxNOT_FOUND);
|
||||
SetValue(wxEmptyString);
|
||||
SetWindowStyleFlag(wsflags);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LBoundComboBox::IsDirty()
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <wx/combobox.h>
|
||||
#include "LBoundControl.h"
|
||||
#include "LResultSet.h"
|
||||
|
||||
/**
|
||||
* The control is called 'translated' if its items have associated client data that are instances of LItemData.
|
||||
* The item strings are then only descriptive.
|
||||
@@ -93,9 +94,8 @@ public:
|
||||
* If newData is empty or literal NULL, calls SetNull().
|
||||
* Else, selects the first item whose associated client data equals newData.
|
||||
* @param newData
|
||||
* @return false if no item can be matched with newData, true otherwise.
|
||||
*/
|
||||
bool SetData(const wxAny& newData);
|
||||
void SetData(const wxAny& newData);
|
||||
/**
|
||||
* Sets the resultset member and registers the control in the resultset.
|
||||
* @param newResultSet
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
* Else, selects the first item that does not have an associated client data.
|
||||
* @return
|
||||
*/
|
||||
bool SetNull();
|
||||
void SetNull();
|
||||
bool IsDirty();
|
||||
/**
|
||||
* Alias for GetValue().
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define L_SQLNULL wxString(_T("NULL"))
|
||||
|
||||
class LResultSet;
|
||||
|
||||
/**
|
||||
* Abstract base class for controls interacting with database table columns.
|
||||
*
|
||||
@@ -26,6 +27,7 @@ class LBoundControl
|
||||
public:
|
||||
LBoundControl();
|
||||
virtual ~LBoundControl();
|
||||
|
||||
/**
|
||||
* Do not use column aliases.
|
||||
* @param newColName
|
||||
@@ -45,14 +47,16 @@ public:
|
||||
* @return
|
||||
*/
|
||||
virtual const wxAny GetData() = 0;
|
||||
virtual bool SetData(const wxAny& newData) = 0;
|
||||
virtual void SetData(const wxAny& newData) = 0;
|
||||
virtual void SetResultSet(LResultSet * newResultSet) = 0;
|
||||
|
||||
LResultSet* GetResultSet() const
|
||||
{
|
||||
return m_rs;
|
||||
}
|
||||
virtual bool IsNull() = 0;
|
||||
virtual bool SetNull() = 0;
|
||||
virtual void SetNull() = 0;
|
||||
|
||||
/**
|
||||
* If the database column is numeric, use wxEmptystring, else, use a single quote ' .
|
||||
*
|
||||
|
||||
@@ -22,52 +22,63 @@ LBoundDatePickerCtrl::~LBoundDatePickerCtrl()
|
||||
if (m_rs) m_rs->UnRegisterControl(this);
|
||||
}
|
||||
|
||||
const wxAny LBoundDatePickerCtrl::GetData() {
|
||||
const wxAny LBoundDatePickerCtrl::GetData()
|
||||
{
|
||||
if (IsNull()) return L_SQLNULL;
|
||||
return GetValue().GetDateOnly().FormatISODate();
|
||||
}
|
||||
|
||||
bool LBoundDatePickerCtrl::SetData(const wxAny& newData) {
|
||||
if (newData.IsNull()) {
|
||||
void LBoundDatePickerCtrl::SetData(const wxAny& newData)
|
||||
{
|
||||
if (newData.IsNull())
|
||||
{
|
||||
SetValue(wxInvalidDateTime);
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
if (newData.As<wxString>() == L_SQLNULL || newData.As<wxString>().IsEmpty()) {
|
||||
if (newData.As<wxString>() == L_SQLNULL || newData.As<wxString>().IsEmpty())
|
||||
{
|
||||
SetValue(wxInvalidDateTime);
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
wxString s; newData.GetAs(&s);
|
||||
wxString s;
|
||||
newData.GetAs(&s);
|
||||
const wxDateTime dt = BuildDate(s);
|
||||
if (!dt.IsValid()) {
|
||||
SetValue(wxInvalidDateTime);
|
||||
return false;
|
||||
}
|
||||
SetValue(dt);
|
||||
return true;
|
||||
}
|
||||
|
||||
void LBoundDatePickerCtrl::SetResultSet(LResultSet* newResultSet)
|
||||
{
|
||||
m_rs = newResultSet;
|
||||
if (m_rs == NULL) return;
|
||||
m_rs->RegisterControl(this);
|
||||
}
|
||||
bool LBoundDatePickerCtrl::IsNull() {
|
||||
|
||||
bool LBoundDatePickerCtrl::IsNull()
|
||||
{
|
||||
return !(GetValue().IsValid());
|
||||
}
|
||||
bool LBoundDatePickerCtrl::SetNull() {
|
||||
return SetData(L_SQLNULL);
|
||||
|
||||
void LBoundDatePickerCtrl::SetNull()
|
||||
{
|
||||
SetData(L_SQLNULL);
|
||||
}
|
||||
bool LBoundDatePickerCtrl::IsDirty() {
|
||||
|
||||
bool LBoundDatePickerCtrl::IsDirty()
|
||||
{
|
||||
wxASSERT_MSG(m_rs != NULL, "m_rs est NULL.");
|
||||
wxAny BEData = m_rs->GetData(m_columnName);
|
||||
if (BEData.As<wxString>().IsEmpty()) BEData = L_SQLNULL;
|
||||
return (GetData().As<wxString>() != BEData.As<wxString>());
|
||||
}
|
||||
const wxString LBoundDatePickerCtrl::GetDisplayedData() {
|
||||
|
||||
const wxString LBoundDatePickerCtrl::GetDisplayedData()
|
||||
{
|
||||
if (IsNull()) return wxEmptyString;
|
||||
return GetValue().GetDateOnly().FormatDate();
|
||||
}
|
||||
wxDateTime LBoundDatePickerCtrl::BuildDate(const wxString& ISODate) {
|
||||
|
||||
wxDateTime LBoundDatePickerCtrl::BuildDate(const wxString& ISODate)
|
||||
{
|
||||
wxDateTime dt = wxDateTime::Today();
|
||||
if (!dt.ParseISODate(ISODate)) return wxInvalidDateTime;
|
||||
unsigned int * res = new unsigned int[3];
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <wx/datectrl.h>
|
||||
#include "LBoundControl.h"
|
||||
#include "LResultSet.h"
|
||||
|
||||
/**
|
||||
* Initialised with wxInvalidDateTime. The underlying toolkit must allow wxDP_ALLOWNONE.
|
||||
*
|
||||
@@ -32,10 +33,8 @@ public:
|
||||
/**
|
||||
*
|
||||
* @param newData
|
||||
* @return false if newData is not a valid ISO date string.
|
||||
* True if newData is empty, or literal NULL, or a valid ISO date string.
|
||||
*/
|
||||
bool SetData(const wxAny& newData);
|
||||
void SetData(const wxAny& newData);
|
||||
/**
|
||||
* Sets the resultset member and registers the control in the resultset.
|
||||
* @param newResultSet
|
||||
@@ -50,7 +49,7 @@ public:
|
||||
* Sets the control to invalid date.
|
||||
* @return
|
||||
*/
|
||||
bool SetNull();
|
||||
void SetNull();
|
||||
bool IsDirty();
|
||||
/**
|
||||
* If IsNull() is true, returns wxEmptyString.
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
#include "LGridTextRenderer.h"
|
||||
#include "LGridSpinEditor.h"
|
||||
#include "LGridSpinRenderer.h"
|
||||
#include "special/LGridJsonCellRenderer.h"
|
||||
#include "special/LGridJsonCellEditor.h"
|
||||
#include "special/LGridXmlCellRenderer.h"
|
||||
#include "special/LGridXmlCellEditor.h"
|
||||
|
||||
LBoundGrid::LBoundGrid(wxWindow* parent, wxWindowID id)
|
||||
: wxGrid(parent, id, wxDefaultPosition, wxDefaultSize, wxHSCROLL | wxVSCROLL)
|
||||
@@ -34,9 +38,10 @@ LBoundGrid::LBoundGrid(wxWindow* parent, wxWindowID id)
|
||||
SetTable(m_stringTable);
|
||||
SetSelectionMode(wxGridSelectRows);
|
||||
CreateMenu();
|
||||
Bind(wxEVT_GRID_RANGE_SELECT, &LBoundGrid::ForceSingleLineRange, this);
|
||||
Bind(wxEVT_GRID_SELECT_CELL, &LBoundGrid::CellSelected, this);
|
||||
Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &LBoundGrid::ShowMenu, this);
|
||||
// These bindings must not propagate to the grid of BaseGridPicker !!!
|
||||
Bind(wxEVT_GRID_RANGE_SELECT, &LBoundGrid::ForceSingleLineRange, this, GetId(), GetId());
|
||||
Bind(wxEVT_GRID_SELECT_CELL, &LBoundGrid::CellSelected, this, GetId(), GetId());
|
||||
Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &LBoundGrid::ShowMenu, this, GetId(), GetId());
|
||||
}
|
||||
|
||||
LBoundGrid::~LBoundGrid()
|
||||
@@ -66,8 +71,8 @@ void LBoundGrid::SetResultSet(LResultSet* newResultSet)
|
||||
|
||||
void LBoundGrid::ClearGrid()
|
||||
{
|
||||
Unbind(wxEVT_GRID_RANGE_SELECT, &LBoundGrid::ForceSingleLineRange, this);
|
||||
Unbind(wxEVT_GRID_SELECT_CELL, &LBoundGrid::CellSelected, this);
|
||||
Unbind(wxEVT_GRID_RANGE_SELECT, &LBoundGrid::ForceSingleLineRange, this, GetId(), GetId());
|
||||
Unbind(wxEVT_GRID_SELECT_CELL, &LBoundGrid::CellSelected, this, GetId(), GetId());
|
||||
if (GetNumberRows()) DeleteRows(0, GetNumberRows());
|
||||
if (GetNumberCols()) DeleteCols(0, GetNumberCols());
|
||||
}
|
||||
@@ -79,8 +84,8 @@ void LBoundGrid::FillGrid()
|
||||
wxGridUpdateLocker locker(this);
|
||||
// Starting again, the grid's resultset must free itself from any registered controls.
|
||||
RestoreEditorControls();
|
||||
Unbind(wxEVT_GRID_RANGE_SELECT, &LBoundGrid::ForceSingleLineRange, this);
|
||||
Unbind(wxEVT_GRID_SELECT_CELL, &LBoundGrid::CellSelected, this);
|
||||
Unbind(wxEVT_GRID_RANGE_SELECT, &LBoundGrid::ForceSingleLineRange, this, GetId(), GetId());
|
||||
Unbind(wxEVT_GRID_SELECT_CELL, &LBoundGrid::CellSelected, this, GetId(), GetId());
|
||||
// Remember some states
|
||||
const wxGridSizesInfo colSizes = GetColSizes();
|
||||
const int col = GetGridCursorCol() > -1 ? GetGridCursorCol() : 0;
|
||||
@@ -112,8 +117,8 @@ void LBoundGrid::FillGrid()
|
||||
m_stringTable->SetValue(r, c, (m_rs->GetData(r, c)).As<wxString>());
|
||||
}
|
||||
}
|
||||
Bind(wxEVT_GRID_SELECT_CELL, &LBoundGrid::CellSelected, this);
|
||||
Bind(wxEVT_GRID_RANGE_SELECT, &LBoundGrid::ForceSingleLineRange, this);
|
||||
Bind(wxEVT_GRID_SELECT_CELL, &LBoundGrid::CellSelected, this, GetId(), GetId());
|
||||
Bind(wxEVT_GRID_RANGE_SELECT, &LBoundGrid::ForceSingleLineRange, this, GetId(), GetId());
|
||||
// Restore
|
||||
SetColSizes(colSizes);
|
||||
// synchronize with the resultset
|
||||
@@ -234,6 +239,54 @@ void LBoundGrid::CreateSpinColumn(const wxString& newColName,
|
||||
SetColSize(col, width);
|
||||
}
|
||||
|
||||
void LBoundGrid::CreateJsonGridColumn(const wxString& newColName,
|
||||
const wxString& newLabel,
|
||||
unsigned int width,
|
||||
const wxString& intentLabel,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize,
|
||||
bool readOnly)
|
||||
{
|
||||
wxASSERT_MSG(m_rs != NULL, _("RS = NULL"));
|
||||
const int col = m_rs->GetColumnIndex(newColName);
|
||||
wxASSERT_MSG(col > -1, _("Invalid column name : ") + newColName);
|
||||
wxGridCellAttr * colAtt = m_stringTable->GetAttr(GetGridCursorRow(), col, wxGridCellAttr::Col);
|
||||
if (colAtt == NULL) colAtt = new wxGridCellAttr();
|
||||
LGridJsonCellEditor * ed = new LGridJsonCellEditor(newColName, intentLabel, types, popupSize);
|
||||
colAtt->SetEditor(ed);
|
||||
LGridJsonCellRenderer * rn = new LGridJsonCellRenderer();
|
||||
colAtt->SetRenderer(rn);
|
||||
colAtt->SetReadOnly(readOnly);
|
||||
colAtt->SetAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE);
|
||||
m_stringTable->SetColAttr(colAtt, col);
|
||||
m_stringTable->SetColLabelValue(col, newLabel);
|
||||
SetColSize(col, width);
|
||||
}
|
||||
|
||||
void LBoundGrid::CreateXmlGridColumn(const wxString& newColName,
|
||||
const wxString& newLabel,
|
||||
unsigned int width,
|
||||
const wxString& intentLabel,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize,
|
||||
bool readOnly)
|
||||
{
|
||||
wxASSERT_MSG(m_rs != NULL, _("RS = NULL"));
|
||||
const int col = m_rs->GetColumnIndex(newColName);
|
||||
wxASSERT_MSG(col > -1, _("Invalid column name : ") + newColName);
|
||||
wxGridCellAttr * colAtt = m_stringTable->GetAttr(GetGridCursorRow(), col, wxGridCellAttr::Col);
|
||||
if (colAtt == NULL) colAtt = new wxGridCellAttr();
|
||||
LGridXmlCellEditor * ed = new LGridXmlCellEditor(newColName, intentLabel, types, popupSize);
|
||||
colAtt->SetEditor(ed);
|
||||
LGridXmlCellRenderer * rn = new LGridXmlCellRenderer();
|
||||
colAtt->SetRenderer(rn);
|
||||
colAtt->SetReadOnly(readOnly);
|
||||
colAtt->SetAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE);
|
||||
m_stringTable->SetColAttr(colAtt, col);
|
||||
m_stringTable->SetColLabelValue(col, newLabel);
|
||||
SetColSize(col, width);
|
||||
}
|
||||
|
||||
const wxString LBoundGrid::GetColName(const unsigned int col)
|
||||
{
|
||||
wxASSERT_MSG(m_rs != NULL, _("RS = NULL"));
|
||||
@@ -527,7 +580,8 @@ void LBoundGrid::ShowMenu(wxGridEvent& evt)
|
||||
|
||||
void LBoundGrid::MenuAction(wxCommandEvent& evt)
|
||||
{
|
||||
switch (evt.GetId()) {
|
||||
switch (evt.GetId())
|
||||
{
|
||||
case ID_MNU_SAVE:
|
||||
if (m_rs)
|
||||
{
|
||||
@@ -650,7 +704,8 @@ void LBoundGrid::ShowFormView()
|
||||
wxControl * fEditor = NULL;
|
||||
// One more pointer to a text control
|
||||
wxTextCtrl * txtCtrl = NULL;
|
||||
switch (type) {
|
||||
switch (type)
|
||||
{
|
||||
case LGridColEditor::TEXT:
|
||||
fEditor = static_cast<wxTextCtrl*> (gce->ProvideFormEditor(pan0));
|
||||
txtCtrl = static_cast<wxTextCtrl*> (fEditor);
|
||||
@@ -667,6 +722,12 @@ void LBoundGrid::ShowFormView()
|
||||
case LGridColEditor::SPIN:
|
||||
fEditor = static_cast<wxSpinCtrl*> (gce->ProvideFormEditor(pan0));
|
||||
break;
|
||||
case LGridColEditor::JSON_GRID:
|
||||
fEditor = static_cast<JsonGridPickerCtrl*> (gce->ProvideFormEditor(pan0));
|
||||
break;
|
||||
case LGridColEditor::XML_GRID:
|
||||
fEditor = static_cast<XmlGridPickerCtrl*> (gce->ProvideFormEditor(pan0));
|
||||
break;
|
||||
}
|
||||
// A label corresponding to the grid column header
|
||||
wxStaticText * lbl = new wxStaticText(pan0, wxID_ANY, m_stringTable->GetColLabelValue(col), wxDefaultPosition, wxDefaultSize, 0);
|
||||
|
||||
@@ -119,6 +119,20 @@ public:
|
||||
int newMax = 100,
|
||||
int newInitial = 0,
|
||||
bool readOnly = false);
|
||||
void CreateJsonGridColumn(const wxString& newColName,
|
||||
const wxString& newLabel,
|
||||
unsigned int width,
|
||||
const wxString& intentLabel,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize,
|
||||
bool readOnly = false);
|
||||
void CreateXmlGridColumn(const wxString& newColName,
|
||||
const wxString& newLabel,
|
||||
unsigned int width,
|
||||
const wxString& intentLabel,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize,
|
||||
bool readOnly = false);
|
||||
/**
|
||||
*
|
||||
* @param col the grid column index
|
||||
|
||||
@@ -34,7 +34,7 @@ void LBoundSpinCtrl::SetResultSet(LResultSet* newResultSet)
|
||||
m_rs->RegisterControl(this);
|
||||
}
|
||||
|
||||
bool LBoundSpinCtrl::SetData(const wxAny& newData)
|
||||
void LBoundSpinCtrl::SetData(const wxAny& newData)
|
||||
{
|
||||
if (newData.IsNull() || newData.As<wxString>().IsEmpty())
|
||||
{
|
||||
@@ -46,7 +46,6 @@ bool LBoundSpinCtrl::SetData(const wxAny& newData)
|
||||
newData.GetAs<int>(&iData);
|
||||
SetValue(iData);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LBoundSpinCtrl::IsDirty()
|
||||
|
||||
@@ -48,9 +48,8 @@ public:
|
||||
/**
|
||||
* If newData is null or empty, sets the control to its initial value.
|
||||
* @param newData
|
||||
* @return
|
||||
*/
|
||||
bool SetData(const wxAny& newData);
|
||||
void SetData(const wxAny& newData);
|
||||
|
||||
/**
|
||||
* This control is never empty.
|
||||
@@ -65,7 +64,7 @@ public:
|
||||
* Sets the control to its initial value.
|
||||
* @return
|
||||
*/
|
||||
bool SetNull()
|
||||
void SetNull()
|
||||
{
|
||||
SetData(m_initialValue);
|
||||
}
|
||||
|
||||
@@ -33,10 +33,9 @@ const wxAny LBoundTextCtrl::GetData()
|
||||
return GetValue();
|
||||
}
|
||||
|
||||
bool LBoundTextCtrl::SetData(const wxAny& newData)
|
||||
void LBoundTextCtrl::SetData(const wxAny& newData)
|
||||
{
|
||||
ChangeValue(newData.As<wxString>());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LBoundTextCtrl::IsDirty()
|
||||
|
||||
@@ -32,9 +32,9 @@ public:
|
||||
/**
|
||||
* Calls ChangeValue().
|
||||
* @param newData
|
||||
* @return
|
||||
*/
|
||||
bool SetData(const wxAny& newData);
|
||||
void SetData(const wxAny& newData);
|
||||
|
||||
/**
|
||||
* Alias for IsEmpty().
|
||||
* @return
|
||||
@@ -43,15 +43,17 @@ public:
|
||||
{
|
||||
return IsEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for Clear().
|
||||
* @return
|
||||
*/
|
||||
bool SetNull()
|
||||
void SetNull()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
bool IsDirty();
|
||||
|
||||
/**
|
||||
* Alias for GetValue().
|
||||
* @return
|
||||
|
||||
@@ -53,12 +53,15 @@ LConnectionEvent::LConnectionEvent()
|
||||
LConnectionEvent::~LConnectionEvent()
|
||||
{
|
||||
}
|
||||
|
||||
void LConnectionEvent::BeforeExecute(const LConnection* caller)
|
||||
{
|
||||
}
|
||||
|
||||
void LConnectionEvent::AfterExecute(const LConnection* caller)
|
||||
{
|
||||
}
|
||||
|
||||
void LConnectionEvent::Inform(const LConnection* caller, const LInformation& msg) const
|
||||
{
|
||||
}
|
||||
@@ -116,6 +116,7 @@ public:
|
||||
*/
|
||||
virtual void * GetReturnedKeys() const
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -134,6 +135,7 @@ public:
|
||||
* @param evh : an LConnectionEvent derived class.
|
||||
*/
|
||||
void UnRegisterEventHandler(LConnectionEvent * evh);
|
||||
|
||||
/**
|
||||
* Returns registered derived classes of LConnectionEvent.
|
||||
* @return A reference to a wxArrayPtrVoid object.
|
||||
|
||||
@@ -16,9 +16,12 @@ LGridCheckEditor::LGridCheckEditor(const wxString& newColName, bool isDualstate,
|
||||
m_style = wxCHK_3STATE | wxCHK_ALLOW_3RD_STATE_FOR_USER;
|
||||
if (!m_triState) m_style = wxCHK_2STATE;
|
||||
m_colName = newColName;
|
||||
if (newNullLabel.IsEmpty()) {
|
||||
if (newNullLabel.IsEmpty())
|
||||
{
|
||||
m_nullLabel = _T("?");
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nullLabel = newNullLabel;
|
||||
}
|
||||
m_type = LGridColEditor::CHECK;
|
||||
@@ -32,7 +35,8 @@ LGridCheckEditor::~LGridCheckEditor()
|
||||
wxDELETE(m_control);
|
||||
}
|
||||
|
||||
void LGridCheckEditor::Create (wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler) {
|
||||
void LGridCheckEditor::Create(wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler)
|
||||
{
|
||||
m_control = new LBoundCheckBox(parent, id, m_style);
|
||||
m_BoundCheckBox = static_cast<LBoundCheckBox*> (m_control);
|
||||
m_BoundCheckBox->SetColumnName(m_colName);
|
||||
@@ -41,59 +45,86 @@ void LGridCheckEditor::Create (wxWindow *parent, wxWindowID id, wxEvtHandler *ev
|
||||
m_control->Show(false);
|
||||
}
|
||||
|
||||
void LGridCheckEditor::BeginEdit (int row, int col, wxGrid *grid) {
|
||||
if (m_control == NULL) {
|
||||
void LGridCheckEditor::BeginEdit(int row, int col, wxGrid *grid)
|
||||
{
|
||||
if (m_control == NULL)
|
||||
{
|
||||
Create(grid->GetGridWindow(), wxID_ANY, NULL);
|
||||
}
|
||||
m_BoundCheckBox->SetResultSet(((LBoundGrid *) grid)->GetResultSet());
|
||||
const wxAny val = grid->GetTable()->GetValue(row, col);
|
||||
if (m_triState && val.As<wxString>() == m_nullLabel) {
|
||||
if (m_triState && val.As<wxString>() == m_nullLabel)
|
||||
{
|
||||
m_BoundCheckBox->SetNull();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_BoundCheckBox->SetData(val);
|
||||
}
|
||||
m_control->Show(true);
|
||||
}
|
||||
wxGridCellEditor* LGridCheckEditor::Clone () const {
|
||||
|
||||
wxGridCellEditor* LGridCheckEditor::Clone() const
|
||||
{
|
||||
return new LGridCheckEditor(m_colName, !m_triState, m_nullLabel);
|
||||
}
|
||||
bool LGridCheckEditor::EndEdit (int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval) {
|
||||
|
||||
bool LGridCheckEditor::EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval)
|
||||
{
|
||||
// What do we do here ?
|
||||
return true;
|
||||
}
|
||||
void LGridCheckEditor::ApplyEdit (int row, int col, wxGrid *grid) {
|
||||
|
||||
void LGridCheckEditor::ApplyEdit(int row, int col, wxGrid *grid)
|
||||
{
|
||||
const wxAny val = m_BoundCheckBox->GetData();
|
||||
if (m_triState && val.As<wxString>() == L_SQLNULL) {
|
||||
if (m_triState && val.As<wxString>() == L_SQLNULL)
|
||||
{
|
||||
grid->GetTable()->SetValue(row, col, m_nullLabel);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
grid->GetTable()->SetValue(row, col, val.As<wxString>());
|
||||
}
|
||||
}
|
||||
void LGridCheckEditor::Reset () {
|
||||
|
||||
void LGridCheckEditor::Reset()
|
||||
{
|
||||
wxDELETE(m_control);
|
||||
m_BoundControl = NULL;
|
||||
m_BoundCheckBox = NULL;
|
||||
}
|
||||
|
||||
wxString LGridCheckEditor::GetValue() const {
|
||||
wxString LGridCheckEditor::GetValue() const
|
||||
{
|
||||
return m_control == NULL ? wxString(wxEmptyString) : m_BoundControl->GetData().As<wxString>();
|
||||
}
|
||||
wxControl* LGridCheckEditor::ProvideFormEditor(wxWindow * parent) {
|
||||
|
||||
wxControl* LGridCheckEditor::ProvideFormEditor(wxWindow * parent)
|
||||
{
|
||||
if (!m_formEditor) m_formEditor = new wxCheckBox(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_style);
|
||||
if (m_triState) {
|
||||
if (m_triState)
|
||||
{
|
||||
m_formEditor->Set3StateValue(m_BoundCheckBox->Get3StateValue());
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_formEditor->SetValue(m_BoundCheckBox->GetValue());
|
||||
}
|
||||
m_formEditor->SetName(m_BoundCheckBox->GetName());
|
||||
if (m_BoundCheckBox->GetValidator()) m_formEditor->SetValidator(*(m_BoundCheckBox->GetValidator()));
|
||||
return m_formEditor;
|
||||
}
|
||||
void LGridCheckEditor::SyncBack(const int row, const int col, wxGrid * grid) {
|
||||
|
||||
void LGridCheckEditor::SyncBack(const int row, const int col, wxGrid * grid)
|
||||
{
|
||||
if (!m_formEditor) return;
|
||||
if (m_triState) {
|
||||
if (m_triState)
|
||||
{
|
||||
m_BoundCheckBox->Set3StateValue(m_formEditor->Get3StateValue());
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_BoundCheckBox->SetValue(m_formEditor->GetValue());
|
||||
}
|
||||
ApplyEdit(row, col, grid);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#ifndef LGRIDCOLEDITOR_H
|
||||
#define LGRIDCOLEDITOR_H
|
||||
|
||||
/**
|
||||
* Abstract class defining methods data bound grid cell editors must implement.
|
||||
*/
|
||||
@@ -24,8 +25,9 @@ public:
|
||||
|
||||
enum COL_TYPE
|
||||
{
|
||||
TEXT, COMBO, DATE, CHECK, SPIN
|
||||
TEXT, COMBO, DATE, CHECK, SPIN, JSON_GRID, XML_GRID
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the database table column name.
|
||||
|
||||
@@ -59,7 +59,19 @@ wxGridCellEditor* LGridComboEditor::Clone() const
|
||||
|
||||
bool LGridComboEditor::EndEdit(int row, int col, const wxGrid* grid, const wxString& oldval, wxString* newval)
|
||||
{
|
||||
// What do we do here ?
|
||||
/*
|
||||
* 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 m_BoundComboBox is unchanged once created.
|
||||
* Simplest workaround : disconnect m_BoundComboBox if unchanged.
|
||||
*/
|
||||
if (m_BoundComboBox->GetStringSelection() == oldval && m_BoundComboBox->IsTranslated())
|
||||
{
|
||||
LResultSet * rs = ((LBoundGrid *) grid)->GetResultSet();
|
||||
rs->UnRegisterControl(m_BoundComboBox);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ void LGridDateEditor::Create(wxWindow* parent, wxWindowID id, wxEvtHandler* evtH
|
||||
|
||||
void LGridDateEditor::BeginEdit(int row, int col, wxGrid* grid)
|
||||
{
|
||||
if (m_control == NULL) {
|
||||
if (m_control == NULL)
|
||||
{
|
||||
Create(grid->GetGridWindow(), wxID_ANY, NULL);
|
||||
}
|
||||
m_BoundDatePicker->SetResultSet(((LBoundGrid *) grid)->GetResultSet());
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
|
||||
#include "LGridColEditor.h"
|
||||
#include "LBoundDatePickerCtrl.h"
|
||||
|
||||
/**
|
||||
* Edits table data using an LBoundDatePickerCtrl.
|
||||
*/
|
||||
class LGridDateEditor : public wxGridCellEditor, public LGridColEditor {
|
||||
class LGridDateEditor : public wxGridCellEditor, public LGridColEditor
|
||||
{
|
||||
public:
|
||||
/**
|
||||
*
|
||||
@@ -63,7 +65,11 @@ public:
|
||||
* Creates a wxDatePickerCtrl to be used as editor in form view.
|
||||
*/
|
||||
wxControl* ProvideFormEditor(wxWindow * parent);
|
||||
wxControl* GetFormEditor() const {return m_formEditor;}
|
||||
|
||||
wxControl* GetFormEditor() const
|
||||
{
|
||||
return m_formEditor;
|
||||
}
|
||||
/**
|
||||
* Updates the grid cell and the editor. m_formEditor is deleted and set to NULL.
|
||||
* @param row
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
#include <wx/grid.h>
|
||||
|
||||
class LGridSpinRenderer : public wxGridCellNumberRenderer {
|
||||
class LGridSpinRenderer : public wxGridCellNumberRenderer
|
||||
{
|
||||
public:
|
||||
LGridSpinRenderer();
|
||||
virtual ~LGridSpinRenderer();
|
||||
|
||||
@@ -28,15 +28,19 @@ LGridTextEditor::~LGridTextEditor()
|
||||
wxDELETE(m_control);
|
||||
}
|
||||
|
||||
void LGridTextEditor::Create (wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler) {
|
||||
void LGridTextEditor::Create(wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler)
|
||||
{
|
||||
m_control = new LBoundTextCtrl(parent, id, m_style);
|
||||
m_BoundTextCtrl = (static_cast<LBoundTextCtrl*> (m_control));
|
||||
m_BoundTextCtrl->SetColumnName(m_colName);
|
||||
m_BoundControl = m_BoundTextCtrl;
|
||||
m_control->Show(false);
|
||||
}
|
||||
void LGridTextEditor::BeginEdit (int row, int col, wxGrid *grid) {
|
||||
if (m_control == NULL) {
|
||||
|
||||
void LGridTextEditor::BeginEdit(int row, int col, wxGrid *grid)
|
||||
{
|
||||
if (m_control == NULL)
|
||||
{
|
||||
Create(grid->GetGridWindow(), wxID_ANY, NULL);
|
||||
}
|
||||
m_BoundTextCtrl->SetResultSet(((LBoundGrid *) grid)->GetResultSet());
|
||||
@@ -44,32 +48,46 @@ void LGridTextEditor::BeginEdit (int row, int col, wxGrid *grid) {
|
||||
m_BoundTextCtrl->SetData(sText);
|
||||
m_control->Show(true);
|
||||
}
|
||||
wxGridCellEditor* LGridTextEditor::Clone () const {
|
||||
|
||||
wxGridCellEditor* LGridTextEditor::Clone() const
|
||||
{
|
||||
return new LGridTextEditor(m_colName, m_multiline);
|
||||
}
|
||||
bool LGridTextEditor::EndEdit (int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval) {
|
||||
|
||||
bool LGridTextEditor::EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval)
|
||||
{
|
||||
// What do we do here ?
|
||||
return true;
|
||||
}
|
||||
void LGridTextEditor::ApplyEdit (int row, int col, wxGrid *grid) {
|
||||
|
||||
void LGridTextEditor::ApplyEdit(int row, int col, wxGrid *grid)
|
||||
{
|
||||
grid->GetTable()->SetValue(row, col, m_BoundTextCtrl->GetValue());
|
||||
}
|
||||
void LGridTextEditor::Reset () {
|
||||
|
||||
void LGridTextEditor::Reset()
|
||||
{
|
||||
wxDELETE(m_control);
|
||||
m_BoundControl = NULL;
|
||||
m_BoundTextCtrl = NULL;
|
||||
}
|
||||
wxString LGridTextEditor::GetValue() const {
|
||||
|
||||
wxString LGridTextEditor::GetValue() const
|
||||
{
|
||||
return m_control == NULL ? wxString(wxEmptyString) : m_BoundControl->GetData().As<wxString>();
|
||||
}
|
||||
wxControl* LGridTextEditor::ProvideFormEditor(wxWindow * parent) {
|
||||
|
||||
wxControl* LGridTextEditor::ProvideFormEditor(wxWindow * parent)
|
||||
{
|
||||
if (!m_formEditor) m_formEditor = new wxTextCtrl(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_style);
|
||||
m_formEditor->SetValue(GetValue());
|
||||
m_formEditor->SetValue(m_BoundTextCtrl->GetValue());
|
||||
m_formEditor->SetName(m_BoundTextCtrl->GetName());
|
||||
if (m_BoundTextCtrl->GetValidator()) m_formEditor->SetValidator(*(m_BoundTextCtrl->GetValidator()));
|
||||
return m_formEditor;
|
||||
}
|
||||
void LGridTextEditor::SyncBack(const int row, const int col, wxGrid * grid) {
|
||||
|
||||
void LGridTextEditor::SyncBack(const int row, const int col, wxGrid * grid)
|
||||
{
|
||||
if (!m_formEditor) return;
|
||||
m_BoundTextCtrl->SetValue(m_formEditor->GetValue());
|
||||
ApplyEdit(row, col, grid);
|
||||
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
{
|
||||
return m_msg;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Both the code and the message concatenated.
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
namespace PQ
|
||||
{
|
||||
|
||||
/**
|
||||
* Scrollable minimal resultset for the PostgreSQL backend.
|
||||
*
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
*
|
||||
* Does not modify data.
|
||||
*/
|
||||
class LLightResultSet : public wxTrackable {
|
||||
class LLightResultSet : public wxTrackable
|
||||
{
|
||||
public:
|
||||
LLightResultSet();
|
||||
LLightResultSet(LConnection * newConnection);
|
||||
@@ -39,19 +40,23 @@ public:
|
||||
* Updates the SQL statement without running it.
|
||||
* @param newSql
|
||||
*/
|
||||
void UpdateSQL(const wxString& newSql) {
|
||||
void UpdateSQL(const wxString& newSql)
|
||||
{
|
||||
m_curSql = newSql;
|
||||
}
|
||||
|
||||
const wxString& GetSQL() const {
|
||||
const wxString& GetSQL() const
|
||||
{
|
||||
return m_curSql;
|
||||
}
|
||||
|
||||
void SetConnection(LConnection * newConnection) {
|
||||
void SetConnection(LConnection * newConnection)
|
||||
{
|
||||
m_conn = newConnection;
|
||||
}
|
||||
|
||||
const LConnection * GetConnection() const {
|
||||
const LConnection * GetConnection() const
|
||||
{
|
||||
return m_conn;
|
||||
}
|
||||
virtual bool HasData() const = 0;
|
||||
@@ -68,7 +73,8 @@ public:
|
||||
*
|
||||
* Returns -1 if there's no data.
|
||||
*/
|
||||
const int GetRow() const {
|
||||
const int GetRow() const
|
||||
{
|
||||
return m_cursor;
|
||||
}
|
||||
virtual const unsigned int GetRowCount() const = 0;
|
||||
|
||||
@@ -25,7 +25,8 @@ LLightSQResultSet::~LLightSQResultSet()
|
||||
{
|
||||
SQresult * srs = static_cast<SQresult*> (m_rs);
|
||||
sqlite3_free_table(srs->m_data);
|
||||
delete srs; m_rs = NULL;
|
||||
delete srs;
|
||||
m_rs = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,12 +45,14 @@ bool LLightSQResultSet::RunSQL()
|
||||
{
|
||||
SQresult * srs = static_cast<SQresult*> (m_rs);
|
||||
sqlite3_free_table(srs->m_data);
|
||||
wxDELETE(srs);;
|
||||
wxDELETE(srs);
|
||||
;
|
||||
m_rs = NULL;
|
||||
}
|
||||
m_rs = m_conn->ExecuteSQL(m_curSql);
|
||||
SQresult * srs = static_cast<SQresult*> (m_rs);
|
||||
if (!RetrieveColNames(srs)) { // No columns returned if no data !
|
||||
if (!RetrieveColNames(srs))
|
||||
{ // No columns returned if no data !
|
||||
m_rs = NULL;
|
||||
return false;
|
||||
}
|
||||
@@ -199,7 +202,9 @@ bool LLightSQResultSet::RetrieveColNames(SQresult * emptyResult)
|
||||
emptyResult->m_nbCols = m_colNames.GetCount();
|
||||
sqlite3_finalize(ppStmt);
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
int errCode = sqlite3_errcode(db);
|
||||
const char * errMsg = sqlite3_errmsg(db);
|
||||
const char * errStr = sqlite3_errstr(errCode);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
namespace SQ
|
||||
{
|
||||
|
||||
/**
|
||||
* Scrollable minimal resultset for the SQLite backend.
|
||||
*
|
||||
|
||||
@@ -74,6 +74,7 @@ private:
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* A private resultset event handler for LNavigator. All functions are declared private.
|
||||
* Don't use it.
|
||||
|
||||
@@ -15,7 +15,6 @@ using namespace PQ;
|
||||
|
||||
LPQResultSet::LPQResultSet() : LResultSet()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LPQResultSet::LPQResultSet(LConnection* newConnection) : LResultSet(newConnection)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef LVERSION_H
|
||||
#define LVERSION_H
|
||||
|
||||
#define L7_VERSION_STR "4"
|
||||
#define L7_VERSION_STR "5"
|
||||
|
||||
#endif /* LVERSION_H */
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
2019-12-23
|
||||
Added pickers to manage simple tabular data in a grid shown in a popup.
|
||||
The grid's content is stored as JSON or XML data.
|
||||
|
||||
2018-04-25
|
||||
1. Controls in 'Form View' inherit the grid cell's editor validator.
|
||||
2. Corrected a bug in LGridSpinEditor::ProvideFormEditor, where the form editor was created without the style parameter.
|
||||
2. Corrected a bug in LGridSpinEditor::ProvideFormEditor, where the form editor
|
||||
was created without the style parameter.
|
||||
3. Rename the project to L7.
|
||||
4. Change versioning pattern to running integers.
|
||||
5. Moved to github.com.
|
||||
|
||||
@@ -65,7 +65,19 @@ OBJECTFILES= \
|
||||
${OBJECTDIR}/LResultSet.o \
|
||||
${OBJECTDIR}/LSQConnection.o \
|
||||
${OBJECTDIR}/LSQResultSet.o \
|
||||
${OBJECTDIR}/LSQresult.o
|
||||
${OBJECTDIR}/LSQresult.o \
|
||||
${OBJECTDIR}/special/BaseGridPicker.o \
|
||||
${OBJECTDIR}/special/BasePicker.o \
|
||||
${OBJECTDIR}/special/JsonGridPickerCtrl.o \
|
||||
${OBJECTDIR}/special/JsonHelper.o \
|
||||
${OBJECTDIR}/special/LBoundJsonGridPicker.o \
|
||||
${OBJECTDIR}/special/LBoundXmlGridPicker.o \
|
||||
${OBJECTDIR}/special/LGridJsonCellEditor.o \
|
||||
${OBJECTDIR}/special/LGridJsonCellRenderer.o \
|
||||
${OBJECTDIR}/special/LGridXmlCellEditor.o \
|
||||
${OBJECTDIR}/special/LGridXmlCellRenderer.o \
|
||||
${OBJECTDIR}/special/XmlGridPickerCtrl.o \
|
||||
${OBJECTDIR}/special/XmlHelper.o
|
||||
|
||||
|
||||
# C Compiler Flags
|
||||
@@ -82,7 +94,7 @@ FFLAGS=
|
||||
ASFLAGS=
|
||||
|
||||
# Link Libraries and Options
|
||||
LDLIBSOPTIONS=-L/usr/local/wxWidgets/lib -lwx_baseu-3.1 -lwx_gtk2u_core-3.1
|
||||
LDLIBSOPTIONS=-L/usr/local/wxWidgets/lib -lwx_baseu-3.1 -lwx_gtk2u_core-3.1 -lwx_baseu_xml-3.1 -lwxcode_gtk2ud_wxjson-3.1
|
||||
|
||||
# Build Targets
|
||||
.build-conf: ${BUILD_SUBPROJECTS}
|
||||
@@ -95,157 +107,217 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libL7.${CND_DLIB_EXT}: ${OBJECTFILES}
|
||||
${OBJECTDIR}/LBoundCheckBox.o: LBoundCheckBox.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundCheckBox.o LBoundCheckBox.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundCheckBox.o LBoundCheckBox.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundComboBox.o: LBoundComboBox.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundComboBox.o LBoundComboBox.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundComboBox.o LBoundComboBox.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundControl.o: LBoundControl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundControl.o LBoundControl.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundControl.o LBoundControl.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundDatePickerCtrl.o: LBoundDatePickerCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundDatePickerCtrl.o LBoundDatePickerCtrl.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundDatePickerCtrl.o LBoundDatePickerCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundGrid.o: LBoundGrid.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundGrid.o LBoundGrid.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundGrid.o LBoundGrid.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundSpinCtrl.o: LBoundSpinCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundSpinCtrl.o LBoundSpinCtrl.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundSpinCtrl.o LBoundSpinCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundTextCtrl.o: LBoundTextCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundTextCtrl.o LBoundTextCtrl.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundTextCtrl.o LBoundTextCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/LConnection.o: LConnection.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LConnection.o LConnection.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LConnection.o LConnection.cpp
|
||||
|
||||
${OBJECTDIR}/LGridCheckEditor.o: LGridCheckEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridCheckEditor.o LGridCheckEditor.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridCheckEditor.o LGridCheckEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridCheckRenderer.o: LGridCheckRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridCheckRenderer.o LGridCheckRenderer.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridCheckRenderer.o LGridCheckRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LGridColEditor.o: LGridColEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridColEditor.o LGridColEditor.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridColEditor.o LGridColEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridComboEditor.o: LGridComboEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridComboEditor.o LGridComboEditor.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridComboEditor.o LGridComboEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridComboRenderer.o: LGridComboRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridComboRenderer.o LGridComboRenderer.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridComboRenderer.o LGridComboRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LGridDateEditor.o: LGridDateEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridDateEditor.o LGridDateEditor.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridDateEditor.o LGridDateEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridDateRenderer.o: LGridDateRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridDateRenderer.o LGridDateRenderer.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridDateRenderer.o LGridDateRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LGridSpinEditor.o: LGridSpinEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridSpinEditor.o LGridSpinEditor.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridSpinEditor.o LGridSpinEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridSpinRenderer.o: LGridSpinRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridSpinRenderer.o LGridSpinRenderer.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridSpinRenderer.o LGridSpinRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LGridTextEditor.o: LGridTextEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridTextEditor.o LGridTextEditor.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridTextEditor.o LGridTextEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridTextRenderer.o: LGridTextRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridTextRenderer.o LGridTextRenderer.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridTextRenderer.o LGridTextRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LInformation.o: LInformation.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LInformation.o LInformation.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LInformation.o LInformation.cpp
|
||||
|
||||
${OBJECTDIR}/LItemData.o: LItemData.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LItemData.o LItemData.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LItemData.o LItemData.cpp
|
||||
|
||||
${OBJECTDIR}/LLightPQResultSet.o: LLightPQResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightPQResultSet.o LLightPQResultSet.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightPQResultSet.o LLightPQResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LLightResultSet.o: LLightResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightResultSet.o LLightResultSet.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightResultSet.o LLightResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LLightSQResultSet.o: LLightSQResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightSQResultSet.o LLightSQResultSet.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightSQResultSet.o LLightSQResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LNavigator.o: LNavigator.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LNavigator.o LNavigator.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LNavigator.o LNavigator.cpp
|
||||
|
||||
${OBJECTDIR}/LPQConnection.o: LPQConnection.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LPQConnection.o LPQConnection.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LPQConnection.o LPQConnection.cpp
|
||||
|
||||
${OBJECTDIR}/LPQResultSet.o: LPQResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LPQResultSet.o LPQResultSet.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LPQResultSet.o LPQResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LResultSet.o: LResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LResultSet.o LResultSet.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LResultSet.o LResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LSQConnection.o: LSQConnection.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQConnection.o LSQConnection.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQConnection.o LSQConnection.cpp
|
||||
|
||||
${OBJECTDIR}/LSQResultSet.o: LSQResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQResultSet.o LSQResultSet.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQResultSet.o LSQResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LSQresult.o: LSQresult.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQresult.o LSQresult.cpp
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQresult.o LSQresult.cpp
|
||||
|
||||
${OBJECTDIR}/special/BaseGridPicker.o: special/BaseGridPicker.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/BaseGridPicker.o special/BaseGridPicker.cpp
|
||||
|
||||
${OBJECTDIR}/special/BasePicker.o: special/BasePicker.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/BasePicker.o special/BasePicker.cpp
|
||||
|
||||
${OBJECTDIR}/special/JsonGridPickerCtrl.o: special/JsonGridPickerCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/JsonGridPickerCtrl.o special/JsonGridPickerCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/special/JsonHelper.o: special/JsonHelper.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/JsonHelper.o special/JsonHelper.cpp
|
||||
|
||||
${OBJECTDIR}/special/LBoundJsonGridPicker.o: special/LBoundJsonGridPicker.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LBoundJsonGridPicker.o special/LBoundJsonGridPicker.cpp
|
||||
|
||||
${OBJECTDIR}/special/LBoundXmlGridPicker.o: special/LBoundXmlGridPicker.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LBoundXmlGridPicker.o special/LBoundXmlGridPicker.cpp
|
||||
|
||||
${OBJECTDIR}/special/LGridJsonCellEditor.o: special/LGridJsonCellEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LGridJsonCellEditor.o special/LGridJsonCellEditor.cpp
|
||||
|
||||
${OBJECTDIR}/special/LGridJsonCellRenderer.o: special/LGridJsonCellRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LGridJsonCellRenderer.o special/LGridJsonCellRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/special/LGridXmlCellEditor.o: special/LGridXmlCellEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LGridXmlCellEditor.o special/LGridXmlCellEditor.cpp
|
||||
|
||||
${OBJECTDIR}/special/LGridXmlCellRenderer.o: special/LGridXmlCellRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LGridXmlCellRenderer.o special/LGridXmlCellRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/special/XmlGridPickerCtrl.o: special/XmlGridPickerCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/XmlGridPickerCtrl.o special/XmlGridPickerCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/special/XmlHelper.o: special/XmlHelper.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/usr/local/wxWidgets/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets/include/wx-3.1 -I/usr/local/wxWidgets/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/XmlHelper.o special/XmlHelper.cpp
|
||||
|
||||
# Subprojects
|
||||
.build-subprojects:
|
||||
|
||||
@@ -65,7 +65,19 @@ OBJECTFILES= \
|
||||
${OBJECTDIR}/LResultSet.o \
|
||||
${OBJECTDIR}/LSQConnection.o \
|
||||
${OBJECTDIR}/LSQResultSet.o \
|
||||
${OBJECTDIR}/LSQresult.o
|
||||
${OBJECTDIR}/LSQresult.o \
|
||||
${OBJECTDIR}/special/BaseGridPicker.o \
|
||||
${OBJECTDIR}/special/BasePicker.o \
|
||||
${OBJECTDIR}/special/JsonGridPickerCtrl.o \
|
||||
${OBJECTDIR}/special/JsonHelper.o \
|
||||
${OBJECTDIR}/special/LBoundJsonGridPicker.o \
|
||||
${OBJECTDIR}/special/LBoundXmlGridPicker.o \
|
||||
${OBJECTDIR}/special/LGridJsonCellEditor.o \
|
||||
${OBJECTDIR}/special/LGridJsonCellRenderer.o \
|
||||
${OBJECTDIR}/special/LGridXmlCellEditor.o \
|
||||
${OBJECTDIR}/special/LGridXmlCellRenderer.o \
|
||||
${OBJECTDIR}/special/XmlGridPickerCtrl.o \
|
||||
${OBJECTDIR}/special/XmlHelper.o
|
||||
|
||||
|
||||
# C Compiler Flags
|
||||
@@ -82,7 +94,7 @@ FFLAGS=
|
||||
ASFLAGS=
|
||||
|
||||
# Link Libraries and Options
|
||||
LDLIBSOPTIONS=-L/usr/local/wxWidgets-Release/lib -lwx_baseu-3.1 -lwx_gtk2u_core-3.1
|
||||
LDLIBSOPTIONS=-L/usr/local/wxWidgets-Release/lib -lwx_baseu-3.1 -lwx_gtk2u_core-3.1 -lwx_baseu_xml-3.1 -lwxcode_gtk2u_wxjson-3.1
|
||||
|
||||
# Build Targets
|
||||
.build-conf: ${BUILD_SUBPROJECTS}
|
||||
@@ -95,157 +107,217 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libL7.${CND_DLIB_EXT}: ${OBJECTFILES}
|
||||
${OBJECTDIR}/LBoundCheckBox.o: LBoundCheckBox.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundCheckBox.o LBoundCheckBox.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundCheckBox.o LBoundCheckBox.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundComboBox.o: LBoundComboBox.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundComboBox.o LBoundComboBox.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundComboBox.o LBoundComboBox.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundControl.o: LBoundControl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundControl.o LBoundControl.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundControl.o LBoundControl.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundDatePickerCtrl.o: LBoundDatePickerCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundDatePickerCtrl.o LBoundDatePickerCtrl.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundDatePickerCtrl.o LBoundDatePickerCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundGrid.o: LBoundGrid.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundGrid.o LBoundGrid.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundGrid.o LBoundGrid.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundSpinCtrl.o: LBoundSpinCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundSpinCtrl.o LBoundSpinCtrl.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundSpinCtrl.o LBoundSpinCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/LBoundTextCtrl.o: LBoundTextCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundTextCtrl.o LBoundTextCtrl.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LBoundTextCtrl.o LBoundTextCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/LConnection.o: LConnection.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LConnection.o LConnection.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LConnection.o LConnection.cpp
|
||||
|
||||
${OBJECTDIR}/LGridCheckEditor.o: LGridCheckEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridCheckEditor.o LGridCheckEditor.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridCheckEditor.o LGridCheckEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridCheckRenderer.o: LGridCheckRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridCheckRenderer.o LGridCheckRenderer.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridCheckRenderer.o LGridCheckRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LGridColEditor.o: LGridColEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridColEditor.o LGridColEditor.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridColEditor.o LGridColEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridComboEditor.o: LGridComboEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridComboEditor.o LGridComboEditor.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridComboEditor.o LGridComboEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridComboRenderer.o: LGridComboRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridComboRenderer.o LGridComboRenderer.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridComboRenderer.o LGridComboRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LGridDateEditor.o: LGridDateEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridDateEditor.o LGridDateEditor.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridDateEditor.o LGridDateEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridDateRenderer.o: LGridDateRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridDateRenderer.o LGridDateRenderer.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridDateRenderer.o LGridDateRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LGridSpinEditor.o: LGridSpinEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridSpinEditor.o LGridSpinEditor.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridSpinEditor.o LGridSpinEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridSpinRenderer.o: LGridSpinRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridSpinRenderer.o LGridSpinRenderer.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridSpinRenderer.o LGridSpinRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LGridTextEditor.o: LGridTextEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridTextEditor.o LGridTextEditor.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridTextEditor.o LGridTextEditor.cpp
|
||||
|
||||
${OBJECTDIR}/LGridTextRenderer.o: LGridTextRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridTextRenderer.o LGridTextRenderer.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LGridTextRenderer.o LGridTextRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/LInformation.o: LInformation.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LInformation.o LInformation.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LInformation.o LInformation.cpp
|
||||
|
||||
${OBJECTDIR}/LItemData.o: LItemData.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LItemData.o LItemData.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LItemData.o LItemData.cpp
|
||||
|
||||
${OBJECTDIR}/LLightPQResultSet.o: LLightPQResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightPQResultSet.o LLightPQResultSet.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightPQResultSet.o LLightPQResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LLightResultSet.o: LLightResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightResultSet.o LLightResultSet.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightResultSet.o LLightResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LLightSQResultSet.o: LLightSQResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightSQResultSet.o LLightSQResultSet.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LLightSQResultSet.o LLightSQResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LNavigator.o: LNavigator.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LNavigator.o LNavigator.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LNavigator.o LNavigator.cpp
|
||||
|
||||
${OBJECTDIR}/LPQConnection.o: LPQConnection.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LPQConnection.o LPQConnection.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LPQConnection.o LPQConnection.cpp
|
||||
|
||||
${OBJECTDIR}/LPQResultSet.o: LPQResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LPQResultSet.o LPQResultSet.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LPQResultSet.o LPQResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LResultSet.o: LResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LResultSet.o LResultSet.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LResultSet.o LResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LSQConnection.o: LSQConnection.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQConnection.o LSQConnection.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQConnection.o LSQConnection.cpp
|
||||
|
||||
${OBJECTDIR}/LSQResultSet.o: LSQResultSet.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQResultSet.o LSQResultSet.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQResultSet.o LSQResultSet.cpp
|
||||
|
||||
${OBJECTDIR}/LSQresult.o: LSQresult.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQresult.o LSQresult.cpp
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/LSQresult.o LSQresult.cpp
|
||||
|
||||
${OBJECTDIR}/special/BaseGridPicker.o: special/BaseGridPicker.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/BaseGridPicker.o special/BaseGridPicker.cpp
|
||||
|
||||
${OBJECTDIR}/special/BasePicker.o: special/BasePicker.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/BasePicker.o special/BasePicker.cpp
|
||||
|
||||
${OBJECTDIR}/special/JsonGridPickerCtrl.o: special/JsonGridPickerCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/JsonGridPickerCtrl.o special/JsonGridPickerCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/special/JsonHelper.o: special/JsonHelper.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/JsonHelper.o special/JsonHelper.cpp
|
||||
|
||||
${OBJECTDIR}/special/LBoundJsonGridPicker.o: special/LBoundJsonGridPicker.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LBoundJsonGridPicker.o special/LBoundJsonGridPicker.cpp
|
||||
|
||||
${OBJECTDIR}/special/LBoundXmlGridPicker.o: special/LBoundXmlGridPicker.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LBoundXmlGridPicker.o special/LBoundXmlGridPicker.cpp
|
||||
|
||||
${OBJECTDIR}/special/LGridJsonCellEditor.o: special/LGridJsonCellEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LGridJsonCellEditor.o special/LGridJsonCellEditor.cpp
|
||||
|
||||
${OBJECTDIR}/special/LGridJsonCellRenderer.o: special/LGridJsonCellRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LGridJsonCellRenderer.o special/LGridJsonCellRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/special/LGridXmlCellEditor.o: special/LGridXmlCellEditor.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LGridXmlCellEditor.o special/LGridXmlCellEditor.cpp
|
||||
|
||||
${OBJECTDIR}/special/LGridXmlCellRenderer.o: special/LGridXmlCellRenderer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/LGridXmlCellRenderer.o special/LGridXmlCellRenderer.cpp
|
||||
|
||||
${OBJECTDIR}/special/XmlGridPickerCtrl.o: special/XmlGridPickerCtrl.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/XmlGridPickerCtrl.o special/XmlGridPickerCtrl.cpp
|
||||
|
||||
${OBJECTDIR}/special/XmlHelper.o: special/XmlHelper.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/special
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -O2 -s -DUSE_LIBPQ -DUSE_LIBSQ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxDEBUG_LEVEL=0 -I/usr/local/wxWidgets-Release/include/wx-3.1 -I/usr/local/wxWidgets-Release/lib/wx/include/gtk2-unicode-3.1 -I/usr/local/wxWidgets-Release/include -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/special/XmlHelper.o special/XmlHelper.cpp
|
||||
|
||||
# Subprojects
|
||||
.build-subprojects:
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project-private/1">
|
||||
<activeConfTypeElem>2</activeConfTypeElem>
|
||||
<activeConfIndexElem>0</activeConfIndexElem>
|
||||
<activeConfIndexElem>1</activeConfIndexElem>
|
||||
</data>
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group/>
|
||||
<group>
|
||||
<file>file:/home/user/Documents/published/L7/L7/special/LGridJsonCellRenderer.h</file>
|
||||
<file>file:/home/user/Documents/published/L7/L7/special/LGridJsonCellRenderer.cpp</file>
|
||||
</group>
|
||||
</open-files>
|
||||
</project-private>
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
</confList>
|
||||
<formatting>
|
||||
<project-formatting-style>true</project-formatting-style>
|
||||
<c-style>Apache|Apache</c-style>
|
||||
<cpp-style>Apache|Apache</cpp-style>
|
||||
<header-style>Apache|Apache</header-style>
|
||||
<c-style>ANSI|ANSI</c-style>
|
||||
<cpp-style>ANSI|ANSI</cpp-style>
|
||||
<header-style>ANSI|ANSI</header-style>
|
||||
</formatting>
|
||||
</data>
|
||||
</configuration>
|
||||
|
||||
211
L7/special/BaseGridPicker.cpp
Normal file
211
L7/special/BaseGridPicker.cpp
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* File: BaseGridPicker.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 7, 2019, 9:40 PM
|
||||
*/
|
||||
|
||||
#include "BaseGridPicker.h"
|
||||
|
||||
IMPLEMENT_CLASS(BaseGridPicker, BasePicker)
|
||||
|
||||
BaseGridPicker::BaseGridPicker(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize,
|
||||
const wxString& text,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
: BasePicker(parent, id, popupSize, text, pos, size, style, validator, name)
|
||||
{
|
||||
m_grid = NULL;
|
||||
m_stringTable = NULL;
|
||||
m_editable = true;
|
||||
m_intentLabel = _T("Intent");
|
||||
m_nbInsertRows = 3;
|
||||
m_colTypeChoices = types;
|
||||
m_PrefEditor = NULL;
|
||||
wxButton * btn = static_cast<wxButton*> (GetPickerCtrl());
|
||||
btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &BaseGridPicker::ShowPopup, this);
|
||||
}
|
||||
|
||||
BaseGridPicker::~BaseGridPicker()
|
||||
{
|
||||
delete m_grid;
|
||||
}
|
||||
|
||||
void BaseGridPicker::UpdatePickerFromTextCtrl()
|
||||
{
|
||||
// Gets called when TextCtrl is changed
|
||||
}
|
||||
|
||||
void BaseGridPicker::UpdateTextCtrlFromPicker()
|
||||
{
|
||||
// Gets called when TextCtrl loses focus
|
||||
}
|
||||
|
||||
void BaseGridPicker::CreateGrid()
|
||||
{
|
||||
wxDELETE(m_grid);
|
||||
BasePicker::CreatePopup();
|
||||
m_grid = new wxGrid(m_popup, wxID_ANY);
|
||||
m_popup->GetSizer()->Add(m_grid, 1, wxGROW | wxALL, 0);
|
||||
m_grid->SetSize(m_popup->GetSize());
|
||||
m_grid->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTRE);
|
||||
m_stringTable = new wxGridStringTable();
|
||||
m_stringTable->CanHaveAttributes();
|
||||
m_grid->HideRowLabels();
|
||||
m_grid->SetUseNativeColLabels();
|
||||
m_grid->SetTable(m_stringTable);
|
||||
m_grid->SetSelectionMode(wxGrid::wxGridSelectionModes::wxGridSelectRows);
|
||||
|
||||
PrepareGrid();
|
||||
FillGrid();
|
||||
}
|
||||
|
||||
void BaseGridPicker::SetIntentLabel(const wxString& intent)
|
||||
{
|
||||
m_intentLabel = intent;
|
||||
wxASSERT_MSG(m_stringTable != NULL, _("m_stringTable IS NULL"));
|
||||
m_stringTable->SetColLabelValue(0, m_intentLabel);
|
||||
}
|
||||
|
||||
wxString BaseGridPicker::GetIntent() const
|
||||
{
|
||||
wxASSERT_MSG(m_stringTable != NULL, _("m_stringTable IS NULL"));
|
||||
for (uint row = 0; row < m_stringTable->GetRowsCount(); row++)
|
||||
{
|
||||
if (m_stringTable->GetValue(row, 2) != _T("0")
|
||||
&& !m_stringTable->GetValue(row, 2).IsEmpty()
|
||||
&& !m_stringTable->GetValue(row, 0).IsEmpty())
|
||||
{
|
||||
return m_stringTable->GetValue(row, 0);
|
||||
}
|
||||
}
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
void BaseGridPicker::EnableEditing(bool editable)
|
||||
{
|
||||
m_editable = editable;
|
||||
m_nbInsertRows = editable ? 3 : 0;
|
||||
}
|
||||
|
||||
void BaseGridPicker::OnPopupHidden(wxShowEvent& evt)
|
||||
{
|
||||
if (evt.IsShown())
|
||||
{
|
||||
evt.Skip();
|
||||
return;
|
||||
}
|
||||
m_grid->SaveEditControlValue();
|
||||
/*
|
||||
* Workaround an unexpected behavior :
|
||||
* If cell is edited to empty, SaveEditControlValue() above does not
|
||||
* save the empty string in the string table.
|
||||
* It still contains the old non-empty value.
|
||||
* GoToCell() below effectively ends editing.
|
||||
* But this does not happen if cell is edited from empty to any non-empty
|
||||
* value.
|
||||
*/
|
||||
m_grid->GoToCell(m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol());
|
||||
DumpGrid();
|
||||
for (uint row = 0; row < m_stringTable->GetRowsCount(); row++)
|
||||
{
|
||||
if (m_stringTable->GetValue(row, 2) != _T("0")
|
||||
&& !m_stringTable->GetValue(row, 2).IsEmpty())
|
||||
{
|
||||
const wxString intent = m_stringTable->GetValue(row, 0);
|
||||
if (!intent.IsEmpty())
|
||||
{
|
||||
GetTextCtrl()->SetValue(intent);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
}
|
||||
evt.Skip();
|
||||
return;
|
||||
}
|
||||
}
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
void BaseGridPicker::PreparePreferredCol()
|
||||
{
|
||||
wxASSERT_MSG(m_stringTable != NULL, _("m_stringTable IS NULL"));
|
||||
wxGridCellAttr * colAtt = m_stringTable->GetAttr(m_grid->GetGridCursorRow(), 2, wxGridCellAttr::Col);
|
||||
if (colAtt == NULL) colAtt = new wxGridCellAttr();
|
||||
wxGridCellBoolEditor * ed = new wxGridCellBoolEditor();
|
||||
colAtt->SetEditor(ed);
|
||||
wxGridCellBoolRenderer * rn = new wxGridCellBoolRenderer();
|
||||
colAtt->SetRenderer(rn);
|
||||
colAtt->SetAlignment(wxALIGN_CENTER, wxALIGN_CENTRE);
|
||||
m_stringTable->SetColAttr(colAtt, 2);
|
||||
}
|
||||
|
||||
void BaseGridPicker::PrepareTypeCol()
|
||||
{
|
||||
wxASSERT_MSG(m_stringTable != NULL, _("m_stringTable IS NULL"));
|
||||
wxGridCellAttr * colAtt = m_stringTable->GetAttr(m_grid->GetGridCursorRow(), 1, wxGridCellAttr::Col);
|
||||
if (colAtt == NULL) colAtt = new wxGridCellAttr();
|
||||
wxGridCellChoiceEditor* ed = new wxGridCellChoiceEditor(m_colTypeChoices);
|
||||
colAtt->SetEditor(ed);
|
||||
m_stringTable->SetColAttr(colAtt, 1);
|
||||
}
|
||||
|
||||
void BaseGridPicker::PrepareGrid()
|
||||
{
|
||||
wxASSERT_MSG(m_grid != NULL, _("m_grid IS NULL"));
|
||||
wxASSERT_MSG(m_stringTable != NULL, _("m_stringTable IS NULL"));
|
||||
m_grid->AppendCols(4);
|
||||
m_grid->AppendRows(m_nbInsertRows);
|
||||
PreparePreferredCol();
|
||||
PrepareTypeCol();
|
||||
m_grid->SetColSize(0, 170);
|
||||
m_grid->SetColSize(1, 100);
|
||||
m_grid->SetColSize(3, 200);
|
||||
m_stringTable->SetColLabelValue(0, m_intentLabel);
|
||||
m_stringTable->SetColLabelValue(1, _T("Type"));
|
||||
m_stringTable->SetColLabelValue(2, _T("Preferred"));
|
||||
m_stringTable->SetColLabelValue(3, _T("Notes"));
|
||||
m_grid->Bind(wxEVT_GRID_EDITOR_CREATED, &BaseGridPicker::OnEditorCreated, this);
|
||||
m_grid->Bind(wxEVT_GRID_EDITOR_HIDDEN, &BaseGridPicker::OnEditorHidden, this);
|
||||
}
|
||||
|
||||
void BaseGridPicker::OnEditorCreated(wxGridEditorCreatedEvent& evt)
|
||||
{
|
||||
if (evt.GetCol() == 2)
|
||||
{
|
||||
m_PrefEditor = static_cast<wxCheckBox*> (evt.GetControl());
|
||||
}
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
void BaseGridPicker::OnEditorHidden(wxGridEvent& evt)
|
||||
{
|
||||
if (evt.GetCol() == 2 && m_PrefEditor && m_PrefEditor->IsChecked())
|
||||
{
|
||||
for (uint row = 0; row < m_stringTable->GetRowsCount(); row++)
|
||||
{
|
||||
if (row != evt.GetRow())
|
||||
{
|
||||
m_stringTable->SetValue(row, evt.GetCol(), _T("0"));
|
||||
}
|
||||
}
|
||||
m_grid->ForceRefresh();
|
||||
}
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
void BaseGridPicker::ShowPopup(wxCommandEvent& evt)
|
||||
{
|
||||
BasePicker::DoShowPopup();
|
||||
evt.Skip();
|
||||
}
|
||||
181
L7/special/BaseGridPicker.h
Normal file
181
L7/special/BaseGridPicker.h
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* File: BaseGridPicker.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 7, 2019, 9:40 PM
|
||||
*/
|
||||
|
||||
#ifndef BASEGRIDPICKER_H
|
||||
#define BASEGRIDPICKER_H
|
||||
|
||||
#include "BasePicker.h"
|
||||
#include <wx/grid.h>
|
||||
|
||||
#define INVALID_INTENT _("[Invalid]")
|
||||
|
||||
/**
|
||||
* Abstract class adding a wxGrid to BasePicker.
|
||||
* <br/>The grid is contained in the popup. It has 4 columns :
|
||||
* <br/><br/> Column 0 : The intent : phone, email..., in single line
|
||||
* <br/> Column 1 : Type : Home, Work...
|
||||
* <br/> Column 2 : Preferred : one entry should be preferred
|
||||
* <br/> Column 3 : Short notes in single line
|
||||
* <br/><br/>
|
||||
* The label of the Intent column can be changed by an application. The other
|
||||
* columns have fixed labels.
|
||||
* <br/>
|
||||
* The Type column is edited with a combobox. Its values are set by
|
||||
* SetColTypeChoices().
|
||||
* <br/>
|
||||
* The Preferred column allows selecting one single entry as preferred. If none
|
||||
* is selected, the dataset persists but considered invalid.
|
||||
* <br/>
|
||||
* Selection mode is wxGridSelectRows. Row labels are hidden.
|
||||
* <br/>
|
||||
* Three empty rows are available for quick multiple inputs.
|
||||
* @return
|
||||
*/
|
||||
class BaseGridPicker : public BasePicker
|
||||
{
|
||||
DECLARE_CLASS(BaseGridPicker)
|
||||
public:
|
||||
BaseGridPicker(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxPB_USE_TEXTCTRL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
virtual ~BaseGridPicker();
|
||||
/**
|
||||
* Unused, empty implementation.
|
||||
*/
|
||||
virtual void UpdatePickerFromTextCtrl();
|
||||
/**
|
||||
* Unused, empty implementation.
|
||||
*/
|
||||
virtual void UpdateTextCtrlFromPicker();
|
||||
|
||||
virtual void SetValue(const wxString& value) = 0;
|
||||
|
||||
virtual wxString GetValue() = 0;
|
||||
|
||||
/**
|
||||
* Sets the values of the Type column in a combobox.
|
||||
* @param choices
|
||||
*/
|
||||
void SetColTypeChoices(const wxArrayString& choices)
|
||||
{
|
||||
m_colTypeChoices = choices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the values of the Type column.
|
||||
* @return
|
||||
*/
|
||||
wxArrayString GetColTypeChoices() const
|
||||
{
|
||||
return m_colTypeChoices;
|
||||
}
|
||||
/**
|
||||
* Sets the label of the Intent column.
|
||||
* @param intent
|
||||
*/
|
||||
void SetIntentLabel(const wxString& intent);
|
||||
|
||||
/**
|
||||
* Gets the label of the Intent column.
|
||||
* @return
|
||||
*/
|
||||
wxString GetIntentLabel() const
|
||||
{
|
||||
return m_intentLabel;
|
||||
}
|
||||
/**
|
||||
* Gets the Intent value, the one that is marked as preferred.
|
||||
* It may return an empty string if no item is preferred.
|
||||
* @return
|
||||
*/
|
||||
wxString GetIntent() const;
|
||||
|
||||
/**
|
||||
* Can we modify data ?
|
||||
* @return
|
||||
*/
|
||||
bool IsEditable() const
|
||||
{
|
||||
return m_editable;
|
||||
}
|
||||
/**
|
||||
* Grid data may be editable or not. In the latter case, no empty rows are
|
||||
* shown.
|
||||
* @param editable
|
||||
*/
|
||||
void EnableEditing(bool editable);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Saves the grid's content internally and updates the wxTextCtrl's value.
|
||||
* @param evt
|
||||
*/
|
||||
virtual void OnPopupHidden(wxShowEvent& evt);
|
||||
virtual void FillGrid() = 0;
|
||||
virtual void DumpGrid() = 0;
|
||||
/**
|
||||
* Creates, configures and fills the grid by calling FillGrid(). A previous
|
||||
* grid is deleted.
|
||||
*/
|
||||
void CreateGrid();
|
||||
wxGrid * m_grid;
|
||||
wxGridStringTable * m_stringTable;
|
||||
bool m_editable;
|
||||
private:
|
||||
wxArrayString m_colTypeChoices;
|
||||
wxString m_intentLabel;
|
||||
uint m_nbInsertRows;
|
||||
wxCheckBox * m_PrefEditor;
|
||||
/**
|
||||
* Configures the Preferred column for editing and rendering using a
|
||||
* checkbox.
|
||||
*/
|
||||
void PreparePreferredCol();
|
||||
/**
|
||||
* Configures the Type column for editing using a combobox.
|
||||
*/
|
||||
void PrepareTypeCol();
|
||||
/**
|
||||
* Adds rows and columns, configures the columns, further setting sizes
|
||||
* and labels.
|
||||
* <br/>
|
||||
* Binds the grid to editor creation and hidden events.
|
||||
*/
|
||||
void PrepareGrid();
|
||||
/**
|
||||
* References the wxCheckBox editor.
|
||||
* <br/>
|
||||
* Does nothing for the other columns.
|
||||
*
|
||||
* @param evt
|
||||
*/
|
||||
void OnEditorCreated(wxGridEditorCreatedEvent& evt);
|
||||
/**
|
||||
* Concerns the Preferred column only. When the editor is checked, ensures
|
||||
* the other rows are unchecked.
|
||||
* @param evt
|
||||
*/
|
||||
void OnEditorHidden(wxGridEvent& evt);
|
||||
/**
|
||||
* Just calls BasePicker::DoShowPopup().
|
||||
* @param evt
|
||||
*/
|
||||
virtual void ShowPopup(wxCommandEvent& evt);
|
||||
|
||||
};
|
||||
|
||||
#endif /* BASEGRIDPICKER_H */
|
||||
|
||||
74
L7/special/BasePicker.cpp
Normal file
74
L7/special/BasePicker.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* File: BasePicker.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 7, 2019, 9:24 PM
|
||||
*/
|
||||
|
||||
#include "BasePicker.h"
|
||||
|
||||
IMPLEMENT_CLASS(BasePicker, wxPickerBase)
|
||||
|
||||
BasePicker::BasePicker(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
wxSize popupSize,
|
||||
const wxString& text,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
: wxPickerBase()
|
||||
{
|
||||
m_popup = NULL;
|
||||
m_popupSize = popupSize;
|
||||
wxPickerBase::CreateBase(parent, id, text, pos, size, style, validator, name);
|
||||
wxButton * btn = new wxButton(this, wxID_ANY, _T("↓"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
|
||||
SetPickerCtrl(btn);
|
||||
wxPickerBase::PostCreation();
|
||||
GetTextCtrl()->SetEditable(false);
|
||||
SetTextCtrlGrowable(true);
|
||||
SetPickerCtrlGrowable(true);
|
||||
}
|
||||
|
||||
BasePicker::~BasePicker()
|
||||
{
|
||||
delete m_popup;
|
||||
}
|
||||
|
||||
void BasePicker::CreatePopup()
|
||||
{
|
||||
wxDELETE(m_popup);
|
||||
m_popup = new wxPopupTransientWindow(this);
|
||||
wxBoxSizer * sz = new wxBoxSizer(wxVERTICAL);
|
||||
m_popup->SetSizer(sz);
|
||||
|
||||
m_popup->Bind(wxEVT_SHOW, &BasePicker::OnPopupHidden, this);
|
||||
}
|
||||
|
||||
void BasePicker::DoShowPopup()
|
||||
{
|
||||
if (m_popupSize.GetWidth() < 0)
|
||||
m_popupSize.SetWidth(GetClientSize().GetWidth());
|
||||
if (m_popupSize.GetHeight() < 0)
|
||||
m_popupSize.SetHeight(300);
|
||||
m_popup->SetClientSize(m_popupSize);
|
||||
m_popup->GetSizer()->Layout();
|
||||
|
||||
wxScreenDC dc;
|
||||
const int screenWidth = dc.GetSize().GetWidth();
|
||||
const int screenHeight = dc.GetSize().GetHeight();
|
||||
const wxPoint oriPos = GetScreenPosition() + GetClientRect().GetBottomLeft();
|
||||
wxPoint dest(oriPos.x, oriPos.y);
|
||||
if (oriPos.x > (screenWidth - m_popupSize.GetWidth())) dest.x = (screenWidth - m_popupSize.GetWidth());
|
||||
if (oriPos.x < 0) dest.x = 0;
|
||||
if (oriPos.y > (screenHeight - m_popupSize.GetHeight())) dest.y = (screenHeight - m_popupSize.GetHeight());
|
||||
if (oriPos.y < 0) dest.y = 0;
|
||||
if (m_popupSize.GetWidth() > screenWidth) dest.x = 0;
|
||||
if (m_popupSize.GetHeight() > screenHeight) dest.y = 0;
|
||||
m_popup->SetPosition(dest);
|
||||
|
||||
m_popup->Popup();
|
||||
}
|
||||
63
L7/special/BasePicker.h
Normal file
63
L7/special/BasePicker.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* File: BasePicker.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 7, 2019, 9:24 PM
|
||||
*/
|
||||
|
||||
#ifndef BASEPICKER_H
|
||||
#define BASEPICKER_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/pickerbase.h>
|
||||
#include <wx/popupwin.h>
|
||||
|
||||
/**
|
||||
* Abstract class adding a popup to wxPickerBase styled with
|
||||
* a non-editable wxTextCtrl. It manages the popup's position and size also.
|
||||
* The picker control is a wxButton that shows the popup.
|
||||
*/
|
||||
class BasePicker : public wxPickerBase
|
||||
{
|
||||
DECLARE_CLASS(BasePicker)
|
||||
public:
|
||||
BasePicker(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
wxSize popupSize = wxDefaultSize,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxPB_USE_TEXTCTRL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
virtual ~BasePicker();
|
||||
|
||||
virtual void UpdatePickerFromTextCtrl() = 0;
|
||||
virtual void UpdateTextCtrlFromPicker() = 0;
|
||||
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxPopupTransientWindow * m_popup;
|
||||
wxSize m_popupSize;
|
||||
/**
|
||||
* A new popup is always created. Any previous popup is deleted.
|
||||
* It binds to OnPopupHidden().
|
||||
*/
|
||||
virtual void CreatePopup();
|
||||
/**
|
||||
* Shows the popup managing its position and size.
|
||||
* <br/><br/>
|
||||
* If m_popupSize.GetWidth() < 0, the popup's width is set to the control's
|
||||
* width.
|
||||
* <br/>
|
||||
* If m_popupSize.GetHeight() < 0, it defaults to 300.
|
||||
*/
|
||||
virtual void DoShowPopup();
|
||||
virtual void OnPopupHidden(wxShowEvent& evt) = 0;
|
||||
};
|
||||
|
||||
#endif /* BASEPICKER_H */
|
||||
|
||||
171
L7/special/JsonGridPickerCtrl.cpp
Normal file
171
L7/special/JsonGridPickerCtrl.cpp
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* File: JsonGridPickerCtrl.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 7, 2019, 10:01 PM
|
||||
*/
|
||||
|
||||
/*
|
||||
* [
|
||||
{
|
||||
"Intent" : "a@b.com",
|
||||
"Type" : "Home",
|
||||
"Preferred" : 0,
|
||||
"Notes" : "Do not use"
|
||||
},
|
||||
{
|
||||
"Intent" : "c@d.com",
|
||||
"Type" : "Work",
|
||||
"Preferred" : 1,
|
||||
"Notes" : "Neither"
|
||||
}
|
||||
]
|
||||
|
||||
*/
|
||||
#include "JsonGridPickerCtrl.h"
|
||||
#include <wx/jsonreader.h>
|
||||
#include <wx/jsonwriter.h>
|
||||
|
||||
IMPLEMENT_CLASS(JsonGridPickerCtrl, BaseGridPicker)
|
||||
|
||||
#define EMPTY_ARR _T("[]")
|
||||
|
||||
JsonGridPickerCtrl::JsonGridPickerCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize,
|
||||
const wxString& text,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
: BaseGridPicker(parent, id, types, popupSize, text, pos, size, style, validator, name)
|
||||
{
|
||||
/*
|
||||
* Don't create the grid here. Let SetValue() do it, deleting the previous
|
||||
* one every time new data is fed in.
|
||||
*/
|
||||
SetValue(wxEmptyString);
|
||||
}
|
||||
|
||||
JsonGridPickerCtrl::~JsonGridPickerCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
void JsonGridPickerCtrl::SetValue(const wxString& value)
|
||||
{
|
||||
if (value.IsEmpty())
|
||||
{
|
||||
m_value = EMPTY_ARR;
|
||||
BaseGridPicker::CreateGrid(); // +++
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
return;
|
||||
}
|
||||
m_value = value;
|
||||
BaseGridPicker::CreateGrid(); // +++
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
|
||||
wxJSONReader reader(wxJSONREADER_STRICT);
|
||||
wxJSONValue root;
|
||||
uint nbErr = reader.Parse(m_value, &root);
|
||||
if (nbErr > 0)
|
||||
{
|
||||
const wxArrayString& errors = reader.GetErrors();
|
||||
for (int i = 0; i < nbErr; i++)
|
||||
{
|
||||
wxASSERT_MSG(nbErr == 0, errors[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!root.IsArray())
|
||||
{
|
||||
wxASSERT_MSG(root.IsArray(), _("JSON data is not an array"));
|
||||
return;
|
||||
}
|
||||
for (uint row = 0; row < root.Size(); row++)
|
||||
{
|
||||
if (root[row]["Preferred"].IsValid()
|
||||
&& !root[row]["Preferred"].AsString().IsEmpty()
|
||||
&& root[row]["Preferred"].AsInt() != 0)
|
||||
{
|
||||
GetTextCtrl()->SetValue(root[row]["Intent"].AsString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
}
|
||||
|
||||
wxString JsonGridPickerCtrl::GetValue()
|
||||
{
|
||||
DumpGrid();
|
||||
/*
|
||||
* wxJSONWriter adds quotes and line breaks to EMPTY_ARR !
|
||||
* m_value is set in DumpGrid(). If there is no grid data, m_value is set
|
||||
* to \"[]\"\n
|
||||
*/
|
||||
wxJSONValue empty(EMPTY_ARR);
|
||||
wxJSONWriter writer;
|
||||
wxString sempty;
|
||||
writer.Write(empty, sempty);
|
||||
if (m_value == sempty)
|
||||
return wxEmptyString;
|
||||
return m_value;
|
||||
}
|
||||
|
||||
void JsonGridPickerCtrl::FillGrid()
|
||||
{
|
||||
wxASSERT_MSG(m_grid != NULL, _("m_grid IS NULL"));
|
||||
wxJSONReader reader(wxJSONREADER_STRICT);
|
||||
wxJSONValue root;
|
||||
uint nbErr = reader.Parse(m_value, &root);
|
||||
if (nbErr > 0)
|
||||
{
|
||||
const wxArrayString& errors = reader.GetErrors();
|
||||
for (int i = 0; i < nbErr; i++)
|
||||
{
|
||||
wxASSERT_MSG(nbErr == 0, errors[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!root.IsArray())
|
||||
{
|
||||
wxASSERT_MSG(root.IsArray(), _("JSON data is not an array"));
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint row = 0; row < root.Size(); row++)
|
||||
{
|
||||
m_grid->InsertRows(row);
|
||||
m_grid->SetCellValue(row, 0, root[row]["Intent"].AsString());
|
||||
m_grid->SetCellValue(row, 1, root[row]["Type"].AsString());
|
||||
m_grid->SetCellValue(row, 2, root[row]["Preferred"].AsString());
|
||||
m_grid->SetCellValue(row, 3, root[row]["Notes"].AsString());
|
||||
}
|
||||
}
|
||||
|
||||
void JsonGridPickerCtrl::DumpGrid()
|
||||
{
|
||||
wxASSERT_MSG(m_grid != NULL, _("m_grid IS NULL"));
|
||||
wxASSERT_MSG(m_stringTable != NULL, _("m_stringTable IS NULL"));
|
||||
if (!m_editable || !m_stringTable || !m_grid)
|
||||
return;
|
||||
wxJSONWriter writer;
|
||||
wxJSONValue root(EMPTY_ARR);
|
||||
uint row = 0;
|
||||
uint jrow = 0;
|
||||
for (row; row < m_stringTable->GetRowsCount(); row++)
|
||||
{
|
||||
if (m_stringTable->GetValue(row, 0).IsEmpty())
|
||||
continue;
|
||||
root[jrow]["Intent"] = m_stringTable->GetValue(row, 0);
|
||||
root[jrow]["Type"] = m_stringTable->GetValue(row, 1);
|
||||
root[jrow]["Preferred"] = (m_stringTable->GetValue(row, 2) == _T("0")
|
||||
|| m_stringTable->GetValue(row, 2).IsEmpty()) ? 0 : 1;
|
||||
root[jrow]["Notes"] = m_stringTable->GetValue(row, 3);
|
||||
jrow++;
|
||||
}
|
||||
writer.Write(root, m_value); // May be EMPTY_ARR
|
||||
}
|
||||
70
L7/special/JsonGridPickerCtrl.h
Normal file
70
L7/special/JsonGridPickerCtrl.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* File: JsonGridPickerCtrl.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 7, 2019, 10:01 PM
|
||||
*/
|
||||
|
||||
#ifndef JSONGRIDPICKERCTRL_H
|
||||
#define JSONGRIDPICKERCTRL_H
|
||||
|
||||
#include "BaseGridPicker.h"
|
||||
|
||||
/**
|
||||
* The grid content is stored in a JSON array.
|
||||
* @return
|
||||
*/
|
||||
class JsonGridPickerCtrl : public BaseGridPicker
|
||||
{
|
||||
DECLARE_CLASS(JsonGridPickerCtrl)
|
||||
public:
|
||||
JsonGridPickerCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxPB_USE_TEXTCTRL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
virtual ~JsonGridPickerCtrl();
|
||||
|
||||
/**
|
||||
* Creates a new grid deleting the previous one and fills it with the JSON
|
||||
* data.
|
||||
* @param value
|
||||
*/
|
||||
virtual void SetValue(const wxString& value);
|
||||
|
||||
/**
|
||||
* Dumps the grid content and returns it as a JSON array. But returns empty
|
||||
* string if JSON array is empty.
|
||||
* @return
|
||||
*/
|
||||
virtual wxString GetValue();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Parses the JSON data and fills the grid. It should be pure JSON, without
|
||||
* any extension like comments.
|
||||
*/
|
||||
virtual void FillGrid();
|
||||
/**
|
||||
* Translates the grid content to a JSON array.
|
||||
* If the Intent column is empty, this row is ignored.
|
||||
*/
|
||||
virtual void DumpGrid();
|
||||
/**
|
||||
* Is the JSON array.
|
||||
*/
|
||||
wxString m_value;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif /* JSONGRIDPICKERCTRL_H */
|
||||
|
||||
53
L7/special/JsonHelper.cpp
Normal file
53
L7/special/JsonHelper.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* File: JsonHelper.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 16, 2019, 8:25 PM
|
||||
*/
|
||||
|
||||
#include "JsonHelper.h"
|
||||
#include <wx/jsonreader.h>
|
||||
|
||||
JsonHelper::JsonHelper()
|
||||
{
|
||||
}
|
||||
|
||||
JsonHelper::~JsonHelper()
|
||||
{
|
||||
}
|
||||
|
||||
wxString JsonHelper::GetIntent(const wxString& jsonData)
|
||||
{
|
||||
if (jsonData.IsEmpty())
|
||||
return wxEmptyString;
|
||||
|
||||
wxJSONReader reader(wxJSONREADER_STRICT);
|
||||
wxJSONValue root;
|
||||
uint nbErr = reader.Parse(jsonData, &root);
|
||||
if (nbErr > 0)
|
||||
{
|
||||
const wxArrayString& errors = reader.GetErrors();
|
||||
for (int i = 0; i < nbErr; i++)
|
||||
{
|
||||
wxASSERT_MSG(nbErr == 0, errors[i]);
|
||||
}
|
||||
return wxEmptyString;
|
||||
}
|
||||
if (!root.IsArray())
|
||||
{
|
||||
wxASSERT_MSG(root.IsArray(), _("JSON data is not an array"));
|
||||
return wxEmptyString;
|
||||
}
|
||||
for (uint row = 0; row < root.Size(); row++)
|
||||
{
|
||||
if (root[row]["Preferred"].IsValid()
|
||||
&& !root[row]["Preferred"].AsString().IsEmpty()
|
||||
&& root[row]["Preferred"].AsInt() != 0)
|
||||
{
|
||||
return root[row]["Intent"].AsString();
|
||||
}
|
||||
}
|
||||
return wxEmptyString;
|
||||
}
|
||||
36
L7/special/JsonHelper.h
Normal file
36
L7/special/JsonHelper.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* File: JsonHelper.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 16, 2019, 8:25 PM
|
||||
*/
|
||||
|
||||
#ifndef JSONHELPER_H
|
||||
#define JSONHELPER_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
/**
|
||||
* Application helper to quickly get the Intent value.
|
||||
* @param jsonData
|
||||
* @return
|
||||
*/
|
||||
class JsonHelper
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Returns a valid Intent value or an empty string.
|
||||
* @param jsonData
|
||||
* @return
|
||||
*/
|
||||
static wxString GetIntent(const wxString& jsonData);
|
||||
private:
|
||||
JsonHelper();
|
||||
virtual ~JsonHelper();
|
||||
};
|
||||
|
||||
#endif /* JSONHELPER_H */
|
||||
|
||||
113
L7/special/LBoundJsonGridPicker.cpp
Normal file
113
L7/special/LBoundJsonGridPicker.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* File: LBoundJsonGridPicker.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 8, 2019, 9:23 AM
|
||||
*/
|
||||
|
||||
#include "LBoundJsonGridPicker.h"
|
||||
#include <wx/jsonreader.h>
|
||||
|
||||
IMPLEMENT_CLASS(LBoundJsonGridPicker, JsonGridPickerCtrl)
|
||||
|
||||
LBoundJsonGridPicker::LBoundJsonGridPicker(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize,
|
||||
const wxString& text,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
: JsonGridPickerCtrl(parent, id, types, popupSize, text, pos, size, style, validator, name)
|
||||
{
|
||||
m_sqlQuote = _T("'");
|
||||
}
|
||||
|
||||
LBoundJsonGridPicker::~LBoundJsonGridPicker()
|
||||
{
|
||||
if (m_rs) m_rs->UnRegisterControl(this);
|
||||
}
|
||||
|
||||
void LBoundJsonGridPicker::SetResultSet(LResultSet* newResultSet)
|
||||
{
|
||||
m_rs = newResultSet;
|
||||
if (m_rs == NULL) return;
|
||||
m_rs->RegisterControl(this);
|
||||
}
|
||||
|
||||
const wxAny LBoundJsonGridPicker::GetData()
|
||||
{
|
||||
// If m_value == EMPTY_ARR, GetValue() returns empty string
|
||||
if (GetValue().IsEmpty()) return L_SQLNULL;
|
||||
return GetValue();
|
||||
}
|
||||
|
||||
void LBoundJsonGridPicker::SetData(const wxAny& newData)
|
||||
{
|
||||
SetValue(newData.As<wxString>());
|
||||
}
|
||||
|
||||
void LBoundJsonGridPicker::SetNull()
|
||||
{
|
||||
// m_value is set to EMPTY_ARR
|
||||
SetValue(wxEmptyString);
|
||||
}
|
||||
|
||||
bool LBoundJsonGridPicker::IsDirty()
|
||||
{
|
||||
wxASSERT_MSG(m_rs != NULL, _("RS = NULL"));
|
||||
wxAny BEData = m_rs->GetData(m_columnName);
|
||||
const wxString ctrlValue = GetValue();
|
||||
/*
|
||||
* Make JSON objects from backend and control values, and compare them.
|
||||
* Postgresql : jsonb columns contain single line values. Can't compare strings.
|
||||
*/
|
||||
const wxString beValue = BEData.As<wxString>();
|
||||
if (ctrlValue.IsEmpty() || beValue.IsEmpty())
|
||||
return (ctrlValue != beValue);
|
||||
|
||||
wxJSONReader beReader(wxJSONREADER_STRICT);
|
||||
wxJSONValue beRoot;
|
||||
uint nbErr = beReader.Parse(beValue, &beRoot);
|
||||
if (nbErr > 0)
|
||||
{
|
||||
const wxArrayString& errors = beReader.GetErrors();
|
||||
for (int i = 0; i < nbErr; i++)
|
||||
{
|
||||
wxASSERT_MSG(nbErr == 0, errors[i]);
|
||||
}
|
||||
// Backend value is not what we expect. Declare dirty to overwrite it.
|
||||
return true;
|
||||
}
|
||||
if (!beRoot.IsArray())
|
||||
{
|
||||
wxASSERT_MSG(beRoot.IsArray(), _("Back end JSON data is not an array"));
|
||||
return true;
|
||||
}
|
||||
|
||||
wxJSONReader ctrlReader(wxJSONREADER_STRICT);
|
||||
wxJSONValue ctrlRoot;
|
||||
nbErr = beReader.Parse(ctrlValue, &ctrlRoot);
|
||||
// Should not happen as we wrote the data.
|
||||
if (nbErr > 0)
|
||||
{
|
||||
const wxArrayString& errors = ctrlReader.GetErrors();
|
||||
for (int i = 0; i < nbErr; i++)
|
||||
{
|
||||
wxASSERT_MSG(nbErr == 0, errors[i]);
|
||||
}
|
||||
// Control value is not what we expect. Don't overwrite in backend.
|
||||
return false;
|
||||
}
|
||||
if (!ctrlRoot.IsArray())
|
||||
{
|
||||
wxASSERT_MSG(ctrlRoot.IsArray(), _("Control JSON data is not an array"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return (!ctrlRoot.IsSameAs(beRoot));
|
||||
}
|
||||
81
L7/special/LBoundJsonGridPicker.h
Normal file
81
L7/special/LBoundJsonGridPicker.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* File: LBoundJsonGridPicker.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 8, 2019, 9:23 AM
|
||||
*/
|
||||
|
||||
#ifndef LBOUNDJSONGRIDPICKER_H
|
||||
#define LBOUNDJSONGRIDPICKER_H
|
||||
|
||||
#include "JsonGridPickerCtrl.h"
|
||||
#include "../LBoundControl.h"
|
||||
#include "../LResultSet.h"
|
||||
|
||||
/**
|
||||
* Saves a JSON array in database.
|
||||
* Data type of database column should be TEXT for sqlite, and can be TEXT or
|
||||
* JSONB for postgresql.
|
||||
* @return
|
||||
*/
|
||||
class LBoundJsonGridPicker : public JsonGridPickerCtrl, public LBoundControl
|
||||
{
|
||||
DECLARE_CLASS(LBoundJsonGridPicker)
|
||||
public:
|
||||
LBoundJsonGridPicker(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxPB_USE_TEXTCTRL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
virtual ~LBoundJsonGridPicker();
|
||||
|
||||
/**
|
||||
* Sets the resultset member and registers the control in the resultset.
|
||||
* @param newResultSet
|
||||
*/
|
||||
void SetResultSet(LResultSet * newResultSet);
|
||||
/**
|
||||
*
|
||||
* @return If the control is empty, returns literal NULL.
|
||||
* Else, returns GetValue().
|
||||
*/
|
||||
const wxAny GetData();
|
||||
void SetData(const wxAny& newData);
|
||||
|
||||
bool IsNull()
|
||||
{
|
||||
return (GetData().As<wxString>() == L_SQLNULL);
|
||||
}
|
||||
void SetNull();
|
||||
/**
|
||||
* Is control data same as backend data?
|
||||
* <br/><br/>
|
||||
* If backend data cannot be parsed, will always return true, because
|
||||
* GetValue() returns empty control data.
|
||||
* @return
|
||||
*/
|
||||
bool IsDirty();
|
||||
|
||||
/**
|
||||
* Alias for GetValue().
|
||||
* Not really the displayed informative value in the picker's wxTextCtrl.
|
||||
* @return
|
||||
*/
|
||||
const wxString GetDisplayedData()
|
||||
{
|
||||
return GetValue();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif /* LBOUNDJSONGRIDPICKER_H */
|
||||
|
||||
72
L7/special/LBoundXmlGridPicker.cpp
Normal file
72
L7/special/LBoundXmlGridPicker.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* File: LBoundXmlGridPicker.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 14, 2019, 10:12 PM
|
||||
*/
|
||||
|
||||
#include "LBoundXmlGridPicker.h"
|
||||
|
||||
IMPLEMENT_CLASS(LBoundXmlGridPicker, XmlGridPickerCtrl)
|
||||
|
||||
LBoundXmlGridPicker::LBoundXmlGridPicker(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize,
|
||||
const wxString& text,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
: XmlGridPickerCtrl(parent, id, types, popupSize, text, pos, size, style, validator, name)
|
||||
{
|
||||
m_sqlQuote = _T("'");
|
||||
}
|
||||
|
||||
LBoundXmlGridPicker::~LBoundXmlGridPicker()
|
||||
{
|
||||
if (m_rs) m_rs->UnRegisterControl(this);
|
||||
}
|
||||
|
||||
void LBoundXmlGridPicker::SetResultSet(LResultSet* newResultSet)
|
||||
{
|
||||
m_rs = newResultSet;
|
||||
if (m_rs == NULL) return;
|
||||
m_rs->RegisterControl(this);
|
||||
}
|
||||
|
||||
const wxAny LBoundXmlGridPicker::GetData()
|
||||
{
|
||||
// If m_value is EMPTY_DOC, GetValue() returns empty string
|
||||
if (GetValue().IsEmpty()) return L_SQLNULL;
|
||||
return GetValue();
|
||||
}
|
||||
|
||||
void LBoundXmlGridPicker::SetData(const wxAny& newData)
|
||||
{
|
||||
SetValue(newData.As<wxString>());
|
||||
}
|
||||
|
||||
void LBoundXmlGridPicker::SetNull()
|
||||
{
|
||||
// m_value is set to EMPTY_DOC
|
||||
SetValue(wxEmptyString);
|
||||
}
|
||||
|
||||
bool LBoundXmlGridPicker::IsDirty()
|
||||
{
|
||||
/*
|
||||
* String compare backend and control values.
|
||||
* Database column data type is TEXT, hence data is saved verbatim.
|
||||
* On the other hand, comparing XML documents is not trivial.
|
||||
* wxWidgets does not have this functionality, not does it write
|
||||
* canonical XML, AFAIK.
|
||||
* Linking to other libraries for this would be an overkill.
|
||||
*/
|
||||
wxASSERT_MSG(m_rs != NULL, _("RS = NULL"));
|
||||
wxAny BEData = m_rs->GetData(m_columnName);
|
||||
return (GetValue() != BEData.As<wxString>());
|
||||
}
|
||||
80
L7/special/LBoundXmlGridPicker.h
Normal file
80
L7/special/LBoundXmlGridPicker.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* File: LBoundXmlGridPicker.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 14, 2019, 10:12 PM
|
||||
*/
|
||||
|
||||
#ifndef LBOUNDXMLGRIDPICKER_H
|
||||
#define LBOUNDXMLGRIDPICKER_H
|
||||
|
||||
#include "XmlGridPickerCtrl.h"
|
||||
#include "../LBoundControl.h"
|
||||
#include "../LResultSet.h"
|
||||
|
||||
/**
|
||||
* Saves an XML document in database.
|
||||
* Data type of database column should be TEXT for both sqlite and postgresql.
|
||||
* @return
|
||||
*/
|
||||
class LBoundXmlGridPicker : public XmlGridPickerCtrl, public LBoundControl
|
||||
{
|
||||
DECLARE_CLASS(LBoundXmlGridPicker)
|
||||
public:
|
||||
LBoundXmlGridPicker(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxPB_USE_TEXTCTRL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
virtual ~LBoundXmlGridPicker();
|
||||
|
||||
/**
|
||||
* Sets the resultset member and registers the control in the resultset.
|
||||
* @param newResultSet
|
||||
*/
|
||||
void SetResultSet(LResultSet * newResultSet);
|
||||
/**
|
||||
*
|
||||
* @return If the control is empty, returns literal NULL.
|
||||
* Else, returns GetValue().
|
||||
*/
|
||||
const wxAny GetData();
|
||||
void SetData(const wxAny& newData);
|
||||
|
||||
bool IsNull()
|
||||
{
|
||||
return (GetData().As<wxString>() == L_SQLNULL);
|
||||
}
|
||||
void SetNull();
|
||||
/**
|
||||
* Is control data same as backend data?
|
||||
* <br/><br/>
|
||||
* If backend data is cannot be parsed, will always return true, because
|
||||
* GetValue() returns empty control data.
|
||||
* @return
|
||||
*/
|
||||
bool IsDirty();
|
||||
|
||||
/**
|
||||
* Alias for GetValue().
|
||||
* Not really the displayed informative value in the picker'swxTextCtrl.
|
||||
* @return
|
||||
*/
|
||||
const wxString GetDisplayedData()
|
||||
{
|
||||
return GetValue();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif /* LBOUNDXMLGRIDPICKER_H */
|
||||
|
||||
144
L7/special/LGridJsonCellEditor.cpp
Normal file
144
L7/special/LGridJsonCellEditor.cpp
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* File: LGridJsonCellEditor.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
* Author: user
|
||||
*
|
||||
* Created on December 9, 2019, 10:36 AM
|
||||
*/
|
||||
|
||||
#include "LGridJsonCellEditor.h"
|
||||
#include "../LBoundGrid.h"
|
||||
|
||||
LGridJsonCellEditor::LGridJsonCellEditor(const wxString& newColName,
|
||||
const wxString& intentLabel,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize)
|
||||
: wxGridCellEditor(), LGridColEditor()
|
||||
{
|
||||
m_intentLabel = intentLabel;
|
||||
m_choices = types;
|
||||
m_popupSize = popupSize;
|
||||
m_colName = newColName;
|
||||
m_type = LGridColEditor::JSON_GRID;
|
||||
m_formEditor = NULL;
|
||||
m_BoundControl = NULL;
|
||||
m_BoundJsonGridPicker = NULL;
|
||||
m_editRow = wxNOT_FOUND;
|
||||
m_rsEVH = NULL;
|
||||
}
|
||||
|
||||
LGridJsonCellEditor::~LGridJsonCellEditor()
|
||||
{
|
||||
delete m_rsEVH;
|
||||
wxDELETE(m_control);
|
||||
}
|
||||
|
||||
void LGridJsonCellEditor::Create(wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler)
|
||||
{
|
||||
m_control = new LBoundJsonGridPicker(parent, id, m_choices, m_popupSize);
|
||||
m_BoundJsonGridPicker = (static_cast<LBoundJsonGridPicker*> (m_control));
|
||||
m_BoundJsonGridPicker->SetColumnName(m_colName);
|
||||
if (!m_intentLabel.IsEmpty())
|
||||
m_BoundJsonGridPicker->SetIntentLabel(m_intentLabel);
|
||||
m_BoundControl = m_BoundJsonGridPicker;
|
||||
m_rsEVH = new JsonGridEditorRsEVH(this);
|
||||
m_control->Show(false);
|
||||
}
|
||||
|
||||
void LGridJsonCellEditor::BeginEdit(int row, int col, wxGrid *grid)
|
||||
{
|
||||
if (m_editRow != row)
|
||||
m_jsonBuffer.MakeNull();
|
||||
m_editRow = row;
|
||||
if (m_control == NULL)
|
||||
{
|
||||
Create(grid->GetGridWindow(), wxID_ANY, NULL);
|
||||
}
|
||||
|
||||
LResultSet * rs = ((LBoundGrid *) grid)->GetResultSet();
|
||||
m_rsEVH->SetResultSet(rs);
|
||||
rs->RegisterEventHandler(m_rsEVH);
|
||||
|
||||
m_BoundJsonGridPicker->SetResultSet(rs);
|
||||
if (m_jsonBuffer.IsNull() && row < rs->GetRowCount())
|
||||
m_jsonBuffer = rs->GetData(row, col);
|
||||
m_BoundJsonGridPicker->SetData(m_jsonBuffer);
|
||||
m_control->Show(true);
|
||||
}
|
||||
|
||||
wxGridCellEditor* LGridJsonCellEditor::Clone() const
|
||||
{
|
||||
return new LGridJsonCellEditor(m_colName, m_intentLabel, m_choices, m_popupSize);
|
||||
}
|
||||
|
||||
bool LGridJsonCellEditor::EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval)
|
||||
{
|
||||
// What do we do here ?
|
||||
return true;
|
||||
}
|
||||
|
||||
void LGridJsonCellEditor::ApplyEdit(int row, int col, wxGrid *grid)
|
||||
{
|
||||
m_jsonBuffer = m_BoundJsonGridPicker->GetValue();
|
||||
grid->GetTable()->SetValue(row, col, m_jsonBuffer.As<wxString>());
|
||||
}
|
||||
|
||||
void LGridJsonCellEditor::Reset()
|
||||
{
|
||||
delete m_rsEVH;
|
||||
m_rsEVH = NULL;
|
||||
wxDELETE(m_control);
|
||||
m_BoundControl = NULL;
|
||||
m_BoundJsonGridPicker = NULL;
|
||||
m_jsonBuffer.MakeNull();
|
||||
m_editRow = wxNOT_FOUND;
|
||||
}
|
||||
|
||||
wxString LGridJsonCellEditor::GetValue() const
|
||||
{
|
||||
return m_control == NULL ? wxString(wxEmptyString) : m_BoundControl->GetData().As<wxString>();
|
||||
}
|
||||
|
||||
wxControl* LGridJsonCellEditor::ProvideFormEditor(wxWindow * parent)
|
||||
{
|
||||
if (!m_formEditor) m_formEditor = new JsonGridPickerCtrl(parent, wxID_ANY, m_choices);
|
||||
m_formEditor->SetValue(GetValue());
|
||||
m_formEditor->SetName(m_BoundJsonGridPicker->GetName());
|
||||
m_formEditor->SetIntentLabel(m_BoundJsonGridPicker->GetIntentLabel());
|
||||
if (m_BoundJsonGridPicker->GetValidator()) m_formEditor->SetValidator(*(m_BoundJsonGridPicker->GetValidator()));
|
||||
return m_formEditor;
|
||||
}
|
||||
|
||||
void LGridJsonCellEditor::SyncBack(const int row, const int col, wxGrid * grid)
|
||||
{
|
||||
if (!m_formEditor) return;
|
||||
m_BoundJsonGridPicker->SetValue(m_formEditor->GetValue());
|
||||
ApplyEdit(row, col, grid);
|
||||
wxDELETE(m_formEditor);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
JsonGridEditorRsEVH::JsonGridEditorRsEVH(LGridJsonCellEditor * owner)
|
||||
: LResultSetEvent()
|
||||
{
|
||||
m_owner = owner;
|
||||
m_rs = NULL;
|
||||
}
|
||||
|
||||
JsonGridEditorRsEVH::~JsonGridEditorRsEVH()
|
||||
{
|
||||
if (m_rs)
|
||||
m_rs->UnRegisterEventHandler(this);
|
||||
}
|
||||
|
||||
void JsonGridEditorRsEVH::AfterAction(LResultSet * caller, ACTIONS action)
|
||||
{
|
||||
m_rs = caller;
|
||||
if (action == ACTIONS::ACTION_CANCEL)
|
||||
{
|
||||
m_owner->m_jsonBuffer.MakeNull();
|
||||
}
|
||||
}
|
||||
124
L7/special/LGridJsonCellEditor.h
Normal file
124
L7/special/LGridJsonCellEditor.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* File: LGridJsonCellEditor.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 9, 2019, 10:36 AM
|
||||
*/
|
||||
|
||||
#ifndef LGRIDJSONCELLEDITOR_H
|
||||
#define LGRIDJSONCELLEDITOR_H
|
||||
|
||||
#include "../LGridColEditor.h"
|
||||
#include "LBoundJsonGridPicker.h"
|
||||
|
||||
class JsonGridEditorRsEVH;
|
||||
class LGridJsonCellEditor;
|
||||
|
||||
/**
|
||||
* A grid cell editor using LBoundJsonGridPicker
|
||||
* @param newColName
|
||||
* @param intentLabel
|
||||
* @param types
|
||||
* @param popupSize
|
||||
*/
|
||||
class LGridJsonCellEditor : public wxGridCellEditor, public LGridColEditor
|
||||
{
|
||||
friend class JsonGridEditorRsEVH;
|
||||
public:
|
||||
LGridJsonCellEditor(const wxString& newColName,
|
||||
const wxString& intentLabel,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize);
|
||||
virtual ~LGridJsonCellEditor();
|
||||
|
||||
/**
|
||||
* Creates m_control as LBoundJsonGridPicker.
|
||||
* @param parent
|
||||
* @param id
|
||||
* @param evtHandler
|
||||
*/
|
||||
void Create(wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler);
|
||||
/**
|
||||
* Creates m_control if necessary. Registers the editor in the grid's resultset.
|
||||
* @param row
|
||||
* @param col
|
||||
* @param grid
|
||||
*/
|
||||
void BeginEdit(int row, int col, wxGrid *grid);
|
||||
wxGridCellEditor* Clone() const;
|
||||
bool EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval);
|
||||
/**
|
||||
* Applies the editor value as returned by GetValue() to the grid cell.
|
||||
* @param row
|
||||
* @param col
|
||||
* @param grid
|
||||
*/
|
||||
void ApplyEdit(int row, int col, wxGrid *grid);
|
||||
/**
|
||||
* Deletes the editor, all pointers to the editor are set to NULL.
|
||||
*/
|
||||
void Reset();
|
||||
/**
|
||||
*
|
||||
* @return GetData(), or wxEmptyString if the editor control has not been created.
|
||||
*/
|
||||
wxString GetValue() const;
|
||||
/**
|
||||
* Creates a wxTextCtrl to be used as editor in form view.
|
||||
*/
|
||||
wxControl* ProvideFormEditor(wxWindow * parent);
|
||||
|
||||
wxControl* GetFormEditor() const
|
||||
{
|
||||
return m_formEditor;
|
||||
}
|
||||
/**
|
||||
* Updates the grid cell and the editor. m_formEditor is deleted and set to NULL.
|
||||
* @param row
|
||||
* @param col
|
||||
* @param grid
|
||||
*/
|
||||
void SyncBack(const int row, const int col, wxGrid * grid);
|
||||
|
||||
private:
|
||||
wxString m_intentLabel;
|
||||
wxArrayString m_choices;
|
||||
wxSize m_popupSize;
|
||||
JsonGridPickerCtrl * m_formEditor;
|
||||
wxAny m_jsonBuffer;
|
||||
int m_editRow;
|
||||
/**
|
||||
* Fully typed alias to m_control.
|
||||
*/
|
||||
LBoundJsonGridPicker * m_BoundJsonGridPicker;
|
||||
wxWeakRef<JsonGridEditorRsEVH> m_rsEVH;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears LGridJsonGridEditor::m_jsonBuffer on LBoundGrid::Cancel.
|
||||
* Must be trackable. If it is deleted by an application, avoid crash in
|
||||
* destructor of LGridJsonGridEditor.
|
||||
*/
|
||||
class JsonGridEditorRsEVH : public LResultSetEvent, public wxTrackable
|
||||
{
|
||||
friend class LGridJsonCellEditor;
|
||||
public:
|
||||
|
||||
private:
|
||||
JsonGridEditorRsEVH(LGridJsonCellEditor * owner);
|
||||
virtual ~JsonGridEditorRsEVH();
|
||||
virtual void AfterAction(LResultSet * caller, ACTIONS action);
|
||||
|
||||
void SetResultSet(LResultSet * caller)
|
||||
{
|
||||
m_rs = caller;
|
||||
}
|
||||
|
||||
LResultSet * m_rs;
|
||||
LGridJsonCellEditor * m_owner;
|
||||
};
|
||||
|
||||
#endif /* LGRIDJSONCELLEDITOR_H */
|
||||
|
||||
73
L7/special/LGridJsonCellRenderer.cpp
Normal file
73
L7/special/LGridJsonCellRenderer.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* File: LGridJsonCellRenderer.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 9, 2019, 1:55 PM
|
||||
*/
|
||||
|
||||
#include "LGridJsonCellRenderer.h"
|
||||
#include "BaseGridPicker.h"
|
||||
#include <wx/jsonreader.h>
|
||||
|
||||
LGridJsonCellRenderer::LGridJsonCellRenderer()
|
||||
{
|
||||
}
|
||||
|
||||
LGridJsonCellRenderer::~LGridJsonCellRenderer()
|
||||
{
|
||||
}
|
||||
|
||||
void LGridJsonCellRenderer::Draw(wxGrid & grid,
|
||||
wxGridCellAttr & attr,
|
||||
wxDC & dc,
|
||||
const wxRect & rect,
|
||||
int row,
|
||||
int col,
|
||||
bool isSelected)
|
||||
{
|
||||
const wxString intent = ProcessJsonValue(grid.GetCellValue(row, col));
|
||||
grid.SetCellValue(row, col, intent);
|
||||
|
||||
wxGridCellStringRenderer::Draw(grid, attr, dc, rect, row, col, isSelected);
|
||||
}
|
||||
|
||||
const wxString LGridJsonCellRenderer::ProcessJsonValue(const wxString& cellValue)
|
||||
{
|
||||
if (cellValue.IsEmpty())
|
||||
return INVALID_INTENT;
|
||||
|
||||
wxJSONReader reader(wxJSONREADER_STRICT);
|
||||
wxJSONValue root;
|
||||
uint nbErr = reader.Parse(cellValue, &root);
|
||||
if (nbErr > 0)
|
||||
{
|
||||
const wxArrayString& errors = reader.GetErrors();
|
||||
for (int i = 0; i < nbErr; i++)
|
||||
{
|
||||
wxASSERT_MSG(nbErr == 0, errors[i]);
|
||||
}
|
||||
// Show raw data.
|
||||
return cellValue;
|
||||
}
|
||||
if (!root.IsArray())
|
||||
{
|
||||
wxASSERT_MSG(root.IsArray(), _("JSON data is not an array"));
|
||||
return cellValue;
|
||||
}
|
||||
for (uint row = 0; row < root.Size(); row++)
|
||||
{
|
||||
if (root[row]["Preferred"].IsValid()
|
||||
&& !root[row]["Preferred"].AsString().IsEmpty()
|
||||
&& root[row]["Preferred"].AsInt() != 0)
|
||||
{
|
||||
return root[row]["Intent"].AsString();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Don't show raw data if there's no preferred item.
|
||||
* The data will still be in the editor and saved.
|
||||
*/
|
||||
return INVALID_INTENT;
|
||||
}
|
||||
38
L7/special/LGridJsonCellRenderer.h
Normal file
38
L7/special/LGridJsonCellRenderer.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* File: LGridJsonCellRenderer.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 9, 2019, 1:55 PM
|
||||
*/
|
||||
|
||||
#ifndef LGRIDJSONCELLRENDERER_H
|
||||
#define LGRIDJSONCELLRENDERER_H
|
||||
|
||||
#include "wx/grid.h"
|
||||
|
||||
/**
|
||||
* A grid cell renderer for json stored data.
|
||||
* It show the selected Intent value, or INVALID_INTENT.
|
||||
*/
|
||||
class LGridJsonCellRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
LGridJsonCellRenderer();
|
||||
virtual ~LGridJsonCellRenderer();
|
||||
|
||||
void Draw(wxGrid & grid,
|
||||
wxGridCellAttr & attr,
|
||||
wxDC & dc,
|
||||
const wxRect & rect,
|
||||
int row,
|
||||
int col,
|
||||
bool isSelected);
|
||||
private:
|
||||
|
||||
const wxString ProcessJsonValue(const wxString& cellValue);
|
||||
};
|
||||
|
||||
#endif /* LGRIDJSONCELLRENDERER_H */
|
||||
|
||||
143
L7/special/LGridXmlCellEditor.cpp
Normal file
143
L7/special/LGridXmlCellEditor.cpp
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* File: LGridXmlCellEditor.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 15, 2019, 6:32 PM
|
||||
*/
|
||||
|
||||
#include "LGridXmlCellEditor.h"
|
||||
#include "../LBoundGrid.h"
|
||||
|
||||
LGridXmlCellEditor::LGridXmlCellEditor(const wxString& newColName,
|
||||
const wxString& intentLabel,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize)
|
||||
: wxGridCellEditor(), LGridColEditor()
|
||||
{
|
||||
m_intentLabel = intentLabel;
|
||||
m_choices = types;
|
||||
m_popupSize = popupSize;
|
||||
m_colName = newColName;
|
||||
m_type = LGridColEditor::XML_GRID;
|
||||
m_formEditor = NULL;
|
||||
m_BoundControl = NULL;
|
||||
m_BoundXmlGridPicker = NULL;
|
||||
m_editRow = wxNOT_FOUND;
|
||||
m_rsEVH = NULL;
|
||||
}
|
||||
|
||||
LGridXmlCellEditor::~LGridXmlCellEditor()
|
||||
{
|
||||
delete m_rsEVH;
|
||||
wxDELETE(m_control);
|
||||
}
|
||||
|
||||
void LGridXmlCellEditor::Create(wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler)
|
||||
{
|
||||
m_control = new LBoundXmlGridPicker(parent, id, m_choices, m_popupSize);
|
||||
m_BoundXmlGridPicker = (static_cast<LBoundXmlGridPicker*> (m_control));
|
||||
m_BoundXmlGridPicker->SetColumnName(m_colName);
|
||||
if (!m_intentLabel.IsEmpty())
|
||||
m_BoundXmlGridPicker->SetIntentLabel(m_intentLabel);
|
||||
m_BoundControl = m_BoundXmlGridPicker;
|
||||
m_rsEVH = new XmlGridEditorRsEVH(this);
|
||||
m_control->Show(false);
|
||||
}
|
||||
|
||||
void LGridXmlCellEditor::BeginEdit(int row, int col, wxGrid *grid)
|
||||
{
|
||||
if (m_editRow != row)
|
||||
m_xmlBuffer.MakeNull();
|
||||
m_editRow = row;
|
||||
if (m_control == NULL)
|
||||
{
|
||||
Create(grid->GetGridWindow(), wxID_ANY, NULL);
|
||||
}
|
||||
|
||||
LResultSet * rs = ((LBoundGrid *) grid)->GetResultSet();
|
||||
m_rsEVH->SetResultSet(rs);
|
||||
rs->RegisterEventHandler(m_rsEVH);
|
||||
|
||||
m_BoundXmlGridPicker->SetResultSet(rs);
|
||||
if (m_xmlBuffer.IsNull() && row < rs->GetRowCount())
|
||||
m_xmlBuffer = rs->GetData(row, col);
|
||||
m_BoundXmlGridPicker->SetData(m_xmlBuffer);
|
||||
m_control->Show(true);
|
||||
}
|
||||
|
||||
wxGridCellEditor* LGridXmlCellEditor::Clone() const
|
||||
{
|
||||
return new LGridXmlCellEditor(m_colName, m_intentLabel, m_choices, m_popupSize);
|
||||
}
|
||||
|
||||
bool LGridXmlCellEditor::EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval)
|
||||
{
|
||||
// What do we do here ?
|
||||
return true;
|
||||
}
|
||||
|
||||
void LGridXmlCellEditor::ApplyEdit(int row, int col, wxGrid *grid)
|
||||
{
|
||||
m_xmlBuffer = m_BoundXmlGridPicker->GetValue();
|
||||
grid->GetTable()->SetValue(row, col, m_xmlBuffer.As<wxString>());
|
||||
}
|
||||
|
||||
void LGridXmlCellEditor::Reset()
|
||||
{
|
||||
delete m_rsEVH;
|
||||
m_rsEVH = NULL;
|
||||
wxDELETE(m_control);
|
||||
m_BoundControl = NULL;
|
||||
m_BoundXmlGridPicker = NULL;
|
||||
m_xmlBuffer.MakeNull();
|
||||
m_editRow = wxNOT_FOUND;
|
||||
}
|
||||
|
||||
wxString LGridXmlCellEditor::GetValue() const
|
||||
{
|
||||
return m_control == NULL ? wxString(wxEmptyString) : m_BoundControl->GetData().As<wxString>();
|
||||
}
|
||||
|
||||
wxControl* LGridXmlCellEditor::ProvideFormEditor(wxWindow * parent)
|
||||
{
|
||||
if (!m_formEditor) m_formEditor = new XmlGridPickerCtrl(parent, wxID_ANY, m_choices);
|
||||
m_formEditor->SetValue(GetValue());
|
||||
m_formEditor->SetName(m_BoundXmlGridPicker->GetName());
|
||||
m_formEditor->SetIntentLabel(m_BoundXmlGridPicker->GetIntentLabel());
|
||||
if (m_BoundXmlGridPicker->GetValidator()) m_formEditor->SetValidator(*(m_BoundXmlGridPicker->GetValidator()));
|
||||
return m_formEditor;
|
||||
}
|
||||
|
||||
void LGridXmlCellEditor::SyncBack(const int row, const int col, wxGrid * grid)
|
||||
{
|
||||
if (!m_formEditor) return;
|
||||
m_BoundXmlGridPicker->SetValue(m_formEditor->GetValue());
|
||||
ApplyEdit(row, col, grid);
|
||||
wxDELETE(m_formEditor);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
XmlGridEditorRsEVH::XmlGridEditorRsEVH(LGridXmlCellEditor * owner)
|
||||
: LResultSetEvent()
|
||||
{
|
||||
m_owner = owner;
|
||||
m_rs = NULL;
|
||||
}
|
||||
|
||||
XmlGridEditorRsEVH::~XmlGridEditorRsEVH()
|
||||
{
|
||||
if (m_rs)
|
||||
m_rs->UnRegisterEventHandler(this);
|
||||
}
|
||||
|
||||
void XmlGridEditorRsEVH::AfterAction(LResultSet * caller, ACTIONS action)
|
||||
{
|
||||
m_rs = caller;
|
||||
if (action == ACTIONS::ACTION_CANCEL)
|
||||
{
|
||||
m_owner->m_xmlBuffer.MakeNull();
|
||||
}
|
||||
}
|
||||
123
L7/special/LGridXmlCellEditor.h
Normal file
123
L7/special/LGridXmlCellEditor.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* File: LGridXmlCellEditor.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 15, 2019, 6:32 PM
|
||||
*/
|
||||
|
||||
#ifndef LGRIDXMLCELLEDITOR_H
|
||||
#define LGRIDXMLCELLEDITOR_H
|
||||
|
||||
#include "../LGridColEditor.h"
|
||||
#include "LBoundXmlGridPicker.h"
|
||||
|
||||
class XmlGridEditorRsEVH;
|
||||
class LGridXmlCellEditor;
|
||||
|
||||
/**
|
||||
* A grid cell editor using LBoundXmlGridPicker
|
||||
* @param newColName
|
||||
* @param intentLabel
|
||||
* @param types
|
||||
* @param popupSize
|
||||
*/
|
||||
class LGridXmlCellEditor : public wxGridCellEditor, public LGridColEditor
|
||||
{
|
||||
friend class XmlGridEditorRsEVH;
|
||||
public:
|
||||
LGridXmlCellEditor(const wxString& newColName,
|
||||
const wxString& intentLabel,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize);
|
||||
virtual ~LGridXmlCellEditor();
|
||||
/**
|
||||
* Creates m_control as LBoundJsonGridPicker.
|
||||
* @param parent
|
||||
* @param id
|
||||
* @param evtHandler
|
||||
*/
|
||||
void Create(wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler);
|
||||
/**
|
||||
* Creates m_control if necessary. Registers the editor in the grid's resultset.
|
||||
* @param row
|
||||
* @param col
|
||||
* @param grid
|
||||
*/
|
||||
void BeginEdit(int row, int col, wxGrid *grid);
|
||||
wxGridCellEditor* Clone() const;
|
||||
bool EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval);
|
||||
/**
|
||||
* Applies the editor value as returned by GetValue() to the grid cell.
|
||||
* @param row
|
||||
* @param col
|
||||
* @param grid
|
||||
*/
|
||||
void ApplyEdit(int row, int col, wxGrid *grid);
|
||||
/**
|
||||
* Deletes the editor, all pointers to the editor are set to NULL.
|
||||
*/
|
||||
void Reset();
|
||||
/**
|
||||
*
|
||||
* @return GetData(), or wxEmptyString if the editor control has not been created.
|
||||
*/
|
||||
wxString GetValue() const;
|
||||
/**
|
||||
* Creates a wxTextCtrl to be used as editor in form view.
|
||||
*/
|
||||
wxControl* ProvideFormEditor(wxWindow * parent);
|
||||
|
||||
wxControl* GetFormEditor() const
|
||||
{
|
||||
return m_formEditor;
|
||||
}
|
||||
/**
|
||||
* Updates the grid cell and the editor. m_formEditor is deleted and set to NULL.
|
||||
* @param row
|
||||
* @param col
|
||||
* @param grid
|
||||
*/
|
||||
void SyncBack(const int row, const int col, wxGrid * grid);
|
||||
|
||||
private:
|
||||
wxString m_intentLabel;
|
||||
wxArrayString m_choices;
|
||||
wxSize m_popupSize;
|
||||
XmlGridPickerCtrl * m_formEditor;
|
||||
wxAny m_xmlBuffer;
|
||||
int m_editRow;
|
||||
/**
|
||||
* Fully typed alias to m_control.
|
||||
*/
|
||||
LBoundXmlGridPicker * m_BoundXmlGridPicker;
|
||||
wxWeakRef<XmlGridEditorRsEVH> m_rsEVH;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears LGridXmlGridEditor::m_jsonBuffer on LBoundGrid::Cancel.
|
||||
* Must be trackable. If it is deleted by an application, avoid crash in
|
||||
* destructor of LGridXmlGridEditor.
|
||||
*/
|
||||
class XmlGridEditorRsEVH : public LResultSetEvent, public wxTrackable
|
||||
{
|
||||
friend class LGridXmlCellEditor;
|
||||
public:
|
||||
|
||||
private:
|
||||
XmlGridEditorRsEVH(LGridXmlCellEditor * owner);
|
||||
virtual ~XmlGridEditorRsEVH();
|
||||
virtual void AfterAction(LResultSet * caller, ACTIONS action);
|
||||
|
||||
void SetResultSet(LResultSet * caller)
|
||||
{
|
||||
m_rs = caller;
|
||||
}
|
||||
|
||||
LResultSet * m_rs;
|
||||
LGridXmlCellEditor * m_owner;
|
||||
};
|
||||
|
||||
#endif /* LGRIDXMLCELLEDITOR_H */
|
||||
|
||||
58
L7/special/LGridXmlCellRenderer.cpp
Normal file
58
L7/special/LGridXmlCellRenderer.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* File: LGridXmlCellRenderer.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 15, 2019, 6:18 PM
|
||||
*/
|
||||
|
||||
#include "LGridXmlCellRenderer.h"
|
||||
#include "XmlHelper.h"
|
||||
#include "BaseGridPicker.h"
|
||||
|
||||
LGridXmlCellRenderer::LGridXmlCellRenderer()
|
||||
{
|
||||
}
|
||||
|
||||
LGridXmlCellRenderer::~LGridXmlCellRenderer()
|
||||
{
|
||||
}
|
||||
|
||||
void LGridXmlCellRenderer::Draw(wxGrid & grid,
|
||||
wxGridCellAttr & attr,
|
||||
wxDC & dc,
|
||||
const wxRect & rect,
|
||||
int row,
|
||||
int col,
|
||||
bool isSelected)
|
||||
{
|
||||
const wxString intent = ProcessXmlValue(grid.GetCellValue(row, col));
|
||||
grid.SetCellValue(row, col, intent);
|
||||
|
||||
wxGridCellStringRenderer::Draw(grid, attr, dc, rect, row, col, isSelected);
|
||||
}
|
||||
|
||||
const wxString LGridXmlCellRenderer::ProcessXmlValue(const wxString& cellValue)
|
||||
{
|
||||
if (cellValue.IsEmpty())
|
||||
return INVALID_INTENT;
|
||||
wxXmlDocument doc;
|
||||
wxXmlNode * root = XmlHelper::ValidateXmlValue(doc, cellValue);
|
||||
if (root == NULL)
|
||||
// Show raw data.
|
||||
return cellValue;
|
||||
wxXmlNode * row = root->GetChildren();
|
||||
while (row)
|
||||
{
|
||||
const wxString pref = row->GetAttribute(XML_ATTR_PREF);
|
||||
if (!pref.IsEmpty() && pref != _T("0"))
|
||||
return row->GetNodeContent();
|
||||
row = row->GetNext();
|
||||
}
|
||||
/*
|
||||
* Don't show raw data if there's no preferred item.
|
||||
* The data will still be in the editor and saved.
|
||||
*/
|
||||
return INVALID_INTENT;
|
||||
}
|
||||
39
L7/special/LGridXmlCellRenderer.h
Normal file
39
L7/special/LGridXmlCellRenderer.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* File: LGridXmlCellRenderer.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 15, 2019, 6:18 PM
|
||||
*/
|
||||
|
||||
#ifndef LGRIDXMLCELLRENDERER_H
|
||||
#define LGRIDXMLCELLRENDERER_H
|
||||
|
||||
#include "wx/grid.h"
|
||||
|
||||
/**
|
||||
* A grid cell renderer for xml stored data.
|
||||
* It show the selected Intent value, or INVALID_INTENT.
|
||||
*/
|
||||
class LGridXmlCellRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
LGridXmlCellRenderer();
|
||||
virtual ~LGridXmlCellRenderer();
|
||||
|
||||
void Draw(wxGrid & grid,
|
||||
wxGridCellAttr & attr,
|
||||
wxDC & dc,
|
||||
const wxRect & rect,
|
||||
int row,
|
||||
int col,
|
||||
bool isSelected);
|
||||
private:
|
||||
|
||||
const wxString ProcessXmlValue(const wxString& cellValue);
|
||||
|
||||
};
|
||||
|
||||
#endif /* LGRIDXMLCELLRENDERER_H */
|
||||
|
||||
167
L7/special/XmlGridPickerCtrl.cpp
Normal file
167
L7/special/XmlGridPickerCtrl.cpp
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* File: XmlGridPickerCtrl.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 14, 2019, 3:28 PM
|
||||
*/
|
||||
|
||||
#include "XmlGridPickerCtrl.h"
|
||||
#include <wx/sstream.h>
|
||||
#include "XmlHelper.h"
|
||||
|
||||
/*
|
||||
* <?xml version="1.0" encoding="UTF-8"?>
|
||||
<TABLE>
|
||||
<ROW Type="Work" Preferred="1" Notes="Do not use">+33 1 23 45 67 89</ROW>
|
||||
<ROW Type="Home" Preferred="0" Notes="Neither">+33 9 87 65 43 21</ROW>
|
||||
</TABLE>
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(XmlGridPickerCtrl, BaseGridPicker)
|
||||
|
||||
XmlGridPickerCtrl::XmlGridPickerCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize,
|
||||
const wxString& text,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
: BaseGridPicker(parent, id, types, popupSize, text, pos, size, style, validator, name)
|
||||
{
|
||||
/*
|
||||
* Don't create the grid here. Let SetValue() do it, deleting the previous
|
||||
* one every time new data is fed in.
|
||||
*/
|
||||
SetValue(wxEmptyString);
|
||||
}
|
||||
|
||||
XmlGridPickerCtrl::~XmlGridPickerCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
void XmlGridPickerCtrl::SetValue(const wxString& value)
|
||||
{
|
||||
if (value.IsEmpty())
|
||||
{
|
||||
m_value = EMPTY_DOC;
|
||||
BaseGridPicker::CreateGrid(); // +++
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
return;
|
||||
}
|
||||
m_value = value;
|
||||
BaseGridPicker::CreateGrid(); // +++
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
wxXmlDocument doc;
|
||||
wxXmlNode * root = XmlHelper::ValidateXmlValue(doc, m_value);
|
||||
if (root == NULL)
|
||||
{
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
return;
|
||||
}
|
||||
// Look for preferred
|
||||
wxXmlNode * row = root->GetChildren();
|
||||
while (row)
|
||||
{
|
||||
const wxString pref = row->GetAttribute(XML_ATTR_PREF);
|
||||
if (!pref.IsEmpty()
|
||||
&& pref != _T("0"))
|
||||
{
|
||||
GetTextCtrl()->SetValue(row->GetNodeContent());
|
||||
return;
|
||||
}
|
||||
row = row->GetNext();
|
||||
}
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
}
|
||||
|
||||
wxString XmlGridPickerCtrl::GetValue()
|
||||
{
|
||||
DumpGrid();
|
||||
|
||||
wxXmlDocument doc;
|
||||
wxXmlNode * root = new wxXmlNode(wxXML_ELEMENT_NODE, XML_ROOT_NAME);
|
||||
doc.SetRoot(root);
|
||||
wxString emptyXmlData;
|
||||
wxStringOutputStream sos(&emptyXmlData);
|
||||
doc.Save(sos);
|
||||
|
||||
if (m_value == emptyXmlData)
|
||||
return wxEmptyString;
|
||||
return m_value;
|
||||
}
|
||||
|
||||
void XmlGridPickerCtrl::FillGrid()
|
||||
{
|
||||
wxASSERT_MSG(m_grid != NULL, _("m_grid IS NULL"));
|
||||
wxXmlDocument doc;
|
||||
wxXmlNode * root = XmlHelper::ValidateXmlValue(doc, m_value);
|
||||
if (root == NULL)
|
||||
{
|
||||
GetTextCtrl()->SetValue(INVALID_INTENT);
|
||||
return;
|
||||
}
|
||||
wxXmlNode * row = root->GetChildren();
|
||||
int idx = 0;
|
||||
while (row)
|
||||
{
|
||||
m_grid->InsertRows(idx);
|
||||
m_grid->SetCellValue(idx, 0, row->GetNodeContent());
|
||||
m_grid->SetCellValue(idx, 1, row->GetAttribute(XML_ATTR_TYPE));
|
||||
m_grid->SetCellValue(idx, 2, row->GetAttribute(XML_ATTR_PREF));
|
||||
m_grid->SetCellValue(idx, 3, row->GetAttribute(XML_ATTR_NOTES));
|
||||
idx++;
|
||||
row = row->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
void XmlGridPickerCtrl::DumpGrid()
|
||||
{
|
||||
wxASSERT_MSG(m_grid != NULL, _("m_grid IS NULL"));
|
||||
wxASSERT_MSG(m_stringTable != NULL, _("m_stringTable IS NULL"));
|
||||
if (!m_editable || !m_stringTable || !m_grid)
|
||||
return;
|
||||
wxXmlDocument doc;
|
||||
// This is EMPTY_DOC
|
||||
wxXmlNode * root = new wxXmlNode(wxXML_ELEMENT_NODE, XML_ROOT_NAME);
|
||||
doc.SetRoot(root);
|
||||
for (uint grow = 0; grow < m_stringTable->GetRowsCount(); grow++)
|
||||
{
|
||||
if (m_stringTable->GetValue(grow, 0).IsEmpty())
|
||||
continue;
|
||||
/*
|
||||
* Don't use the other constructor :
|
||||
* wxXmlNode(wxXmlNode *parent, wxXmlNodeType type ...
|
||||
* The row order will be reversed each time.
|
||||
* Explicitly add independent nodes to root.
|
||||
*/
|
||||
wxXmlNode * row = new wxXmlNode(wxXML_ELEMENT_NODE, XML_ROW_NAME);
|
||||
wxXmlAttribute * attr = new wxXmlAttribute(XML_ATTR_TYPE, m_stringTable->GetValue(grow, 1));
|
||||
row->AddAttribute(attr);
|
||||
attr = new wxXmlAttribute(XML_ATTR_PREF, (m_stringTable->GetValue(grow, 2) == _T("0")
|
||||
|| m_stringTable->GetValue(grow, 2).IsEmpty()) ? _T("0") : _T("1"));
|
||||
row->AddAttribute(attr);
|
||||
attr = new wxXmlAttribute(XML_ATTR_NOTES, m_stringTable->GetValue(grow, 3));
|
||||
row->AddAttribute(attr);
|
||||
new wxXmlNode(row, wxXML_TEXT_NODE, _T("irrelevant_name"), m_stringTable->GetValue(grow, 0));
|
||||
root->AddChild(row);
|
||||
}
|
||||
wxString xmlData;
|
||||
wxStringOutputStream sos(&xmlData);
|
||||
bool res = doc.Save(sos);
|
||||
if (!res)
|
||||
{
|
||||
wxASSERT_MSG(res, _T("Error dumping to XML"));
|
||||
// Let's not empty m_value.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_value = xmlData; // May be empty XML with XML_ROOT_NAME tag only
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
66
L7/special/XmlGridPickerCtrl.h
Normal file
66
L7/special/XmlGridPickerCtrl.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* File: XmlGridPickerCtrl.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 14, 2019, 3:28 PM
|
||||
*/
|
||||
|
||||
#ifndef XMLGRIDPICKERCTRL_H
|
||||
#define XMLGRIDPICKERCTRL_H
|
||||
|
||||
#include "BaseGridPicker.h"
|
||||
#include <wx/xml/xml.h>
|
||||
|
||||
/**
|
||||
* The grid content is stored in an XML document.
|
||||
* @return
|
||||
*/
|
||||
class XmlGridPickerCtrl : public BaseGridPicker
|
||||
{
|
||||
DECLARE_CLASS(XmlGridPickerCtrl)
|
||||
public:
|
||||
XmlGridPickerCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxArrayString& types,
|
||||
wxSize popupSize = wxDefaultSize,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxPB_USE_TEXTCTRL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
virtual ~XmlGridPickerCtrl();
|
||||
|
||||
/**
|
||||
* Creates a new grid deleting the previous one and fills it with the XML
|
||||
* data.
|
||||
* @param value
|
||||
*/
|
||||
virtual void SetValue(const wxString& value);
|
||||
|
||||
/**
|
||||
* Dumps the grid content and returns it as an XML document. But returns
|
||||
* empty string if XML document is empty.
|
||||
* @return
|
||||
*/
|
||||
virtual wxString GetValue();
|
||||
private:
|
||||
/**
|
||||
* Parses the XML document and fills the grid.
|
||||
*/
|
||||
virtual void FillGrid();
|
||||
/**
|
||||
* Translates the grid content to an XML document.
|
||||
* If the Intent column is empty, this row is ignored.
|
||||
*/
|
||||
virtual void DumpGrid();
|
||||
/**
|
||||
* Is the XML document.
|
||||
*/
|
||||
wxString m_value;
|
||||
};
|
||||
|
||||
#endif /* XMLGRIDPICKERCTRL_H */
|
||||
|
||||
75
L7/special/XmlHelper.cpp
Normal file
75
L7/special/XmlHelper.cpp
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* File: XmlHelper.cpp
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 15, 2019, 4:13 PM
|
||||
*/
|
||||
|
||||
#include "XmlHelper.h"
|
||||
#include <wx/sstream.h>
|
||||
|
||||
XmlHelper::XmlHelper()
|
||||
{
|
||||
}
|
||||
|
||||
XmlHelper::~XmlHelper()
|
||||
{
|
||||
}
|
||||
|
||||
// if doc is declared with local scope, root elements are empty in caller
|
||||
|
||||
wxXmlNode* XmlHelper::ValidateXmlValue(wxXmlDocument& doc, const wxString& value)
|
||||
{
|
||||
// Avoid 'XML parsing error' message box.
|
||||
wxLogNull lognull;
|
||||
wxStringInputStream sis(value);
|
||||
bool res = doc.Load(sis);
|
||||
if (!res)
|
||||
{
|
||||
wxASSERT_MSG(res == true, _T("Can't load XML data.\n") + value);
|
||||
return NULL;
|
||||
}
|
||||
wxXmlNode * root = doc.GetRoot();
|
||||
if (root->GetName() != XML_ROOT_NAME)
|
||||
{
|
||||
wxASSERT_MSG(root->GetName() != XML_ROOT_NAME, _T("Bad XML data.\n") + value);
|
||||
return NULL;
|
||||
}
|
||||
// Check all rows and attributes
|
||||
wxXmlNode * row = root->GetChildren();
|
||||
while (row)
|
||||
{
|
||||
if (row->GetName() != XML_ROW_NAME
|
||||
|| !row->HasAttribute(XML_ATTR_TYPE)
|
||||
|| !row->HasAttribute(XML_ATTR_PREF)
|
||||
|| !row->HasAttribute(XML_ATTR_NOTES)
|
||||
|| row->GetNodeContent().IsEmpty())
|
||||
{
|
||||
wxASSERT_MSG(root->GetName() != XML_ROOT_NAME, _T("Unexpected XML data.\n") + value);
|
||||
return NULL;
|
||||
}
|
||||
row = row->GetNext();
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
wxString XmlHelper::GetIntent(const wxString& xmlData)
|
||||
{
|
||||
if (xmlData.IsEmpty())
|
||||
return wxEmptyString;
|
||||
wxXmlDocument doc;
|
||||
wxXmlNode * root = ValidateXmlValue(doc, xmlData);
|
||||
if (root == NULL)
|
||||
return wxEmptyString;
|
||||
wxXmlNode * row = root->GetChildren();
|
||||
while (row)
|
||||
{
|
||||
const wxString pref = row->GetAttribute(XML_ATTR_PREF);
|
||||
if (!pref.IsEmpty() && pref != _T("0"))
|
||||
return row->GetNodeContent();
|
||||
row = row->GetNext();
|
||||
}
|
||||
return wxEmptyString;
|
||||
}
|
||||
54
L7/special/XmlHelper.h
Normal file
54
L7/special/XmlHelper.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* File: XmlHelper.h
|
||||
* Author: SET - nmset@netcourrier.com
|
||||
* License : LGPL version 2.1
|
||||
* Copyright SET, M. D. - © 2014
|
||||
*
|
||||
* Created on December 15, 2019, 4:13 PM
|
||||
*/
|
||||
|
||||
#ifndef XMLHELPER_H
|
||||
#define XMLHELPER_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/xml/xml.h>
|
||||
|
||||
#define XML_ROOT_NAME _T("TABLE")
|
||||
#define XML_ROW_NAME _T("ROW")
|
||||
#define XML_ATTR_TYPE _T("Type")
|
||||
#define XML_ATTR_PREF _T("Preferred")
|
||||
#define XML_ATTR_NOTES _T("Notes")
|
||||
#define EMPTY_DOC _T("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<TABLE/>")
|
||||
|
||||
/**
|
||||
* Application helper to quickly get the Intent value.
|
||||
* @param doc
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
class XmlHelper
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Parses value which is XML data and returns the XML root node, while
|
||||
* loading the XML data in doc.
|
||||
* If value does not have the expected tags defined above, returns NULL.
|
||||
* @param doc
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
static wxXmlNode * ValidateXmlValue(wxXmlDocument& doc, const wxString& value);
|
||||
/**
|
||||
* Returns a valid Intent value or an empty string.
|
||||
* @param xmlData
|
||||
* @return
|
||||
*/
|
||||
static wxString GetIntent(const wxString& xmlData);
|
||||
private:
|
||||
XmlHelper();
|
||||
virtual ~XmlHelper();
|
||||
};
|
||||
|
||||
#endif /* XMLHELPER_H */
|
||||
|
||||
Reference in New Issue
Block a user