# GC.Spread.Sheets.Touch.TouchToolStrip

## Content

# Class: TouchToolStrip

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

## Table of contents

### Constructors

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

### Methods

- [add](GC.Spread.Sheets.Touch.TouchToolStrip#add)
- [clear](GC.Spread.Sheets.Touch.TouchToolStrip#clear)
- [close](GC.Spread.Sheets.Touch.TouchToolStrip#close)
- [getItem](GC.Spread.Sheets.Touch.TouchToolStrip#getitem)
- [getItems](GC.Spread.Sheets.Touch.TouchToolStrip#getitems)
- [imageAreaHeight](GC.Spread.Sheets.Touch.TouchToolStrip#imageareaheight)
- [itemHeight](GC.Spread.Sheets.Touch.TouchToolStrip#itemheight)
- [itemWidth](GC.Spread.Sheets.Touch.TouchToolStrip#itemwidth)
- [open](GC.Spread.Sheets.Touch.TouchToolStrip#open)
- [remove](GC.Spread.Sheets.Touch.TouchToolStrip#remove)
- [separatorHeight](GC.Spread.Sheets.Touch.TouchToolStrip#separatorheight)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new TouchToolStrip**(`workbook`, `host`)

Represents a toolbar.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `workbook` | [`Workbook`](GC.Spread.Sheets.Workbook) | The Spread object. |
| `host` | `HTMLElement` | The host DOM element. |

## Methods

### <a id="add" name="add"></a> add

▸ **add**(`item`): `void`

Adds an item to the touch toolbar.

**`remarks`** The item to be added can be a toolbar item or a line separator.

**`example`**
```
//This example adds a custom item.
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ }))
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");
spread.touchToolStrip.imageAreaHeight(30);
spread.touchToolStrip.itemHeight(80);
spread.touchToolStrip.itemWidth(50);
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `item` | [`TouchToolStripSeparator`](GC.Spread.Sheets.Touch.TouchToolStripSeparator) \| [`TouchToolStripItem`](GC.Spread.Sheets.Touch.TouchToolStripItem) | The item to be added. |

#### Returns

`void`

___

### <a id="clear" name="clear"></a> clear

▸ **clear**(): `void`

Clears all items in the toolbar.

**`example`**
```
//This example uses the clear method.
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ }))
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");
spread.touchToolStrip.imageAreaHeight(30);
spread.touchToolStrip.itemHeight(80);
spread.touchToolStrip.itemWidth(50);
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
spread.touchToolStrip.clear();
```

#### Returns

`void`

___

### <a id="close" name="close"></a> close

▸ **close**(): `void`

Closes the toolbar.

#### Returns

`void`

___

### <a id="getitem" name="getitem"></a> getItem

▸ **getItem**(`name`): `any`

Gets the item with the specified name.

**`example`**
```
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 item name. |

#### Returns

`any`

If the item exists in the toolbar, the item is returned; otherwise, returns undefined.

___

### <a id="getitems" name="getitems"></a> getItems

▸ **getItems**(): `any`

Gets all the items that belong to the toolbar.

#### Returns

`any`

An array that contains all the items in the toolbar.

___

### <a id="imageareaheight" name="imageareaheight"></a> imageAreaHeight

▸ **imageAreaHeight**(`height?`): `any`

Gets or sets the image area height.

**`example`**
```
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ }))
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");
spread.touchToolStrip.imageAreaHeight(30);
spread.touchToolStrip.itemHeight(80);
spread.touchToolStrip.itemWidth(50);
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `height?` | `number` | The image area height. |

#### Returns

`any`

If no value is set, returns the image area height; otherwise, returns the toolbar.

___

### <a id="itemheight" name="itemheight"></a> itemHeight

▸ **itemHeight**(`height?`): `any`

Gets or sets the toolbar item height.

**`example`**
```
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ }))
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");
spread.touchToolStrip.imageAreaHeight(30);
spread.touchToolStrip.itemHeight(80);
spread.touchToolStrip.itemWidth(50);
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `height?` | `number` | The toolbar item height. |

#### Returns

`any`

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

___

### <a id="itemwidth" name="itemwidth"></a> itemWidth

▸ **itemWidth**(`width?`): `any`

Gets or sets the toolbar item width.

**`example`**
```
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ }))
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");
spread.touchToolStrip.imageAreaHeight(30);
spread.touchToolStrip.itemHeight(80);
spread.touchToolStrip.itemWidth(50);
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `width?` | `number` | The toolbar item width. |

#### Returns

`any`

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

___

### <a id="open" name="open"></a> open

▸ **open**(`x`, `y`): `void`

Opens a toolbar in a specific position relative to the touch point.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `x` | `number` | The <i>x</i>-coordinate. |
| `y` | `number` | The <i>y</i>-coordinate. |

#### Returns

`void`

___

### <a id="remove" name="remove"></a> remove

▸ **remove**(`name`): [`TouchToolStripItem`](GC.Spread.Sheets.Touch.TouchToolStripItem)

Removes the toolbar item with the specified name.

**`example`**
```
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());
spread.touchToolStrip.remove("Cut");
activeSheet.resumePaint();
activeSheet.repaint();
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | The name of the item to be removed. |

#### Returns

[`TouchToolStripItem`](GC.Spread.Sheets.Touch.TouchToolStripItem)

The removed item.

___

### <a id="separatorheight" name="separatorheight"></a> separatorHeight

▸ **separatorHeight**(`height?`): `any`

Gets or sets the toolbar separator height.

**`example`**
```
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.separatorHeight(33);
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `height?` | `number` | The toolbar separator height. |

#### Returns

`any`

If no value is set, returns the toolbar separator height; otherwise, returns the toolbar.
