1998-03-28 05:44:41 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* NPL.
|
|
|
|
*
|
|
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Created 4/10/96 - Tim Craycroft
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CSpecialTableView.h"
|
|
|
|
#include "CKeyUpReceiver.h"
|
|
|
|
|
|
|
|
#include <LCommander.h>
|
|
|
|
#include <LListener.h>
|
|
|
|
//#include <QAP_Assist.h>
|
|
|
|
|
1998-06-23 01:21:28 +04:00
|
|
|
#include "NetscapeDragFlavors.h"
|
1998-03-28 05:44:41 +03:00
|
|
|
#include "LTableViewHeader.h"
|
|
|
|
// Need LTableHeader here, need the whole thing in the .cp file.
|
|
|
|
// Might as well go the whole hog.
|
|
|
|
|
|
|
|
class CStandardFlexTable;
|
|
|
|
class CClickTimer;
|
|
|
|
class CInlineEditField;
|
|
|
|
|
|
|
|
//========================================================================================
|
|
|
|
class CTableHeaderListener : public LListener
|
|
|
|
//========================================================================================
|
|
|
|
{
|
|
|
|
friend class CStandardFlexTable;
|
|
|
|
CTableHeaderListener(CStandardFlexTable* inTable) : mTable(inTable) {}
|
|
|
|
void ListenToMessage(MessageT inMessage, void *ioParam);
|
|
|
|
protected:
|
|
|
|
CStandardFlexTable* mTable;
|
|
|
|
}; // class CTableHeaderListener
|
|
|
|
|
|
|
|
|
|
|
|
class CInlineEditorListener : public LListener
|
|
|
|
{
|
|
|
|
public:
|
1998-06-23 01:21:28 +04:00
|
|
|
CInlineEditorListener( CStandardFlexTable* inTable ) : mTable(inTable) { }
|
1998-03-28 05:44:41 +03:00
|
|
|
protected:
|
|
|
|
void ListenToMessage(MessageT inMessage, void *ioParam);
|
|
|
|
CStandardFlexTable* mTable;
|
|
|
|
}; // class CInlineEditorListener
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================================
|
|
|
|
class CStandardFlexTable
|
|
|
|
// Base class of all our tables in Netscape. Differs from LTableView in the essential
|
|
|
|
// matter of allowing selection of an entire row only.
|
|
|
|
//========================================================================================
|
|
|
|
: public CSpecialTableView
|
|
|
|
, public LDragAndDrop
|
|
|
|
, public LCommander
|
|
|
|
, public LBroadcaster
|
|
|
|
, public CKeyUpReceiver
|
|
|
|
//, public CQAPartnerTableMixin
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
typedef CSpecialTableView Inherited;
|
|
|
|
friend class CTableHeaderListener;
|
|
|
|
friend class CClickTimer;
|
|
|
|
friend class CInlineEditorListener;
|
1998-06-23 01:21:28 +04:00
|
|
|
friend class CDeferredInlineEditTask;
|
1998-08-25 04:02:34 +04:00
|
|
|
friend class CTableToolTipPane;
|
1998-03-28 05:44:41 +03:00
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
class_ID = 'sfTb',
|
|
|
|
msg_SelectionChanged = 'selC'
|
|
|
|
};
|
1998-08-25 04:02:34 +04:00
|
|
|
struct TextDrawingStuff
|
|
|
|
{
|
|
|
|
TextDrawingStuff ( )
|
|
|
|
: mTextTraitsID(0), style(0), mode(0), encoding(eDefault)
|
|
|
|
{
|
|
|
|
color.red = color.green = color.blue = 0;
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Information is gathered in this struct for use by the table (and its
|
|
|
|
// derived classes) in drawing text within cells. It is also used by
|
|
|
|
// CTableTooltipPane, to make the font in the tooltips match that in the
|
|
|
|
// table cells.
|
|
|
|
// -------
|
|
|
|
// Tablewide stuff that does not get invalidated. Before 98/06/29 (Nova)
|
|
|
|
// these two fields were direct members of CStandardFlexTable.
|
|
|
|
ResIDT mTextTraitsID;
|
|
|
|
FontInfo mTextFontInfo;
|
|
|
|
// -------
|
|
|
|
// Cell-by-cell stuff that gets invalidated
|
|
|
|
enum { eDefault, eUTF8 } encoding;
|
|
|
|
char style;
|
|
|
|
int mode;
|
|
|
|
RGBColor color;
|
|
|
|
STableCell lastCell; // for caching
|
|
|
|
void Invalidate() { lastCell.row = lastCell.col = LArray::index_Bad; }
|
|
|
|
};
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
PaneIDT GetSortedColumn() const;
|
|
|
|
Boolean IsSortedBackwards() const;
|
|
|
|
LTableViewHeader* GetTableHeader() const { return mTableHeader; }
|
|
|
|
Boolean IsColumnVisible(PaneIDT inID);
|
|
|
|
TableIndexT GetSelectedRowCount() const;
|
|
|
|
virtual void SelectionChanged();
|
|
|
|
void AddAttachmentFirst(
|
|
|
|
LAttachment* inAttachment,
|
|
|
|
Boolean inOwnsAttachment = true);
|
|
|
|
// nb: AddAttachment adds at end. But this can be called if you want the new attachment
|
|
|
|
// to be executed before the existing ones.
|
|
|
|
virtual void SetNotifyOnSelectionChange(Boolean inDoNotify);
|
|
|
|
virtual Boolean GetNotifyOnSelectionChange();
|
|
|
|
void SetRightmostVisibleColumn(UInt16 inLastDesiredColumn);
|
1998-07-20 20:08:17 +04:00
|
|
|
virtual Boolean TableSupportsNaturalOrderSort() const;
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1998-04-09 00:29:54 +04:00
|
|
|
void DoInlineEditing ( const STableCell & inCell ) ;
|
1998-06-23 01:21:28 +04:00
|
|
|
// a public way to tell the table to begin an in-place edit. This is
|
|
|
|
// useful when handling menu commands, etc and not mouse clicks in the table.
|
1998-04-09 00:29:54 +04:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
protected:
|
1998-06-23 01:21:28 +04:00
|
|
|
enum {
|
|
|
|
kMinRowHeight = 18
|
|
|
|
, kDistanceFromIconToText = 5
|
|
|
|
, kDropIconWastedSpace = 4
|
|
|
|
, kIconMargin = 1
|
|
|
|
, kIndentPerLevel = 14
|
|
|
|
, kIconWidth = 16
|
|
|
|
};
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
// for in-place editing, give the CInlineEditor this paneID.
|
|
|
|
enum { paneID_InlineEdit = 'EDIT' } ;
|
|
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Construction
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
CStandardFlexTable(LStream *inStream);
|
|
|
|
virtual ~CStandardFlexTable();
|
|
|
|
virtual void SetUpTableHelpers();
|
|
|
|
virtual void SynchronizeColumnsWithHeader();
|
|
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Generic PowerPlant
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
virtual void FinishCreateSelf();
|
|
|
|
virtual void DrawSelf();
|
|
|
|
virtual Boolean HandleKeyPress(const EventRecord &inKeyEvent);
|
|
|
|
|
1998-06-23 01:21:28 +04:00
|
|
|
virtual void RefreshCellRange(
|
|
|
|
const STableCell &inTopLeft,
|
|
|
|
const STableCell &inBotRight); // Overridden to fix a bug in PP.
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual void Click(SMouseDownEvent &inMouseDown);
|
|
|
|
virtual void BeTarget();
|
|
|
|
virtual void DontBeTarget();
|
1998-06-23 01:21:28 +04:00
|
|
|
// ------------------------------------------------------------
|
|
|
|
// CEXTable Refugees
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
public:
|
|
|
|
void SelectScrollCell(const STableCell &inCell)
|
|
|
|
{
|
|
|
|
SelectCell(inCell);
|
|
|
|
ScrollCellIntoFrame(inCell);
|
|
|
|
}
|
|
|
|
|
|
|
|
void RefreshRowRange(TableIndexT inStartRow, TableIndexT inEndRow);
|
|
|
|
void ReadSavedTableStatus(LStream *inStatusData);
|
|
|
|
void WriteSavedTableStatus(LStream *outStatusData);
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Sorting
|
|
|
|
// ------------------------------------------------------------
|
1998-06-23 01:21:28 +04:00
|
|
|
protected:
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual void ChangeSort(const LTableHeader::SortChange* inSortChange);
|
|
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Selection, MouseDowns
|
|
|
|
// ------------------------------------------------------------
|
1998-06-23 01:21:28 +04:00
|
|
|
public:
|
|
|
|
void SetFancyDoubleClick(Boolean inFancy) { mFancyDoubleClick = inFancy; }
|
1998-08-24 23:52:47 +04:00
|
|
|
Uint16 ClickCountToOpen ( ) const { return mClickCountToOpen; }
|
|
|
|
void ClickCountToOpen ( Uint16 inCount );
|
1998-06-23 01:21:28 +04:00
|
|
|
|
|
|
|
protected:
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual Boolean ClickSelect(
|
|
|
|
const STableCell &inCell,
|
|
|
|
const SMouseDownEvent &inMouseDown);
|
1998-06-23 01:21:28 +04:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
|
1998-06-23 01:21:28 +04:00
|
|
|
|
|
|
|
Boolean HandleFancyDoubleClick(
|
|
|
|
const STableCell &inCell,
|
|
|
|
const SMouseDownEvent &inMouseDown);
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual Boolean ClickDropFlag(
|
|
|
|
const STableCell &inCell,
|
|
|
|
const SMouseDownEvent &inMouseDown);
|
|
|
|
virtual Boolean CellSelects(const STableCell& inCell) const;
|
1998-06-23 01:21:28 +04:00
|
|
|
virtual Boolean CellWantsClick( const STableCell & /*inCell*/ ) const { return false; }
|
1998-03-28 05:44:41 +03:00
|
|
|
void SetHiliteDisabled(Boolean inDisable) { mHiliteDisabled = inDisable; }
|
1998-06-23 01:21:28 +04:00
|
|
|
virtual void HandleSelectionTracking( const SMouseDownEvent & inMouseDown ) ;
|
|
|
|
virtual void TrackSelection( const SMouseDownEvent & inMouseDown ) ;
|
|
|
|
virtual Boolean HitCellHotSpot( const STableCell &inCell,
|
1998-03-28 05:44:41 +03:00
|
|
|
const Rect &inTotalSelectionRect ) ;
|
1998-06-23 01:21:28 +04:00
|
|
|
|
|
|
|
// the the cell rect in local coords even if scrolled out the the view
|
|
|
|
virtual void GetLocalCellRectAnywhere( const STableCell &inCell, Rect &outCellRect) const;
|
|
|
|
|
|
|
|
virtual void UnselectCellsNotInSelectionOutline( const Rect & selectionRect ) ;
|
1998-03-28 05:44:41 +03:00
|
|
|
// override to turn off selection outline tracking
|
1998-07-28 04:44:27 +04:00
|
|
|
virtual Boolean TableDesiresSelectionTracking( ) const { return true; }
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
virtual const TableIndexT* GetUpdatedSelectionList(TableIndexT& outSelectionSize);
|
|
|
|
// Returns a ONE-BASED list of TableIndexT, as it should.
|
|
|
|
// The result is const because this is not a copy, it is
|
|
|
|
// the actual list cached in this object. You probably want
|
|
|
|
// to use CMailFlexTable::GetSelection() for messages stuff.
|
|
|
|
public:
|
|
|
|
Boolean GetNextSelectedRow(TableIndexT& inOutAfterRow) const;
|
|
|
|
Boolean GetLastSelectedRow(TableIndexT& inOutBeforeRow) const;
|
1998-06-23 01:21:28 +04:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
protected:
|
|
|
|
void SelectRow(TableIndexT inRow);
|
|
|
|
void ScrollRowIntoFrame(TableIndexT inRow);
|
|
|
|
void ScrollSelectionIntoFrame();
|
|
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Drawing
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
public:
|
|
|
|
void HiliteRow(
|
|
|
|
TableIndexT inRow,
|
|
|
|
Boolean inHilite);
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// Why don't we just overload DoHilite() to take two different params? Because
|
|
|
|
// of the scoping rules of C++, if you override a name in one scope, say by a
|
|
|
|
// derived class, it hides all other versions of that name. As a result, if anyone
|
|
|
|
// overloaded DrawHilite() in a derived class, it would give a warning that we're
|
|
|
|
// hiding the other versions of DrawHilite(). This is bad.
|
|
|
|
virtual void DoHiliteRgn( RgnHandle inHiliteRgn ) const;
|
|
|
|
virtual void DoHiliteRect( const Rect & inHiliteRect ) const;
|
|
|
|
|
|
|
|
// override to do the right thing with what user types in in-place editor
|
|
|
|
virtual void InlineEditorTextChanged( ) { }
|
|
|
|
virtual void InlineEditorDone( ) { }
|
|
|
|
virtual void DoInlineEditing( const STableCell &inCell, Rect & inTextRect );
|
1998-07-28 04:44:27 +04:00
|
|
|
virtual Boolean CanDoInlineEditing( ) const { return true; }
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
virtual void DrawCell(
|
|
|
|
const STableCell &inCell,
|
|
|
|
const Rect &inLocalRect);
|
|
|
|
virtual void DrawCellContents(
|
|
|
|
const STableCell &inCell,
|
|
|
|
const Rect &inLocalRect);
|
1998-07-20 20:08:17 +04:00
|
|
|
virtual void EraseCellBackground(
|
|
|
|
const STableCell& inCell,
|
|
|
|
const Rect& inLocalRect);
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual void GetMainRowText(
|
|
|
|
TableIndexT inRow,
|
|
|
|
char* outText,
|
|
|
|
UInt16 inMaxBufferLength) const;
|
|
|
|
virtual UInt16 GetNestedLevel(TableIndexT /*inRow*/) const
|
|
|
|
{ return 0; /* default, no indentation */ }
|
|
|
|
|
|
|
|
virtual Boolean GetHiliteText(
|
|
|
|
TableIndexT inRow,
|
|
|
|
char* outText,
|
|
|
|
UInt16 inMaxBufferLength,
|
1998-08-25 04:02:34 +04:00
|
|
|
Boolean okIfRowHidden,
|
1998-03-28 05:44:41 +03:00
|
|
|
Rect* ioRect) const;
|
|
|
|
virtual Boolean GetHiliteTextRect(
|
|
|
|
const TableIndexT inRow,
|
1998-08-25 04:02:34 +04:00
|
|
|
Boolean okIfRowHidden,
|
1998-03-28 05:44:41 +03:00
|
|
|
Rect& outRect) const;
|
|
|
|
virtual void GetHiliteRgn(
|
|
|
|
RgnHandle ioHiliteRgn);
|
|
|
|
virtual ResIDT GetIconID(
|
|
|
|
TableIndexT /*inRow*/) const { return 0; }
|
|
|
|
virtual SInt16 DrawIcons(
|
|
|
|
const STableCell& inCell,
|
|
|
|
const Rect& inLocalRect) const; // don't override, use...
|
|
|
|
virtual void DrawIconsSelf(
|
|
|
|
const STableCell& inCell,
|
|
|
|
IconTransformType inTransformType,
|
|
|
|
const Rect& inIconRect) const;
|
|
|
|
virtual Boolean GetIconRect(
|
|
|
|
const STableCell& inCell,
|
|
|
|
const Rect& inLocalRect,
|
|
|
|
Rect& outRect) const;
|
|
|
|
virtual Boolean GetRowHiliteRgn(TableIndexT inRow, RgnHandle ioHiliteRgn) const;
|
|
|
|
virtual Boolean GetRowDragRgn(TableIndexT inRow, RgnHandle ioHiliteRgn) const;
|
1998-08-25 04:02:34 +04:00
|
|
|
virtual TextDrawingStuff& GetTextStyle(
|
|
|
|
const STableCell& inCell);
|
|
|
|
virtual void ApplyTextStyle(const STableCell& inCell) const;
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Row Expansion/Collapsing
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
protected:
|
|
|
|
virtual void SetCellExpansion(const STableCell& /* inCell */, Boolean /* inExpand */) {}
|
1998-06-23 01:21:28 +04:00
|
|
|
virtual Boolean CellHasDropFlag(const STableCell& /* inCell */, Boolean& /* outIsExpanded */) const { return false; }
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual Boolean CellInitiatesDrag(const STableCell& /* inCell */) const { return false; }
|
|
|
|
virtual void GetDropFlagRect( const Rect& inLocalCellRect,
|
|
|
|
Rect& outFlagRect) const;
|
|
|
|
virtual TableIndexT CountExtraRowsControlledByCell(const STableCell& inCell) const;
|
|
|
|
// return zero if there are none.
|
|
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Drag Support
|
|
|
|
// ------------------------------------------------------------
|
1998-06-23 01:21:28 +04:00
|
|
|
virtual OSErr DragSelection(
|
|
|
|
const STableCell& inCell,
|
|
|
|
const SMouseDownEvent &inMouseDown);
|
|
|
|
virtual OSErr DragRow(
|
|
|
|
TableIndexT inRow,
|
|
|
|
const SMouseDownEvent& inMouseDown);
|
|
|
|
virtual void AddSelectionToDrag(
|
|
|
|
DragReference inDragRef,
|
|
|
|
RgnHandle inDragRgn);
|
|
|
|
virtual void AddRowToDrag(
|
|
|
|
TableIndexT inRow,
|
|
|
|
DragReference inDragRef,
|
|
|
|
RgnHandle inDragRgn);
|
|
|
|
virtual void AddRowDataToDrag(
|
|
|
|
TableIndexT /* inRow */,
|
1998-03-28 05:44:41 +03:00
|
|
|
DragReference /* inDragRef */ ) {};
|
1998-07-20 20:08:17 +04:00
|
|
|
virtual void HiliteDropArea(DragReference inDragRef);
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual void InsideDropArea(DragReference inDragRef);
|
|
|
|
virtual void EnterDropArea(DragReference inDragRef, Boolean inDragHasLeftSender);
|
|
|
|
virtual void LeaveDropArea(DragReference inDragRef);
|
|
|
|
virtual Boolean PointInDropArea(Point inGlobalPt); // add slop for autoscroll
|
1998-08-25 04:02:34 +04:00
|
|
|
|
|
|
|
// Autoscroll support --------------------------------------
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual void ScrollImageBy(
|
|
|
|
Int32 inLeftDelta,
|
|
|
|
Int32 inTopDelta,
|
|
|
|
Boolean inRefresh);
|
|
|
|
// unhilite before and after.
|
1998-08-25 04:02:34 +04:00
|
|
|
|
|
|
|
// Utility routines for supporting autoscroll routines ------
|
|
|
|
void StartAutoScroll();
|
|
|
|
void EndAutoScroll();
|
|
|
|
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
// Specials
|
|
|
|
virtual void HiliteDropRow(TableIndexT inRow, Boolean inDrawBarAbove);
|
|
|
|
virtual TableIndexT GetHiliteColumn() const;
|
|
|
|
virtual Boolean RowCanAcceptDrop(
|
|
|
|
DragReference inDragRef,
|
|
|
|
TableIndexT inDropRow);
|
|
|
|
virtual Boolean RowCanAcceptDropBetweenAbove(
|
|
|
|
DragReference inDragRef,
|
|
|
|
TableIndexT inDropRow);
|
1998-06-23 01:21:28 +04:00
|
|
|
virtual Boolean RowIsContainer(
|
|
|
|
const TableIndexT & /* inRow */ ) const { return false; }
|
1998-08-29 00:32:00 +04:00
|
|
|
virtual Boolean RowIsContainer(
|
|
|
|
const TableIndexT & /* inRow */, Boolean* /*outIsExpanded*/ ) const ;
|
1998-06-23 01:21:28 +04:00
|
|
|
void ComputeItemDropAreas(
|
|
|
|
const Rect& inLocalCellRect,
|
|
|
|
Rect& outTop,
|
|
|
|
Rect& outBottom );
|
|
|
|
void ComputeFolderDropAreas(
|
|
|
|
const Rect & inLocalCellRect,
|
|
|
|
Rect& outTop,
|
|
|
|
Rect& outBottom );
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1998-08-25 04:02:34 +04:00
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Tooltip support
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
virtual void CalcToolTipText(
|
|
|
|
const STableCell& inCell,
|
|
|
|
StringPtr outText,
|
|
|
|
TextDrawingStuff& outStuff,
|
|
|
|
Boolean& outTruncationOnly);
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Miscellany
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
PaneIDT GetCellDataType(const STableCell &inCell) const;
|
|
|
|
void ListenToHeaderMessage(MessageT inMessage, void *ioParam)
|
|
|
|
{ mTableHeaderListener.ListenToMessage(inMessage, ioParam); }
|
|
|
|
|
|
|
|
void SetTextTraits(ResIDT inmTextTraitsID);
|
|
|
|
|
|
|
|
//-----------------------------------
|
|
|
|
// Commands
|
|
|
|
//-----------------------------------
|
|
|
|
protected:
|
|
|
|
virtual void FindCommandStatus(
|
|
|
|
CommandT inCommand,
|
|
|
|
Boolean &outEnabled,
|
|
|
|
Boolean &outUsesMark,
|
|
|
|
Char16 &outMark,
|
|
|
|
Str255 outName);
|
|
|
|
virtual Boolean ObeyCommand(
|
|
|
|
CommandT inCommand,
|
|
|
|
void *ioParam);
|
|
|
|
|
1998-08-25 04:02:34 +04:00
|
|
|
virtual void DeleteSelection(const EventRecord& inMacEvent) = 0;
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual void OpenRow(TableIndexT /* inRow */) {}
|
|
|
|
virtual void GetInfo();
|
|
|
|
|
|
|
|
public:
|
1998-08-25 04:02:34 +04:00
|
|
|
virtual void OpenClick( const STableCell& inCell );
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual void OpenSelection();
|
|
|
|
|
|
|
|
// stuff that should go away, moved into a utility class
|
|
|
|
|
|
|
|
static void DrawIconFamily( ResIDT inIconID,
|
|
|
|
SInt16 inIconWidth,
|
|
|
|
SInt16 inIconHeight,
|
|
|
|
IconTransformType inTransform,
|
|
|
|
const Rect& inBounds);
|
|
|
|
|
|
|
|
static void DrawTextString( const char* inText,
|
1998-08-26 00:23:47 +04:00
|
|
|
const TextDrawingStuff & inTextInfo,
|
1998-03-28 05:44:41 +03:00
|
|
|
SInt16 inMargin,
|
|
|
|
const Rect& inBounds,
|
|
|
|
SInt16 inJustification = teFlushLeft,
|
|
|
|
Boolean doTruncate = true,
|
|
|
|
TruncCode truncWhere = truncMiddle);
|
|
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
// QA Partner support
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
#if defined(QAP_BUILD)
|
|
|
|
public:
|
1998-06-23 01:21:28 +04:00
|
|
|
virtual void QapGetListInfo(PQAPLISTINFO pInfo);
|
1998-03-28 05:44:41 +03:00
|
|
|
virtual Ptr QapAddCellToBuf(Ptr pBuf, Ptr pLimit, const STableCell& sTblCell);
|
|
|
|
virtual void GetQapRowText(TableIndexT inRow, char* outText, UInt16 inMaxBufferLength) const;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//-----------------------------------
|
|
|
|
// Data
|
|
|
|
//-----------------------------------
|
|
|
|
protected:
|
|
|
|
CTableHeaderListener mTableHeaderListener;
|
|
|
|
PaneIDT mTableHeaderPaneID;
|
|
|
|
LTableViewHeader* mTableHeader;
|
|
|
|
Int16 mClickCountToOpen;
|
|
|
|
TableIndexT* mSelectionList;
|
|
|
|
CClickTimer* mClickTimer;
|
|
|
|
Boolean mFancyDoubleClick;
|
|
|
|
Boolean mHiliteDisabled;
|
|
|
|
|
|
|
|
// support for dragging, including dragging rows to new positions
|
|
|
|
TableIndexT mDropRow;
|
|
|
|
RGBColor mDropColor;
|
|
|
|
Boolean mIsInternalDrop; // a drop of one row on another ?
|
|
|
|
Boolean mIsDropBetweenRows; // changing order
|
1998-06-23 01:21:28 +04:00
|
|
|
Boolean mAllowDropAfterLastRow; // true to allow drops in the whitespace after the table
|
1998-07-20 20:08:17 +04:00
|
|
|
Boolean mInlineFeedbackOn; // do we draw the inline feedback or frame entire area?
|
|
|
|
|
1998-08-25 04:02:34 +04:00
|
|
|
Boolean mAllowAutoExpand;
|
|
|
|
UInt32 mTimeToExpandForDrop;
|
1998-03-28 05:44:41 +03:00
|
|
|
CInlineEditField* mNameEditor; // used for inline editing
|
|
|
|
TableIndexT mRowBeingEdited;
|
|
|
|
CInlineEditorListener mInlineListener; // listens to the editor and tells us things
|
1998-08-25 04:02:34 +04:00
|
|
|
TextDrawingStuff mTextDrawingStuff;
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
}; // class CStandardFlexTable
|