// =========================================================================== // CSimlabListRec.cp // ©1995 J. Rodden, DD/MF & Associates. All rights reserved // =========================================================================== #include "CSimlabListRec.h" const short kTextHOffset = 7; const short kTextVOffset = 12; //---------------------------------------------------------------------------- // € CSimlabListRec //---------------------------------------------------------------------------- CSimlabListRec::CSimlabListRec( SimlabListTag inTag, ConstStr255Param inString) { tag = inTag; CopyPStr( inString, name); } //---------------------------------------------------------------------------- // € GetTag //---------------------------------------------------------------------------- SimlabListTag CSimlabListRec::GetTag() { return tag; } //---------------------------------------------------------------------------- // € GetDescriptor //---------------------------------------------------------------------------- void CSimlabListRec::GetDescriptor(Str255 outDescriptor) { CopyPStr( name, outDescriptor); } //---------------------------------------------------------------------------- // € Draw //---------------------------------------------------------------------------- void CSimlabListRec::Draw(Rect *lRect) { ::EraseRect(lRect); ::MoveTo (lRect->left + kTextHOffset, lRect->top + kTextVOffset); short maxWidth = lRect->right - (lRect->left + kTextHOffset) - kTextSelSlop; short i; for ( i = name[0] ; i > 0 && ::TextWidth( name, 1, i) > maxWidth ; i-- ) ; ::DrawText( name, 1, i); ::TextFace(normal); }