Link to: source code | other
interface directory
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
This class manages border specifications for the
Goldenseal estimating software,
project management software, construction
estimating software
and construction project estimating software.
class CBorderInfo
{
public:
static void DrawBorder(const TCS_Rect &area, const PatternIndexT patIndex = cSolidPattern,
const ColorIndexT colorIndex = cBlackColorIndex,
const Boolean hasTop = true, const Boolean hasLeft = true,
const Boolean hasBottom = true, const Boolean hasRight = true,
const SInt32 pensize = 1);
CBorderInfo(const Boolean hasTop = true, const Boolean hasLeft = true,
const Boolean hasBottom = true, const Boolean hasRight = true);
CBorderInfo(const UInt8 borderInfo) { SetRawInfo(borderInfo); }
CBorderInfo(const CBorderInfo &inInfo) { SetRawInfo(inInfo.GetRawInfo()); }
Boolean HasTop() const { return mHasTop; }
Boolean HasLeft() const { return mHasLeft; }
Boolean HasBottom() const { return mHasBottom; }
Boolean HasRight() const { return mHasRight; }
void SetHasTop(Boolean hasIt) { mHasTop = hasIt; }
void SetHasLeft(Boolean hasIt) { mHasLeft = hasIt; }
void SetHasBottom(Boolean hasIt) { mHasBottom = hasIt; }
void SetHasRight(Boolean hasIt) { mHasRight = hasIt; }
void SetHasBorders(Boolean hasIt)
{
SetHasTop(hasIt);
SetHasLeft(hasIt);
SetHasBottom(hasIt);
SetHasRight(hasIt);
}
UInt8 GetRawInfo() const;
void SetRawInfo(const UInt8 rawInfo);
void Draw(const TCS_Rect &area, const SInt32 pensize = 1);
void ReadFromStream(CInputStream &stream);
void WriteToStream(COutputStream &stream);
private:
#if TCS_FOR_MAC
UInt8 mHasTop:1,
mHasLeft:1,
mHasBottom:1,
mHasRight:1,
mUnused:4;
#elif TCS_FOR_WINDOWS
// mfs_kk 12jun2k2
// For Windows we've reversed the field order.
// As in windows Bit fields have memory reverse
// to that in case of Mac.
UInt8 mUnused:4,
mHasRight:1,
mHasBottom:1,
mHasLeft:1,
mHasTop:1;
#endif
}; |