[]
        
(Showing Draft Content)

GC.Spread.Sheets.Touch.TouchToolStripItem

Class: TouchToolStripItem

Sheets.Touch.TouchToolStripItem

Table of contents

Constructors

Methods

Constructors

constructor

new TouchToolStripItem(name, text, image, command?, canExecute?)

Represents an item in the toolbar.

example

//This example adds a delete image with red text.
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ }))
spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red");
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());

Parameters

Name Type Description
name string The name of the item.
text string The item text.
image string The item image source.
command? any Defines the executive function that occurs when the user taps the item.
canExecute? Function Defines when to show the item by a function. If returns true, display the item; otherwise, hide the item.

Methods

font

font(value?): any

Gets or sets the font of the item text.

example

//This example adds a delete image with red text.
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ }))
spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red");
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());

Parameters

Name Type Description
value? string The font of the toolbar item text.

Returns

any

If no value is set, returns the font of the item text; otherwise, returns the toolbar item.


foreColor

foreColor(value?): any

Gets or sets the color of the item text.

example

//This example adds a delete image with red text.
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ }))
spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red");
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());

Parameters

Name Type Description
value? string The color of the toolbar item text.

Returns

any

If no value is set, returns the color of the item text; otherwise, returns the toolbar item.


image

image(value?): any

Gets or sets the source of the item image.

example

//This example adds a delete image with red text.
var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem();
tts.image("cut.png");
tts.name("C");
tts.text("Delete");
spread.touchToolStrip.add(tts, function(){ });
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");

Parameters

Name Type Description
value? string The path and filename for the item image source.

Returns

any

If no value is set, returns the source of the item image; otherwise, returns the toolbar item.


name

name(value?): any

Gets or sets the name of the item.

example

//This example adds a delete image with red text.
var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem();
tts.image("cut.png");
tts.name("C");
tts.text("Delete");
spread.touchToolStrip.add(tts, function(){ });
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");

Parameters

Name Type Description
value? string The name of the toolbar item.

Returns

any

If no value is set, returns the name of the item; otherwise, returns the toolbar item.


text

text(value?): any

Gets or sets the text of the item.

example

//This example adds a delete image with red text.
var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem();
tts.image("cut.png");
tts.name("C");
tts.text("Delete");
spread.touchToolStrip.add(tts, function(){ });
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");

Parameters

Name Type Description
value? string The text of the toolbar item.

Returns

any

If no value is set, returns the text of the item; otherwise, returns the toolbar item.