[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

GC.Spread.Sheets.Comments.Comment

Class: Comment

Sheets.Comments.Comment

Table of contents

Constructors

Methods

Constructors

constructor

• new Comment(text?)

表示一个批注。

example

var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.autoSize(true);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type
text? string

Methods

autoSize

▸ autoSize(value?): any

获取或设置批注是否根据其内容自动调整大小。

example

//此示例使用autoSize方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.autoSize(true);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? boolean 批注是否自动调整大小。

Returns

any

如果未设置值,则返回批注是否自动调整大小;否则返回批注对象。


backColor

▸ backColor(value?): any

获取或设置批注的背景颜色。

example

//此示例设置backColor方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? string 批注的背景颜色。

Returns

any

如果未设置值,则返回批注的背景颜色;否则返回批注对象。


borderColor

▸ borderColor(value?): any

获取或设置批注的边框颜色。

example

//此示例设置borderColor方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.borderWidth(2);
comment.borderStyle("dotted");
comment.borderColor("red");
activeSheet.getCell(5,5).comment(comment);
activeSheet.suspendPaint();
activeSheet.resumePaint();

Parameters

Name Type Description
value? string 批注的边框颜色。

Returns

any

如果未设置值,则返回批注的边框颜色;否则返回批注对象。


borderStyle

▸ borderStyle(value?): any

获取或设置批注的边框样式。

example

//此示例设置borderStyle方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.borderWidth(2);
comment.borderStyle("dotted");
comment.borderColor("red");
activeSheet.getCell(5,5).comment(comment);
activeSheet.suspendPaint();
activeSheet.resumePaint();

Parameters

Name Type Description
value? string 批注的边框样式。

Returns

any

如果未设置值,则返回批注的边框样式;否则返回批注对象。


borderWidth

▸ borderWidth(value?): any

获取或设置批注的边框宽度。

example

//此示例设置borderWidth方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.borderWidth(2);
comment.borderStyle("dotted");
comment.borderColor("red");
activeSheet.getCell(5,5).comment(comment);
activeSheet.suspendPaint();
activeSheet.resumePaint();

Parameters

Name Type Description
value? number 批注的边框宽度。

Returns

any

如果未设置值,则返回批注的边框宽度;否则返回批注对象。


commentState

▸ commentState(value?): any

获取或设置批注的状态。

example

//此示例获取批注状态。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.getCell(5,5).comment(comment);
alert(comment.commentState());

Parameters

Name Type Description
value? CommentState 批注的状态。

Returns

any

如果未设置值,则返回批注的状态;否则返回批注对象。


displayMode

▸ displayMode(value?): any

获取或设置批注的显示模式。

example

//此示例设置displayMode方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? DisplayMode 批注的显示模式。

Returns

any

如果未设置值,则返回批注的显示模式;否则返回批注对象。


dynamicMove

▸ dynamicMove(value?): any

获取或设置批注是否动态移动。

example

//此示例使用dynamicMove方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.dynamicMove(true);
comment.dynamicSize(true);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? boolean 批注是否动态移动。

Returns

any

如果未设置值,则返回批注是否动态移动;否则返回批注对象。


dynamicSize

▸ dynamicSize(value?): any

获取或设置批注是否动态调整大小。

example

//此示例使用dynamicSize方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.dynamicMove(true);
comment.dynamicSize(true);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? boolean 批注是否动态调整大小。

Returns

any

如果未设置值,则返回批注是否动态调整大小;否则返回批注对象。


fontFamily

▸ fontFamily(value?): any

获取或设置批注的字体。

example

//此示例使用fontFamily方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.fontFamily("Comic Sans MS");
comment.fontSize("10pt");
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? string 批注的字体。

Returns

any

如果未设置值,则返回批注的字体;否则返回批注对象。


fontSize

▸ fontSize(value?): any

获取或设置批注的字体大小。有效值是数字后跟"pt"(必需),例如"12pt"。

example

//此示例使用fontSize方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.fontFamily("Comic Sans MS");
comment.fontSize("10pt");
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? string 批注的字体大小。

Returns

any

如果未设置值,则返回批注的字体大小;否则返回批注对象。


fontStyle

▸ fontStyle(value?): any

获取或设置批注的字体样式。

example

//此示例使用fontStyle方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.fontFamily("Comic Sans MS");
comment.fontStyle("normal");
comment.fontWeight("normal");
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? string 批注的字体样式。

Returns

any

如果未设置值,则返回批注的字体样式;否则返回批注对象。


fontWeight

▸ fontWeight(value?): any

获取或设置批注的字体粗细。

example

//此示例使用fontWeight方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.fontFamily("Comic Sans MS");
comment.fontStyle("normal");
comment.fontWeight("normal");
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? string 批注的字体粗细。

Returns

any

如果未设置值,则返回批注的字体粗细;否则返回批注对象。


foreColor

▸ foreColor(value?): any

获取或设置批注的文本颜色。

example

//此示例使用foreColor方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? string 批注的文本颜色。

Returns

any

如果未设置值,则返回批注的文本颜色;否则返回批注对象。


height

▸ height(value?): any

获取或设置批注的高度。

example

//此示例使用height方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.height(50);
comment.width(90);
activeSheet.getCell(5,5).comment(comment);
activeSheet.suspendPaint();
activeSheet.resumePaint();

Parameters

Name Type Description
value? number 批注的高度。

Returns

any

如果未设置值,则返回批注的高度;否则返回批注对象。


horizontalAlign

▸ horizontalAlign(value?): any

获取或设置批注的水平对齐方式。

example

//此示例使用horizontalAlign方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.horizontalAlign(GC.Spread.Sheets.HorizontalAlign.center);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? HorizontalAlign 批注的水平对齐方式。

Returns

any

如果未设置值,则返回批注的水平对齐方式;否则返回批注对象。


indicatorColor

▸ indicatorColor(value?): any

获取或设置批注的指示器颜色。

example

//此示例使用indicatorColor方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
var color1 = "red";
var color2 = "#FFFFFF";
var color2 = "rgba(255, 255, 255, 0.01)";
comment.indicatorColor(color1);
activeSheet.comments.add(5, 5, comment);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? string 批注的指示器颜色。

Returns

any

如果未设置值,则返回批注指示器的颜色;否则返回批注对象。


indicatorSize

▸ indicatorSize(value?): any

获取或设置批注的指示器大小。

example

//此示例使用indicatorSize方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.indicatorSize(6);
activeSheet.comments.add(5, 5, comment);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? number 批注的指示器大小。

Returns

any

如果未设置值,则返回批注指示器的大小;否则返回批注对象。


location

▸ location(value?): any

获取或设置批注的位置。

example

//此示例使用location方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.location(new GC.Spread.Sheets.Point(10, 10));
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? Point 批注的位置。

Returns

any

如果未设置值,则返回批注的位置;否则返回批注对象。


lockText

▸ lockText(value?): any

获取或设置批注的文本锁定状态。

example

//此示例使用lockText方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.lockText(false);
comment.locked(false);
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.options.isProtected = true;
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? boolean 批注的文本锁定状态。

Returns

any

如果未设置值,则返回批注的文本锁定状态;否则返回批注对象。


locked

▸ locked(value?): any

获取或设置批注的锁定状态。

example

//此示例使用locked方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.lockText(false);
comment.locked(false);
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.options.isProtected = true;
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? boolean 批注的锁定状态。

Returns

any

如果未设置值,则返回批注的锁定状态;否则返回批注对象。


opacity

▸ opacity(value?): any

获取或设置批注的不透明度。

example

//此示例设置不透明度。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.opacity(10);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? number 批注的不透明度。

Returns

any

如果未设置值,则返回批注的不透明度;否则返回批注对象。


padding

▸ padding(value?): any

获取或设置批注的内边距。

example

//此示例使用padding方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.padding(new GC.Spread.Sheets.Comments.Padding(2, 2, 2, 2));
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? Padding 批注的内边距。

Returns

any

如果未设置值,则返回批注的内边距;否则返回批注对象。


showShadow

▸ showShadow(value?): any

获取或设置批注是否显示阴影。

example

//此示例使用showShadow方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.borderWidth(2);
comment.borderStyle("dotted");
comment.borderColor("red");
comment.showShadow(true);
activeSheet.getCell(5,5).comment(comment);
activeSheet.suspendPaint();
activeSheet.resumePaint();

Parameters

Name Type Description
value? boolean 批注是否显示阴影。

Returns

any

如果未设置值,则返回批注是否显示阴影;否则返回批注对象。


text

▸ text(value?): any

获取或设置批注的文本。

example

//此示例设置text方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.getCell(5,5).comment(comment);

Parameters

Name Type Description
value? string 批注的文本。

Returns

any

如果未设置值,则返回批注的文本;否则返回批注对象。


textDecoration

▸ textDecoration(value?): any

获取或设置批注的文本装饰。

example

//此示例使用textDecoration方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.textDecoration(GC.Spread.Sheets.TextDecorationType.underline);
activeSheet.getCell(5,5).comment(comment);
activeSheet.suspendPaint();
activeSheet.resumePaint();

Parameters

Name Type Description
value? TextDecorationType 批注的文本装饰。

Returns

any

如果未设置值,则返回批注的文本装饰;否则返回批注对象。


width

▸ width(value?): any

获取或设置批注的宽度。

example

//此示例设置width方法。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
comment.height(50);
comment.width(90);
activeSheet.getCell(5,5).comment(comment);
activeSheet.suspendPaint();
activeSheet.resumePaint();

Parameters

Name Type Description
value? number 批注的宽度。

Returns

any

如果未设置值,则返回批注的宽度;否则返回批注对象。


zIndex

▸ zIndex(value?): any

获取或设置批注的z-index。

example

//此示例获取z-index。
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("yellow");
comment.foreColor("green");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.getCell(5,5).comment(comment);
alert(comment.zIndex());

Parameters

Name Type Description
value? number 批注的z-index。

Returns

any

如果未设置值,则返回批注的z-index;否则返回批注对象。