564 lines
21 KiB
C++
564 lines
21 KiB
C++
#ifndef __DBGRIDSHEET_H
|
||
#define __DBGRIDSHEET_H
|
||
|
||
#include "dlist.h"
|
||
#include "AecEntity.h"
|
||
|
||
class AecDbText;
|
||
|
||
|
||
#define OF_HORMODE 0x01
|
||
#define OF_VERMODE 0x02
|
||
#define OF_TEXTSTYLE 0x04
|
||
#define OF_TEXTCOLOR 0x08
|
||
#define OF_TEXTWRAP 0x10
|
||
#define OF_LINESPACE 0x20
|
||
#define OF_TEXTHEIGHT 0x40
|
||
|
||
//////////////////////////////////////
|
||
// 表格的方格样式
|
||
class GEOAPI TGridStyle {
|
||
friend class AecDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
public:
|
||
enum TextDirection{kRight,kUp,kDown};
|
||
protected:
|
||
Adesk::UInt8 m_nOverride; //override parent's style
|
||
AcDb::TextHorzMode m_nHorMode; //水平对齐
|
||
AcDb::TextVertMode m_nVerMode; //垂直对齐
|
||
//XExplodeDraw::TextAlignment m_nAlignment; // Specifies the horizontal text alignment
|
||
AcDbHardPointerId m_idTextStyle; // Font
|
||
Adesk::UInt16 m_nTextColor; // Controls the foreground(Text) color
|
||
Adesk::UInt8 m_bTextWrap; // Word wraps cell text when true
|
||
double m_nLineSpaceFactor; //自动换行时的行距系数(行距=系数*字高)
|
||
double m_nTextHeight; //文字高度
|
||
|
||
//AEC7
|
||
TextDirection m_nTextDirection;
|
||
public:
|
||
TGridStyle();
|
||
TGridStyle(const TGridStyle &src);
|
||
TGridStyle & operator = (const TGridStyle &src);
|
||
Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
void SetOverrideAll(BOOL bTrue);
|
||
void SetFlagBit(int nFlag, BOOL bSet=TRUE);
|
||
void SetTextStyleId(AcDbObjectId id);
|
||
void SetTextColor(Adesk::UInt16 nColor);
|
||
void SetTextWrap(BOOL bTrue);
|
||
void SetLineSpaceFactor(double nFactor);
|
||
void SetTextHeight(double h);
|
||
void SetVerMode(AcDb::TextVertMode nVerMode);
|
||
void SetHorMode(AcDb::TextHorzMode nHorMode);
|
||
|
||
BOOL TestFlagBit(int nFlag) const;
|
||
AcDbObjectId GetTextStyleId() const;
|
||
Adesk::UInt16 GetTextColor() const;
|
||
BOOL IsTextWrap() const;
|
||
double GetLineSpaceFactor() const;
|
||
double GetTextHeight() const;
|
||
AcDb::TextHorzMode GetHorMode() const;
|
||
AcDb::TextVertMode GetVerMode() const;
|
||
};
|
||
|
||
/////////////////////////////////////////////////////
|
||
// 表格的分格线风格
|
||
class GEOAPI TDividerStyle { //行间线或列间线的样式
|
||
friend class AecDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
public:
|
||
enum TDividerFlag {
|
||
kNone=0, //没有分界线
|
||
kLocal=1, //自己的
|
||
kParent=2, //继承的
|
||
};
|
||
|
||
TDividerFlag m_nFlag;
|
||
Adesk::UInt16 m_nColor;
|
||
AcDbHardPointerId m_idLineType; //线型
|
||
double m_nLineWidth; //线宽
|
||
public:
|
||
TDividerStyle();
|
||
TDividerStyle(const TDividerStyle &src);
|
||
TDividerStyle & operator= (const TDividerStyle &src);
|
||
Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
TDividerFlag GetDividerFlag() const;
|
||
double GetLineWidth() const;
|
||
AcDbObjectId GetLineTypeId() const;
|
||
Adesk::UInt16 GetColor() const;
|
||
|
||
void SetDividerFlag(TDividerFlag flag);
|
||
void SetLineWidth(double nWidth);
|
||
void SetLineTypeId(AcDbObjectId id);
|
||
void SetColor(Adesk::UInt16 nColor);
|
||
};
|
||
|
||
///////////////////////////////////////////////
|
||
// 表格的列性质
|
||
class GEOAPI TSheetColumn {
|
||
friend class AecDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
TGridStyle m_gridStyle; //垂直对齐无效
|
||
TDividerStyle m_divider; // Divider style for right column border
|
||
Adesk::UInt8 m_bAllowSizing; // Enables interactive resizing for a column
|
||
double m_nWidth; //in Paper Unit
|
||
public:
|
||
TSheetColumn();
|
||
TSheetColumn(const TSheetColumn &src);
|
||
TSheetColumn & operator= (const TSheetColumn &src);
|
||
BOOL IsValid() const;
|
||
Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
|
||
const TDividerStyle & GetDividerStyle() const;
|
||
TDividerStyle & GetDividerStyle();
|
||
const TGridStyle & GetGridStyle() const;
|
||
TGridStyle & GetGridStyle();
|
||
void SetDividerStyle(const TDividerStyle &style);
|
||
void SetGridStyle(const TGridStyle &style);
|
||
|
||
double GetWidth() const; //图纸单位
|
||
BOOL AllowSizing() const;
|
||
void SetWidth(double w); //图纸单位
|
||
void SetAllowSizing(BOOL bTrue);
|
||
};
|
||
|
||
//////////////////////////////////////
|
||
// 表格的行性质
|
||
class GEOAPI TSheetRow {
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
public:
|
||
enum TRowHeightStyle {
|
||
kFixed=0, //采用固定行高, m_nHeight有效
|
||
kAtLeast=1, //不允许调整小于表格的默认行高, m_nHeight有效
|
||
kFree=2, //自由调整, m_nHeight有效
|
||
kAutomatic=3, //自动根据文字确定高度, 最小不小于表格默认行高度, m_nHeight有效
|
||
kParent=4, //采用继承下来的行高, m_nHeight无效
|
||
};
|
||
|
||
TDividerStyle m_divider; // Divider style for right column border
|
||
TRowHeightStyle m_nHeightFlag; // Enables interactive resizing for row
|
||
double m_nHeight; //in Paper Unit
|
||
AcDb::TextVertMode m_nVerMode; //垂直对齐, 0--为继承
|
||
public:
|
||
TSheetRow();
|
||
TSheetRow(const TSheetRow &src);
|
||
TSheetRow & operator= (const TSheetRow &src);
|
||
Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
|
||
AcDb::TextVertMode GetVerMode() const;
|
||
double GetHeight() const;
|
||
TRowHeightStyle GetRowHeightStyle() const;
|
||
const TDividerStyle & GetDividerStyle() const;
|
||
TDividerStyle &GetDividerStyle();
|
||
|
||
void SetHeight(double h);
|
||
void SetDividerStyle(const TDividerStyle ÷r);
|
||
void SetRowHeightStyle(TRowHeightStyle st);
|
||
void SetVerMode(AcDb::TextVertMode nVerMode);
|
||
};
|
||
|
||
class TGridRange;
|
||
/////////////////////////////////////
|
||
// 单元格
|
||
class GEOAPI TGridCell {
|
||
friend class AecDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
public:
|
||
TGridStyle m_gridStyle;
|
||
protected:
|
||
XString m_sText;
|
||
TGridRange *m_pRange; // m_nRange-1为Range序号
|
||
|
||
//AEC7
|
||
AcDbHardPointerId m_idBlock;
|
||
public:
|
||
TGridCell();
|
||
TGridCell(const TGridCell &src);
|
||
TGridCell & operator = (const TGridCell &src);
|
||
Acad::ErrorStatus dwgInFields (AcDbDwgFiler*, const DList<TGridRange> *ranges=NULL);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*, const DList<TGridRange> *ranges=NULL) const;
|
||
|
||
BOOL IsRange() const;
|
||
const TGridRange * GetRange() const;
|
||
const TCHAR *GetText() const;
|
||
const TGridStyle &GetGridStyle() const;
|
||
TGridStyle &GetGridStyle();
|
||
|
||
void SetRange(TGridRange *pRange); //NULL为Cell
|
||
void SetText(const TCHAR *);
|
||
void SetGridStyle(const TGridStyle &gridStyle);
|
||
};
|
||
|
||
|
||
//////////////////////////////////////////
|
||
// 合并单元格
|
||
class GEOAPI TGridRange: public TGridCell {
|
||
friend class AecDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
// Modify on 2003/6/24,8位整数上升到16位整数
|
||
Adesk::Int16 m_nRow, m_nColumn;
|
||
Adesk::Int16 m_nRowMax, m_nColumnMax;
|
||
|
||
public:
|
||
TGridRange();
|
||
TGridRange(const TGridRange &src);
|
||
TGridRange & operator = (const TGridRange &src);
|
||
BOOL IsValid() const;
|
||
Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
|
||
BOOL Include(int nRow, int nCol) const;
|
||
BOOL IsCellar() const;
|
||
int GetCoord(BOOL bIsRow) const;
|
||
int GetCoordMax(BOOL bIsRow) const;
|
||
void SetCoord(int nRow, int nCol);
|
||
void SetCoordMax(int nRow, int nCol);
|
||
};
|
||
|
||
////////////////////////////////////////////////
|
||
// 表格的标题
|
||
class GEOAPI TSheetTitle: public TSheetRow, public TGridCell {
|
||
friend class AecDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
BOOL IsRange() const;
|
||
const TGridRange * GetRange() const;
|
||
void SetRange(TGridRange *pRange);
|
||
protected:
|
||
Adesk::UInt8 m_bVisibility;
|
||
public:
|
||
TSheetTitle();
|
||
TSheetTitle(const TSheetTitle &src);
|
||
TSheetTitle & operator = (const TSheetTitle &src);
|
||
Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
|
||
BOOL IsVisible() const;
|
||
void SetVisible(BOOL bTrue);
|
||
};
|
||
|
||
|
||
#define CBF_AUTOSIZE 0x01 //自动确定大小
|
||
#define CBF_UNISCALE 0x02 //比例x=y=z
|
||
#define CBF_INPUT_SCALE 0x04 //指定比例,否则指定尺寸
|
||
#define CBF_SHOW_ATTR 0x08 //显示属性值
|
||
#define CBF_EQUAL_SIDE 0x10 //等边-正方形作为自动确定大小的策略
|
||
|
||
class TAttribValue {
|
||
public:
|
||
XString m_sName, m_sValue;
|
||
TAttribValue() {}
|
||
TAttribValue(const TCHAR *n, const TCHAR *v): m_sName(n), m_sValue(v) { }
|
||
static int FindByName(const TAttribValue *p1, const void *p2);
|
||
};
|
||
|
||
class GEOAPI TCellBlockInsert {
|
||
public:
|
||
XString m_sBlockName;
|
||
int m_nControlFlag;
|
||
DList<TAttribValue> m_lstAttribs;
|
||
double m_xValue, m_yValue, m_zValue;
|
||
|
||
public:
|
||
TCellBlockInsert() {
|
||
m_xValue=m_yValue=m_zValue=1.0;
|
||
m_nControlFlag=0;
|
||
}
|
||
BOOL ParserDesc(const TCHAR *pszText);
|
||
BOOL OutputDesc(XString &sDescOut) const;
|
||
};
|
||
|
||
|
||
#define COL_PREVFIRST -1
|
||
#define COL_NEXTLAST -2
|
||
#define ROW_PREVFIRST -1
|
||
#define ROW_NEXTLAST -2
|
||
|
||
|
||
|
||
///////////////////////////////////////////////////
|
||
// 表格对象
|
||
class GEOAPI AecDbSheet: public AecEntity {
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(AecDbSheet);
|
||
friend class AecDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
TGridStyle m_gridStyle; //标准方格样式
|
||
TDividerStyle m_border; //表格外框的分割线样式
|
||
TDividerStyle m_rowDivider; //行分割线样式
|
||
TDividerStyle m_colDivider; //列分割线样式
|
||
|
||
TSheetTitle m_title; //标题
|
||
DList<TSheetColumn> m_columns; //列
|
||
DList<TSheetRow> m_rows; //行
|
||
DList<TGridRange> m_ranges; //单元格
|
||
|
||
TGridCell *m_pCells;
|
||
|
||
double m_nRowHeight; //标准行高
|
||
|
||
//表格本身的定位方式, 左上, 右上, 左下, 右下, 中间
|
||
XExplodeDraw::TextAlignment m_nAlignment;
|
||
XPoint m_ptLocation; //定位点
|
||
double m_nRotation; //转角
|
||
|
||
TSheetRow::TRowHeightStyle m_rowHeightStyle;
|
||
public:
|
||
AecDbSheet();
|
||
virtual ~AecDbSheet();
|
||
void InitSheet(int nRow, int nCol, double nRowHeight, double nColHeight);
|
||
|
||
// 从AcDbEntity继承的方法
|
||
public:
|
||
virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
|
||
virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
||
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*);
|
||
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
|
||
virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints,
|
||
AcDbIntArray& osnapModes,
|
||
AcDbIntArray& geomIds) const;
|
||
virtual Acad::ErrorStatus subGetStretchPoints(AcGePoint3dArray & stretchPoints) const;
|
||
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
// drived from AecEntity
|
||
public:
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet, BOOL *bErase);
|
||
virtual BOOL IsValid() const;
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
virtual DrawType GetDrawType() const;
|
||
virtual void GetTips(DList<ObjInfoUnit> &) const; //取动态属性显示数据
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
virtual int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
||
// 返回发现的位置,同时posStart往前移动(以便继续找下一个使用),
|
||
virtual TextPosition FindSubText(const TCHAR *sSubText, TextPosition &posStart, TextRange *pRange=NULL) const;
|
||
// 返回下一次查找的开始位置
|
||
virtual TextPosition ReplaceSubText(const TextPosition &posRep, const TCHAR *sRepText, TextRange *pRange=NULL);
|
||
virtual long GetNextSubTextIndex(long i,bool bVert=false,bool bPre=false)const;
|
||
virtual SubText* GetSubText(long i)const;
|
||
virtual SubText* HitTestText(XPoint pt)const;
|
||
virtual void SetSubText(long i,CString sText);
|
||
|
||
// aec add 101116,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
// 辅助方法
|
||
public:
|
||
// 按行列取得单元格
|
||
const TGridCell * operator () (int nRow, int nCol) const;
|
||
TGridCell * operator () (int nRow, int nCol);
|
||
XPoint Align2Base(XPoint ptAlign, XPoint ext) const;
|
||
XPoint Base2Align(XPoint ptBase, XPoint ext) const;
|
||
|
||
void RemoveColumn(int nCol);
|
||
void RemoveRow(int nRow);
|
||
int HitTestOnColumn(XPoint pt) const;
|
||
int HitTestOnRow(XPoint pt) const;
|
||
const TGridCell * HitTestOnCell(XPoint pt, int *pRow, int *pCol) const;
|
||
|
||
// 合并单元格
|
||
void MergeCells(int nRowFrom, int nColFrom, int nRowTo, int nColTo);
|
||
BOOL ExplodeCell(int nRow, int nCol);
|
||
// 根据设定重新计算行的高度
|
||
void CalculateRowHeight(int nRowFrom, int nRowTo);
|
||
void CalculateRowHeight(int nRow); //当行的文字改变时
|
||
|
||
// 强制下级继承上级属性
|
||
void DescInheritGridStyle();
|
||
void DescInheritRowDivider(bool bIncludeRowHeight); //强制各行继承表格全局设定
|
||
void DescInheritColDivider(); //强制各列继承表格全局设定
|
||
void DescInheritColGridStyle(int iCol);
|
||
void DescInheritRowGridStyle(int iRow);
|
||
|
||
// 排序
|
||
void SortByColumn(int nKeyCol, BOOL bSortAscend=TRUE, int nRowFrom=0, int nRowTo=-1); //-1代表最后一列
|
||
void SortByColumns(const DList<int> &lstKeyCol, BOOL bSortAscend=TRUE, int nRowFrom=0, int nRowTo=-1); //-1代表最后一列
|
||
|
||
/////////////////////////////////////////
|
||
// 绘制方法
|
||
public:
|
||
// 如果返回有效,则调用程序负责用delete释放
|
||
AecDbText * GetText(Adesk::UInt32 cookies) const; //返回可以是MText也可以是Text
|
||
// 对某一行初始化分割线的属性, 如果没有分割线则返回FALSE
|
||
BOOL InitRowDivider(AcDbPolyline &pline, int nRow) const;
|
||
// 对某一列初始化分割线的属性, 如果没有分割线则返回FALSE
|
||
BOOL InitColumnDivider(AcDbPolyline &pline, int nCol) const;
|
||
// 绘制表格的外框
|
||
void DrawBorder(XExplodeDraw &dc, int &nGsMarker) const;
|
||
// 设置文字的位置和对齐方式
|
||
void InitTextInBox(AecDbText &text, XPoint ptTopLeft, double nBoxWidth, double nBoxHeight,
|
||
double nOffset, AcDb::TextHorzMode nHorMode, AcDb::TextVertMode nVerMode) const;
|
||
// 绘制标题, 包括文字和横线, ptBase -- 标题上(IN)下(OUT)的第一左上角
|
||
void DrawTitle(XExplodeDraw &dc, int &nGsMarker) const;
|
||
// 绘制表格的行分割线
|
||
void DrawRowDivider(XPoint ptBase, XExplodeDraw &dc, int &nGsMarker) const;
|
||
// 绘制某一行的底线
|
||
void DrawRowDivider(int nRow, XPoint ptLeft, XExplodeDraw &dc) const;
|
||
//绘制表格列分割线
|
||
void DrawColumnDivider(XPoint ptTopLeft, XExplodeDraw &dc, int &nGsMarker) const;
|
||
void DrawColumnDivider(int nRow, XPoint ptLeft, XExplodeDraw &dc) const;
|
||
|
||
// 绘制单元格的文本
|
||
// ptTopLeft表格的左上角
|
||
void DrawRangeText(const TGridRange &range, XPoint ptTopLeft, XExplodeDraw &dc) const;
|
||
// ptTopLeft表格的左上角
|
||
void DrawCellText(int nRow, int nCol, XPoint ptTopLeft, XExplodeDraw &dc) const;
|
||
// ptBase单元格的左上角, w单元宽, h单元高
|
||
void DrawCellText(const TCHAR *pszText, double w, double h, int nRow, int nCol, XPoint ptBase, XExplodeDraw &dc) const;
|
||
// ptTopLeft表格的左上角
|
||
void DrawCellText(XPoint ptTopLeft, XExplodeDraw &dc, int &nGsMarker) const;
|
||
|
||
////////////////////////////////////////////////////////////
|
||
// 属性方法
|
||
public:
|
||
void GetBorder(XPoly2D &polyBorder) const;
|
||
XPoint GetExtents(BOOL bIncludeTitle, BOOL bAsPaperUnit=TRUE) const; // 没有考虑转角, x,y分别为宽度和高度
|
||
double GetSheetWidth(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetSheetHeight(BOOL bIncludeTitle, BOOL bAsPaperUnit=TRUE) const;
|
||
|
||
double GetRowsHeight(int nRowFrom, int nRowTo, BOOL bAsPaperUnit=TRUE) const;
|
||
double GetRowHeight(int nRow, BOOL bAsPaperUnit) const;
|
||
const TSheetRow *GetRow(int nRow) const;
|
||
TSheetRow *GetRow(int nRow);
|
||
|
||
const TSheetColumn *GetColumn(int nCol) const;
|
||
TSheetColumn *GetColumn(int nCol);
|
||
double GetColumnsWidth(int nColFrom, int nColTo, BOOL bAsPaperUnit=TRUE) const;
|
||
double GetColumnWidth(int nCol, BOOL bAsPaperUnit=TRUE) const;
|
||
|
||
XPoint GetLocation() const;
|
||
XPoint GetTopLeft(BOOL bIncludeTitle) const;
|
||
double GetRotation() const;
|
||
XExplodeDraw::TextAlignment GetAlignment() const;
|
||
double GetRowHeight(BOOL bAsPaperUnit=TRUE) const; //取缺省的行高
|
||
int GetRowNum() const;
|
||
int GetColumnNum() const;
|
||
XPoint GetColumnPoint(int nCol) const;
|
||
XPoint GetRowPoint(int nRow) const;
|
||
inline TSheetRow::TRowHeightStyle GetRowHeightStyle() const {
|
||
return m_rowHeightStyle;
|
||
}
|
||
|
||
|
||
inline void SetRowHeightStyle(TSheetRow::TRowHeightStyle style) {
|
||
assertWriteEnabled();
|
||
m_rowHeightStyle=style;
|
||
}
|
||
void SetLocation(XPoint pt);
|
||
void SetRotation(double nRot);
|
||
void SetAlignment(XExplodeDraw::TextAlignment nAlign);
|
||
void SetRowHeight(double h, BOOL bAsPaperUnit=TRUE); //设置缺省的行高
|
||
|
||
void SetGridStyle(const TGridStyle &src);
|
||
void SetRowDivider(const TDividerStyle &src);
|
||
void SetColDivider(const TDividerStyle &src);
|
||
void SetBorderStyle(const TDividerStyle &src);
|
||
|
||
const TGridStyle &GetGridStyle() const;
|
||
const TDividerStyle &GetRowDivider() const;
|
||
const TDividerStyle &GetColDivider() const;
|
||
const TDividerStyle &GetBorderStyle() const;
|
||
TDividerStyle &GetBorderStyle();
|
||
TGridStyle &GetGridStyle();
|
||
TDividerStyle &GetRowDivider();
|
||
TDividerStyle &GetColDivider();
|
||
|
||
|
||
// 增加第i列
|
||
BOOL AddColumnAt(int i);
|
||
BOOL AddColumnAt(int i, const TSheetColumn &column);
|
||
// 增加第i行
|
||
BOOL AddRowAt(int i, const TSheetRow &row);
|
||
BOOL AddRowAt(int i);
|
||
// 设置第i列
|
||
BOOL SetColumnAt(int i, const TSheetColumn &column);
|
||
// 设置第i行
|
||
BOOL SetRowAt(int i, const TSheetRow &row);
|
||
// 复制行内容和属性(包括单元格)
|
||
BOOL CopyRow(int nSrc, int nDest);
|
||
// 交换列
|
||
BOOL SwapColumn(int nSrc, int nDest);
|
||
// 交换行
|
||
BOOL SwapRow(int nSrc, int nDest);
|
||
void Merge(AecDbSheet*pSheet,bool bRowMerge);//bRowMerge是否行合并
|
||
|
||
/////////////////////////////////////////
|
||
// 单元格属性
|
||
public:
|
||
// 判断某单元格是否有底线
|
||
BOOL HasRowDivider(int nRow, int nCol) const;
|
||
// 判断某单元格是否有右线
|
||
BOOL HasColumnDivider(int nRow, int nCol) const;
|
||
|
||
// 求单元格最终有效的属性样式
|
||
const TGridStyle *GetCellGridStyle(const TGridStyle &rStyle, int nCol, int nOverFlag, BOOL*bLocal=NULL) const;
|
||
const TGridStyle * GetCellGridStyle(int nRow, int nCol, int nOverFlag, BOOL *bLocal=NULL) const;
|
||
AcDb::TextHorzMode GetCellHorMode(int nRow, int nCol, BOOL *bLocal=NULL) const;
|
||
AcDb::TextVertMode GetCellVerMode(int nRow, int nCol, BOOL *bLocal=NULL) const;
|
||
double GetCellLineSpace(int nRow, int nCol, BOOL bAsPaperUnit=TRUE) const;
|
||
double GetCellLineSpaceFactor(int nRow, int nCol, BOOL *bLocal=NULL) const;
|
||
// 取得单元格的文本高度
|
||
double GetCellTextHeight(int nRow, int nCol, BOOL bAsPaperUnit=TRUE, BOOL *bLocal=NULL) const;
|
||
// 取得单元格的文字样式
|
||
AcDbObjectId GetCellTextStyle(int nRow, int nCol, BOOL *bLocal=NULL) const;
|
||
// 单元格文字是否自动换行
|
||
BOOL IsCellWrapEnabled(int nRow, int nCol, BOOL *bLocal=NULL) const;
|
||
Adesk::UInt16 GetCellTextColor(int nRow, int nCol, BOOL *bLocal=NULL) const;
|
||
|
||
XPoint GetCellPoint(int nRow, int nCol) const;
|
||
XPoint GetCellSize(int nRow, int nCol, BOOL bAsPaperUnit=TRUE) const;
|
||
|
||
///////////////////////////////////////////////////
|
||
// 标题属性
|
||
public:
|
||
// 求标题最终有效的属性样式
|
||
const TGridStyle *GetTitleGridStyle(int nOverFlag, BOOL *bLocal=NULL) const;
|
||
// 标题的高度
|
||
double GetTitleHeight(BOOL bAsPaperUnit) const;
|
||
// 标题文字的对齐方式
|
||
AcDb::TextVertMode GetTitleVerMode( BOOL *bLocal=NULL) const;
|
||
AcDb::TextHorzMode GetTitleHorMode( BOOL *bLocal=NULL) const;
|
||
// 标题的文字行间距
|
||
double GetTitleLineSpace(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetTitleLineSpaceFactor(BOOL *bLocal=NULL) const;
|
||
// 标题的文字高度
|
||
double GetTitleTextHeight(BOOL bAsPaperUnit=TRUE, BOOL *bLocal=NULL) const;
|
||
// 标题的文字样式
|
||
AcDbObjectId GetTitleTextStyle( BOOL *bLocal=NULL) const;
|
||
// 标题文字是否自动换行
|
||
BOOL IsTitleWrapEnabled( BOOL *bLocal=NULL) const;
|
||
// 取得标题文本
|
||
const TCHAR *GetTitleText() const;
|
||
Adesk::UInt16 GetTitleTextColor( BOOL *bLocal=NULL) const;
|
||
|
||
// 设置标题文本
|
||
void SetTitleText(const TCHAR *);
|
||
void SetTitleHeight(double h, BOOL bAsPaperUnit=TRUE);
|
||
void SetTitleGridStyle(const TGridStyle &gridStyle);
|
||
const TSheetTitle &GetTitle() const;
|
||
TSheetTitle& GetTitle();
|
||
};
|
||
|
||
|
||
#endif
|