Accounting Software
Small Business Software Estimating Software
Project Management SoftwareProject Estimating SoftwareProject Tracking SoftwareInventory Tracking SoftwareCustomer Tracking SoftwareCustomer Management SoftwareBusiness Management Software

Database Contents Report (Source Code)

Link to: header | other interface directory

Copyright Turtle Creek Software 1996-2006. All Rights Reserved.

Comments

CDBContentsWindow

This class manages the database contents report for the Goldenseal accounting software,
project management software, construction accounting software
and construction project estimating software.

It's a window which shows database contents in file order.

SUPERCLASS = CDBReportWindow

Constructor

/*********************************************************************************
constructor TCS 9/15/02
*********************************************************************************/
CDBContentsWindow::CDBContentsWindow(LStream *inStream)
: THE_SUPERCLASS(inStream)
{
mWindowID = WIND_DatabaseContents;
}

Source Code

/*********************************************************************************

RefreshTable TCS 9/15/02

fill data into the report table.

*********************************************************************************/
void CDBContentsWindow::RefreshTable()
{
TCS_FailNILMsg(mObjectTable, TCS_GetErrString(errID_BadTable));

mObjectTable->FillObjectOrder(true);

mObjectTable->Refresh();
}
/*********************************************************************************

ListenToMessage TCS 9/15/02

respond to a message sent by one of this object's broadcasters

*********************************************************************************/
void CDBContentsWindow::ListenToMessage(MessageT inMessage, void *ioParam)
{
switch (inMessage)
{
case msg_TableDoubleClicked:
if (mObjectTable)
{
TableIndexT row = mObjectTable->GetClickedRow();
SFullObjectInfo info = mObjectTable->GetRowObjectInfo(row);

DoObjectDialog(info.classID, info.itemID);

return; // don't pass it along
}
break;

default:
break;
}

// better pass it along
THE_SUPERCLASS::ListenToMessage(inMessage, ioParam);
}
/*********************************************************************************

PrepareObjectTable TCS split 9/15/02

set up the report table

*********************************************************************************/
void CDBContentsWindow::PrepareObjectTable()
{
TCS_FailNILMsg(mObjectTable, TCS_GetErrString(errID_BadTable));

// set some basic info about the report
DB_ClassDescriptor *desc =
DB_ClassDescriptor::GetClassDescriptor(id_PersistentObject);
mObjectTable->SetClassDescriptor(desc);

mObjectTable->SetNumCols(6);
mObjectTable->SetTableType(table_filecontents);

// set the column widths
mObjectTable->SetColWidth(1, 140, cDontRedraw); // object name
mObjectTable->SetColWidth(2, 60, cDontRedraw); // object ID
mObjectTable->SetColWidth(3, 136, cDontRedraw); // class name
mObjectTable->SetColWidth(4, 60, cDontRedraw); // class ID
mObjectTable->SetColWidth(5, 80, cDontRedraw); // file location
mObjectTable->SetColWidth(6, 50, cDontRedraw); // object size

// add column information
SLETableColInfo colInfo;
colInfo.textInfo = CTCS_TextInfo::sDefaultTextInfo;
colInfo.tag = tag_menuname;
mObjectTable->AppendColInfo(colInfo);
colInfo.tag = tag_objectid;
mObjectTable->AppendColInfo(colInfo);
colInfo.tag = tag_classname;
mObjectTable->AppendColInfo(colInfo);
colInfo.tag = tag_classid;
mObjectTable->AppendColInfo(colInfo);
colInfo.tag = tag_filemark;
mObjectTable->AppendColInfo(colInfo);
colInfo.tag = tag_objectsize;
mObjectTable->AppendColInfo(colInfo);

mObjectTable->SetAltColorRows(cLightBlueColor, 3);

// set the table title bar (must be after column widths)
if (mTableTitleBar)
mTableTitleBar->SetTable(mObjectTable);

RefreshTable();
}