// Name: dbgrid.cpp
// Purpose: Displays a wxDbTable in a wxGrid.
// Author: Roger Gammans, Paul Gammans
// Name: dbgrid.cpp
// Purpose: Displays a wxDbTable in a wxGrid.
// Author: Roger Gammans, Paul Gammans
// RCS-ID: $Id$
// Copyright: (c) 1999 The Computer Surgery (roger@computer-surgery.co.uk)
// Licence: wxWindows licence
// RCS-ID: $Id$
// Copyright: (c) 1999 The Computer Surgery (roger@computer-surgery.co.uk)
// Licence: wxWindows licence
wxDbGridTableBase::wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo* ColInfo,
int count, bool takeOwnership) :
wxDbGridTableBase::wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo* ColInfo,
int count, bool takeOwnership) :
//FIXME: should i remove m_ColInfo and m_data from m_attrProvider if a wxDbGridAttrProvider
// if ((provider = dynamic_cast<wxDbGridCellAttrProvider *>(GetAttrProvider())))
// Using C casting for now until we can support dynamic_cast with wxWindows
//FIXME: should i remove m_ColInfo and m_data from m_attrProvider if a wxDbGridAttrProvider
// if ((provider = dynamic_cast<wxDbGridCellAttrProvider *>(GetAttrProvider())))
// Using C casting for now until we can support dynamic_cast with wxWindows
// use the default attr provider by default
SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo));
}
// use the default attr provider by default
SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo));
}
// if ((provider = dynamic_cast<wxDbGridCellAttrProvider *> (GetAttrProvider())))
// Using C casting for now until we can support dynamic_cast with wxWindows
// if ((provider = dynamic_cast<wxDbGridCellAttrProvider *> (GetAttrProvider())))
// Using C casting for now until we can support dynamic_cast with wxWindows
- //If a virtual column then we can't find it's type. we have to
- // return false to get using wxVariant.
- return false;
+ //If a virtual column then we can't find it's type. we have to
+ // return FALSE to get using wxVariant.
+ return FALSE;
(sqltype == SQL_C_SLONG) ||
(sqltype == SQL_C_ULONG) ||
(sqltype == SQL_C_FLOAT) ||
(sqltype == SQL_C_DOUBLE))
{
(sqltype == SQL_C_SLONG) ||
(sqltype == SQL_C_ULONG) ||
(sqltype == SQL_C_FLOAT) ||
(sqltype == SQL_C_DOUBLE))
{
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
if (typeName == wxGRID_VALUE_DATETIME)
{
if ((sqltype == SQL_C_DATE) ||
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
if (typeName == wxGRID_VALUE_DATETIME)
{
if ((sqltype == SQL_C_DATE) ||
(sqltype == SQL_C_SLONG) ||
(sqltype == SQL_C_ULONG) ||
(sqltype == SQL_C_FLOAT) ||
(sqltype == SQL_C_DOUBLE))
{
(sqltype == SQL_C_SLONG) ||
(sqltype == SQL_C_ULONG) ||
(sqltype == SQL_C_FLOAT) ||
(sqltype == SQL_C_DOUBLE))
{
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
if ((sqltype == SQL_C_SSHORT) ||
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
if ((sqltype == SQL_C_SSHORT) ||
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
if ((sqltype == SQL_C_SSHORT) ||
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
if ((sqltype == SQL_C_SSHORT) ||
(sqltype == SQL_C_SLONG) ||
(sqltype == SQL_C_ULONG) ||
(sqltype == SQL_C_FLOAT) ||
(sqltype == SQL_C_SLONG) ||
(sqltype == SQL_C_ULONG) ||
(sqltype == SQL_C_FLOAT) ||
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
if ((sqltype == SQL_C_SSHORT) ||
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
if ((sqltype == SQL_C_SSHORT) ||
{
wxLogDebug(wxT("GetValueAsCustom() on %i,%i"),row,col);
ValidateRow(row);
{
wxLogDebug(wxT("GetValueAsCustom() on %i,%i"),row,col);
ValidateRow(row);
if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol)
{
wxFAIL_MSG (_T("You can not use GetValueAsCustom for virtual columns"));
if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol)
{
wxFAIL_MSG (_T("You can not use GetValueAsCustom for virtual columns"));
wxString wxDbGridTableBase::GetValue(int row, int col)
{
wxLogDebug(wxT("GetValue() on %i,%i"),row,col);
wxString wxDbGridTableBase::GetValue(int row, int col)
{
wxLogDebug(wxT("GetValue() on %i,%i"),row,col);
ValidateRow(row);
wxVariant val = m_data->GetCol(m_ColInfo[col].DbCol);
wxLogDebug(wxT("\tReturning \"%s\"\n"),val.GetString().c_str());
ValidateRow(row);
wxVariant val = m_data->GetCol(m_ColInfo[col].DbCol);
wxLogDebug(wxT("\tReturning \"%s\"\n"),val.GetString().c_str());