Accounting Software
Small Business Software Estimating Software
Time Tracking SoftwareTime Management SoftwareTime Billing SoftwareContact Management SoftwareCustomer Management SoftwareProject Management SoftwareBusiness Management Software

Register Tables (Source Code)

Link to: header | tables directory

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

Comments

CRegisterTable

This class manages register breakdown tables for the Goldenseal estimating software,
small business management software, construction project management software and
construction estimating software.

a breakdown table is used for register view. It shows one object per row rather
than one breakdown entry.

We have not yet figured out an effective way to show registers within
our current editor windows, so this class is not yet used. The problem
is that most objects have more data than can fit in a single data row.
We'll either have to use a "mini-layout" format (and not use a table at
all for the register view), or else allow data for one object to appear
on more than one row (which makes row titling weird).

We also can't use the same table-in-layout format as we do in regular
breakdown tables, since that results in a second scrolling control which
is not very intuitive (what does the "outer" control do then?).

Many users request registers but is has proved to be very difficult.

SUPERCLASS = CBreakdownTable

Constructor

/*********************************************************************************
constructor
*********************************************************************************/
CRegisterTable::CRegisterTable(const SPaneInfo &inPaneInfo,
const SViewInfo &inViewInfo,
DB_ClassDescriptor *desc)
: THE_SUPERCLASS(inPaneInfo, inViewInfo, desc)
{
mRecordViewer = nil;
mEditor = nil;
mEditorTitleBar = nil;
}

Source Code

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

GetColType TCS 11/16/00

return the column type for the given member column. We use a very different
system from the superclass

*********************************************************************************/
SInt32 CRegisterTable::GetColType(const SMemberInfo &memberInfo) const
{
// can we edit this column?
Boolean canEdit = CAN_EDIT_MEMBER(memberInfo);

switch (memberInfo.type)
{
case type_objectid:
if (canEdit)
return coltype_cv;
else
return coltype_lookup;
break;

case type_enum:
if (canEdit)
return coltype_menucv;
else
return coltype_menulookup;
break;

case type_cstring:
case type_number:
case type_money:
case type_percent:
case type_emoney:
case type_long:
case type_short:
case type_boolean:
case type_date:
case type_time:
case type_timeonly:
if (canEdit)
return coltype_edit;
else
return coltype_caption;
break;

default:
TCS_DebugAlert("Oops, bad case in CRegisterTable::GetColType!");
return 0;
break;
}
}
/*********************************************************************************

CanChangeRow TCS 11/16/00

can we change a row? Here's where we save data for the selected object

*********************************************************************************/
Boolean CRegisterTable::CanChangeRow() const
{
TCS_FailNILMsg(mEditor, TCS_GetErrString(errID_BadEditor));
return mEditor->CanChangeRegisterRow();
}
/*********************************************************************************

PrepareToChangeRow TCS 11/16/00

we can change the row- let's update the browser

*********************************************************************************/
void CRegisterTable::PrepareToChangeRow() const
{
TCS_FailNILMsg(mEditor, TCS_GetErrString(errID_BadEditor));
mEditor->HandleRegisterChanged(GetClickedRow());
}
/*********************************************************************************

HandleReturnKey TCS 11/17/00

handle the return or enter key being pressed. We override to prevent
new rows from being added.

*********************************************************************************/
Boolean CRegisterTable::HandleReturnKey()
{
if (SelectedRow() == LastRow())
{
TCS_SysBeep();
return true;
}
else
return THE_SUPERCLASS::HandleReturnKey();
}
/******************************************************************************

AdaptToSuperScroll

Handle scrolling. If horizontal, we override to also move the title bar

*******************************************************************************/
void CRegisterTable::AdaptToSuperScroll(SInt32 inLeftDelta, SInt32 inTopDelta)
{
THE_SUPERCLASS::AdaptToSuperScroll(inLeftDelta, inTopDelta);

if (mEditorTitleBar && inLeftDelta != 0)
{
mEditorTitleBar->AdaptToSuperScroll(inLeftDelta, inTopDelta);
}
}