[]
        
(Showing Draft Content)

GC.Spread.Sheets.Touch.TouchToolStrip

Class: TouchToolStrip

Sheets.Touch.TouchToolStrip

Table of contents

Constructors

Methods

Constructors

constructor

new TouchToolStrip(workbook, host)

Represents a toolbar.

Parameters

Name Type Description
workbook Workbook The Spread object.
host HTMLElement The host DOM element.

Methods

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 | TouchToolStripItem The item to be added.

Returns

void


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


close

close(): void

Closes the toolbar.

Returns

void


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.


getItems

getItems(): any

Gets all the items that belong to the toolbar.

Returns

any

An array that contains all the items in the toolbar.


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.


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.


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.


open

open(x, y): void

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

Parameters

Name Type Description
x number The x-coordinate.
y number The y-coordinate.

Returns

void


remove

remove(name): 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

The removed item.


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.