553 lines
18 KiB
C++
553 lines
18 KiB
C++
#pragma once
|
||
#include "AecDbEntityBaseEx.h"
|
||
#include "AecDbText.h"
|
||
//class AecXDbText;
|
||
|
||
#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 GridStyle {
|
||
friend class CDbSheet;
|
||
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; //垂直对齐
|
||
//AcGiDraw::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; //文字高度
|
||
|
||
//TArch7
|
||
TextDirection m_nTextDirection;
|
||
public:
|
||
GridStyle();
|
||
GridStyle(const GridStyle &src);
|
||
GridStyle & operator = (const GridStyle &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 DividerStyle { //行间线或列间线的样式
|
||
friend class CDbSheet;
|
||
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:
|
||
DividerStyle();
|
||
DividerStyle(const DividerStyle &src);
|
||
DividerStyle & operator= (const DividerStyle &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 SheetColumn {
|
||
friend class CDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
GridStyle m_gridStyle; //垂直对齐无效
|
||
DividerStyle 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:
|
||
SheetColumn();
|
||
SheetColumn(const SheetColumn &src);
|
||
SheetColumn & operator= (const SheetColumn &src);
|
||
BOOL IsValid() const;
|
||
Acad::ErrorStatus dwgInFields(AcDbDwgFiler*);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
|
||
const DividerStyle & GetDividerStyle() const;
|
||
DividerStyle & GetDividerStyle();
|
||
const GridStyle & GetGridStyle() const;
|
||
GridStyle & GetGridStyle();
|
||
void SeDividerStyle(const DividerStyle &style);
|
||
void SetGridStyle(const GridStyle &style);
|
||
|
||
double GetWidth() const; //图纸单位
|
||
BOOL AllowSizing() const;
|
||
void SetWidth(double w); //图纸单位
|
||
void SetAllowSizing(BOOL bTrue);
|
||
};
|
||
|
||
//////////////////////////////////////
|
||
// 表格的行性质
|
||
class SheetRow {
|
||
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无效
|
||
};
|
||
|
||
DividerStyle 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:
|
||
SheetRow();
|
||
SheetRow(const SheetRow &src);
|
||
SheetRow & operator= (const SheetRow &src);
|
||
Acad::ErrorStatus dwgInFields(AcDbDwgFiler*);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
|
||
AcDb::TextVertMode GetVerMode() const;
|
||
double GetHeight() const;
|
||
TRowHeightStyle GetRowHeightStyle() const;
|
||
const DividerStyle & GetDividerStyle() const;
|
||
DividerStyle &GetDividerStyle();
|
||
|
||
void SetHeight(double h);
|
||
void SeDividerStyle(const DividerStyle ÷r);
|
||
void SetRowHeightStyle(TRowHeightStyle st);
|
||
void SetVerMode(AcDb::TextVertMode nVerMode);
|
||
};
|
||
|
||
class GridRange;
|
||
/////////////////////////////////////
|
||
// 单元格
|
||
class GridCell {
|
||
friend class CDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
public:
|
||
GridStyle m_gridStyle;
|
||
protected:
|
||
XString m_sText;
|
||
GridRange *m_pRange; // m_nRange-1为Range序号
|
||
|
||
//TArch7
|
||
AcDbHardPointerId m_idBlock;
|
||
public:
|
||
GridCell();
|
||
GridCell(const GridCell &src);
|
||
GridCell & operator = (const GridCell &src);
|
||
Acad::ErrorStatus dwgInFields(AcDbDwgFiler*, const DList<GridRange> *ranges = NULL);
|
||
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*, const DList<GridRange> *ranges = NULL) const;
|
||
|
||
BOOL IsRange() const;
|
||
const GridRange * GetRange() const;
|
||
const TCHAR *GetText() const;
|
||
const GridStyle &GetGridStyle() const;
|
||
GridStyle &GetGridStyle();
|
||
|
||
void SetRange(GridRange *pRange); //NULL为Cell
|
||
void SetText(const TCHAR *);
|
||
void SetGridStyle(const GridStyle &gridStyle);
|
||
};
|
||
|
||
|
||
//////////////////////////////////////////
|
||
// 合并单元格
|
||
class GridRange : public GridCell {
|
||
friend class CDbSheet;
|
||
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:
|
||
GridRange();
|
||
GridRange(const GridRange &src);
|
||
GridRange & operator = (const GridRange &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 SheetTitle : public SheetRow, public GridCell {
|
||
friend class CDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
BOOL IsRange() const;
|
||
const GridRange * GetRange() const;
|
||
void SetRange(GridRange *pRange);
|
||
protected:
|
||
Adesk::UInt8 m_bVisibility;
|
||
public:
|
||
SheetTitle();
|
||
SheetTitle(const SheetTitle &src);
|
||
SheetTitle & operator = (const SheetTitle &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 AttribValue {
|
||
public:
|
||
XString m_sName, m_sValue;
|
||
AttribValue() {}
|
||
AttribValue(const TCHAR *n, const TCHAR *v) : m_sName(n), m_sValue(v) { }
|
||
static int FindByName(const AttribValue *p1, const void *p2);
|
||
};
|
||
|
||
class CellBlockInsert {
|
||
public:
|
||
XString m_sBlockName;
|
||
int m_nControlFlag;
|
||
DList<AttribValue> m_lstAttribs;
|
||
double m_xValue, m_yValue, m_zValue;
|
||
|
||
public:
|
||
CellBlockInsert() {
|
||
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 CDbSheet : public AecXDbEntityBaseEx {
|
||
public:
|
||
ACRX_DECLARE_MEMBERS(CDbSheet);
|
||
friend class CDbSheet;
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
GridStyle m_gridStyle; //标准方格样式
|
||
DividerStyle m_border; //表格外框的分割线样式
|
||
DividerStyle m_rowDivider; //行分割线样式
|
||
DividerStyle m_colDivider; //列分割线样式
|
||
|
||
SheetTitle m_title; //标题
|
||
DList<SheetColumn> m_columns; //列
|
||
DList<SheetRow> m_rows; //行
|
||
DList<GridRange> m_ranges; //单元格
|
||
|
||
GridCell *m_pCells;
|
||
|
||
double m_nRowHeight; //标准行高
|
||
|
||
//表格本身的定位方式, 左上, 右上, 左下, 右下, 中间
|
||
AcGiDraw::TextAlignment m_nAlignment;
|
||
XPoint m_ptLocation; //定位点
|
||
double m_nRotation; //转角
|
||
|
||
SheetRow::TRowHeightStyle m_rowHeightStyle;
|
||
public:
|
||
CDbSheet();
|
||
virtual ~CDbSheet();
|
||
void InitSheet(int nRow, int nCol, double nRowHeight, double nColHeight);
|
||
|
||
// 从AcDbEntity继承的方法
|
||
public:
|
||
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 TDbEntity
|
||
public:
|
||
virtual BOOL IsValid() const;
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
virtual DrawModeType 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 Draw2d(AcGiDraw &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);
|
||
|
||
// sg add 101116,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
// 辅助方法
|
||
public:
|
||
// 按行列取得单元格
|
||
const GridCell * operator () (int nRow, int nCol) const;
|
||
GridCell * 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 GridCell * 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 DescInheriGridStyle();
|
||
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释放
|
||
AecXDbText * 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(AcGiDraw &dc, int &nGsMarker) const;
|
||
// 设置文字的位置和对齐方式
|
||
void InitTextInBox(AecXDbText &text, XPoint ptTopLeft, double nBoxWidth, double nBoxHeight,
|
||
double nOffset, AcDb::TextHorzMode nHorMode, AcDb::TextVertMode nVerMode) const;
|
||
// 绘制标题, 包括文字和横线, ptBase -- 标题上(IN)下(OUT)的第一左上角
|
||
void DrawTitle(AcGiDraw &dc, int &nGsMarker) const;
|
||
// 绘制表格的行分割线
|
||
void DrawRowDivider(XPoint ptBase, AcGiDraw &dc, int &nGsMarker) const;
|
||
// 绘制某一行的底线
|
||
void DrawRowDivider(int nRow, XPoint ptLeft, AcGiDraw &dc) const;
|
||
//绘制表格列分割线
|
||
void DrawColumnDivider(XPoint ptTopLeft, AcGiDraw &dc, int &nGsMarker) const;
|
||
void DrawColumnDivider(int nRow, XPoint ptLeft, AcGiDraw &dc) const;
|
||
|
||
// 绘制单元格的文本
|
||
// ptTopLeft表格的左上角
|
||
void DrawRangeText(const GridRange &range, XPoint ptTopLeft, AcGiDraw &dc) const;
|
||
// ptTopLeft表格的左上角
|
||
void DrawCellText(int nRow, int nCol, XPoint ptTopLeft, AcGiDraw &dc) const;
|
||
// ptBase单元格的左上角, w单元宽, h单元高
|
||
void DrawCellText(const TCHAR *pszText, double w, double h, int nRow, int nCol, XPoint ptBase, AcGiDraw &dc) const;
|
||
// ptTopLeft表格的左上角
|
||
void DrawCellText(XPoint ptTopLeft, AcGiDraw &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 SheetRow *GetRow(int nRow) const;
|
||
SheetRow *GetRow(int nRow);
|
||
|
||
const SheetColumn *GetColumn(int nCol) const;
|
||
SheetColumn *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;
|
||
AcGiDraw::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 SheetRow::TRowHeightStyle GetRowHeightStyle() const {
|
||
return m_rowHeightStyle;
|
||
}
|
||
|
||
|
||
inline void SetRowHeightStyle(SheetRow::TRowHeightStyle style) {
|
||
assertWriteEnabled();
|
||
m_rowHeightStyle = style;
|
||
}
|
||
void SetLocation(XPoint pt);
|
||
void SetRotation(double nRot);
|
||
void SetAlignment(AcGiDraw::TextAlignment nAlign);
|
||
void SetRowHeight(double h, BOOL bAsPaperUnit = TRUE); //设置缺省的行高
|
||
|
||
void SetGridStyle(const GridStyle &src);
|
||
void SetRowDivider(const DividerStyle &src);
|
||
void SetColDivider(const DividerStyle &src);
|
||
void SetBorderStyle(const DividerStyle &src);
|
||
|
||
const GridStyle &GetGridStyle() const;
|
||
const DividerStyle &GetRowDivider() const;
|
||
const DividerStyle &GetColDivider() const;
|
||
const DividerStyle &GetBorderStyle() const;
|
||
DividerStyle &GetBorderStyle();
|
||
GridStyle &GetGridStyle();
|
||
DividerStyle &GetRowDivider();
|
||
DividerStyle &GetColDivider();
|
||
|
||
|
||
// 增加第i列
|
||
BOOL AddColumnAt(int i);
|
||
BOOL AddColumnAt(int i, const SheetColumn &column);
|
||
// 增加第i行
|
||
BOOL AddRowAt(int i, const SheetRow &row);
|
||
BOOL AddRowAt(int i);
|
||
// 设置第i列
|
||
BOOL SetColumnAt(int i, const SheetColumn &column);
|
||
// 设置第i行
|
||
BOOL SetRowAt(int i, const SheetRow &row);
|
||
// 复制行内容和属性(包括单元格)
|
||
BOOL CopyRow(int nSrc, int nDest);
|
||
// 交换列
|
||
BOOL SwapColumn(int nSrc, int nDest);
|
||
// 交换行
|
||
BOOL SwapRow(int nSrc, int nDest);
|
||
void Merge(CDbSheet*pSheet, bool bRowMerge);//bRowMerge是否行合并
|
||
|
||
/////////////////////////////////////////
|
||
// 单元格属性
|
||
public:
|
||
// 判断某单元格是否有底线
|
||
BOOL HasRowDivider(int nRow, int nCol) const;
|
||
// 判断某单元格是否有右线
|
||
BOOL HasColumnDivider(int nRow, int nCol) const;
|
||
|
||
// 求单元格最终有效的属性样式
|
||
const GridStyle *GetCellGridStyle(const GridStyle &rStyle, int nCol, int nOverFlag, BOOL*bLocal = NULL) const;
|
||
const GridStyle * 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 GridStyle *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 GridStyle &gridStyle);
|
||
const SheetTitle &GetTitle() const;
|
||
SheetTitle& GetTitle();
|
||
};
|