[]
• 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);
| Name | Type |
|---|---|
text? |
string |
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
批注是否自动调整大小。 |
any
如果未设置值,则返回批注是否自动调整大小;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的背景颜色。 |
any
如果未设置值,则返回批注的背景颜色;否则返回批注对象。
▸ 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();
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的边框颜色。 |
any
如果未设置值,则返回批注的边框颜色;否则返回批注对象。
▸ 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();
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的边框样式。 |
any
如果未设置值,则返回批注的边框样式;否则返回批注对象。
▸ 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();
| Name | Type | Description |
|---|---|---|
value? |
number |
批注的边框宽度。 |
any
如果未设置值,则返回批注的边框宽度;否则返回批注对象。
▸ 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());
| Name | Type | Description |
|---|---|---|
value? |
CommentState |
批注的状态。 |
any
如果未设置值,则返回批注的状态;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
DisplayMode |
批注的显示模式。 |
any
如果未设置值,则返回批注的显示模式;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
批注是否动态移动。 |
any
如果未设置值,则返回批注是否动态移动;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
批注是否动态调整大小。 |
any
如果未设置值,则返回批注是否动态调整大小;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的字体。 |
any
如果未设置值,则返回批注的字体;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的字体大小。 |
any
如果未设置值,则返回批注的字体大小;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的字体样式。 |
any
如果未设置值,则返回批注的字体样式;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的字体粗细。 |
any
如果未设置值,则返回批注的字体粗细;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的文本颜色。 |
any
如果未设置值,则返回批注的文本颜色;否则返回批注对象。
▸ 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();
| Name | Type | Description |
|---|---|---|
value? |
number |
批注的高度。 |
any
如果未设置值,则返回批注的高度;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
HorizontalAlign |
批注的水平对齐方式。 |
any
如果未设置值,则返回批注的水平对齐方式;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的指示器颜色。 |
any
如果未设置值,则返回批注指示器的颜色;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
number |
批注的指示器大小。 |
any
如果未设置值,则返回批注指示器的大小;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
Point |
批注的位置。 |
any
如果未设置值,则返回批注的位置;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
批注的文本锁定状态。 |
any
如果未设置值,则返回批注的文本锁定状态;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
批注的锁定状态。 |
any
如果未设置值,则返回批注的锁定状态;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
number |
批注的不透明度。 |
any
如果未设置值,则返回批注的不透明度;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
Padding |
批注的内边距。 |
any
如果未设置值,则返回批注的内边距;否则返回批注对象。
▸ 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();
| Name | Type | Description |
|---|---|---|
value? |
boolean |
批注是否显示阴影。 |
any
如果未设置值,则返回批注是否显示阴影;否则返回批注对象。
▸ 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);
| Name | Type | Description |
|---|---|---|
value? |
string |
批注的文本。 |
any
如果未设置值,则返回批注的文本;否则返回批注对象。
▸ 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();
| Name | Type | Description |
|---|---|---|
value? |
TextDecorationType |
批注的文本装饰。 |
any
如果未设置值,则返回批注的文本装饰;否则返回批注对象。
▸ 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();
| Name | Type | Description |
|---|---|---|
value? |
number |
批注的宽度。 |
any
如果未设置值,则返回批注的宽度;否则返回批注对象。
▸ 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());
| Name | Type | Description |
|---|---|---|
value? |
number |
批注的z-index。 |
any
如果未设置值,则返回批注的z-index;否则返回批注对象。