# GC.Spread.Sheets.Touch.TouchToolStripItem

## Content

# Class: TouchToolStripItem

[Sheets](../modules/GC.Spread.Sheets).[Touch](../modules/GC.Spread.Sheets.Touch).TouchToolStripItem

## Table of contents

### Constructors

- [constructor](GC.Spread.Sheets.Touch.TouchToolStripItem#constructor)

### Methods

- [font](GC.Spread.Sheets.Touch.TouchToolStripItem#font)
- [foreColor](GC.Spread.Sheets.Touch.TouchToolStripItem#forecolor)
- [image](GC.Spread.Sheets.Touch.TouchToolStripItem#image)
- [name](GC.Spread.Sheets.Touch.TouchToolStripItem#name)
- [text](GC.Spread.Sheets.Touch.TouchToolStripItem#text)

## Constructors

### <a id="constructor" name="constructor"></a> 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

### <a id="font" name="font"></a> 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 |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

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

___

### <a id="forecolor" name="forecolor"></a> 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 |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

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

___

### <a id="image" name="image"></a> 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 |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

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

___

### <a id="name" name="name"></a> 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 |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

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

___

### <a id="text" name="text"></a> 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 |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

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