home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-10 | 1.8 KB | 92 lines | [TEXT/CWIE] |
- // LStrTableView
- // simple subclass of LTableView, that just draws strings
- // ©1995 A.D. Software, all rights reserved
- // freely licensed for any use
- // contact dent@highway1.com.au or http://www.highway1.com.au/adsoftware/
-
- #include "LStrTableView.h"
-
- #pragma mark --- Construction/Destruction ---
-
- LStrTableView*
- LStrTableView::CreateStrTableViewStream(
- LStream *inStream)
- {
- return (new LStrTableView(inStream));
- }
-
-
- LStrTableView::LStrTableView(
- const SPaneInfo &inPaneInfo,
- const SViewInfo &inViewInfo,
- LTableGeometry *inTableGeometry,
- LTableSelector *inTableSelector,
- LTableStorage *inTableStorage) :
- LTableView(inPaneInfo,inViewInfo,inTableGeometry,inTableSelector,inTableStorage)
- {
- }
-
-
- LStrTableView::LStrTableView(
- LStream *inStream) :
- LTableView(inStream)
- {
- }
-
-
- MessageT
- LStrTableView::GetDoubleClickMessage() const
- {
- return mDoubleClickMessage;
- }
-
-
- // Specify the message broadcasted when a cell is double-clicked
- void
- LStrTableView::SetDoubleClickMessage(
- MessageT inMessage)
- {
- mDoubleClickMessage = inMessage;
- }
-
-
-
-
- #pragma mark --- Clicking ---
-
- void
- LStrTableView::ClickCell(
- const STableCell& /* inCell */,
- const SMouseDownEvent& /* inMouseDown */)
- {
- if (GetClickCount() > 1)
- BroadcastMessage(mDoubleClickMessage, this);
- }
-
-
- #pragma mark --- Drawing ---
-
- void
- LStrTableView::DrawCell(
- const STableCell &inCell,
- const Rect &inLocalRect)
- {
- Uint32 dataSize = 17; // crude way to get clipping
- char* theStr = new char[dataSize];
- GetCellData(inCell, theStr, dataSize);
- /* ResIDT textTraitsID = mLeafTextTraits;
- if (mCollapsableTree->IsCollapsable(woRow)) {
- textTraitsID = mParentTextTraits;
- }
- UTextTraits::SetPortTextTraits(textTraitsID);
- */
- // HORRIBLE HACK FOR NOW
- ::TextFont(applFont);
- ::TextSize(9);
-
- ::MoveTo(inLocalRect.left, inLocalRect.bottom - 4);
- ::DrawText(theStr, 0, dataSize);
- delete[] theStr;
- }
-
-