[]
• new TouchToolStrip(workbook
, host
)
Represents a toolbar.
Name | Type | Description |
---|---|---|
workbook |
Workbook |
The Spread object. |
host |
HTMLElement |
The host DOM element. |
▸ 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());
Name | Type | Description |
---|---|---|
item |
TouchToolStripSeparator | TouchToolStripItem |
The item to be added. |
void
▸ 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();
void
▸ close(): void
Closes the toolbar.
void
▸ 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());
Name | Type | Description |
---|---|---|
name |
string |
The item name. |
any
If the item exists in the toolbar, the item is returned; otherwise, returns undefined.
▸ getItems(): any
Gets all the items that belong to the toolbar.
example
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("OP1", "OP1", "op1.png", function(){ }))
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("OP2", "OP2", "op2.png", function(){ }))
// Gets all the items that belong to the toolbar.
console.log(spread.touchToolStrip.getItems());
any
An array that contains all the items in the toolbar.
▸ 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());
Name | Type | Description |
---|---|---|
height? |
number |
The image area height. |
any
If no value is set, returns the image area height; otherwise, returns the toolbar.
▸ 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());
Name | Type | Description |
---|---|---|
height? |
number |
The toolbar item height. |
any
If no value is set, returns the toolbar item height; otherwise, returns the toolbar.
▸ 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());
Name | Type | Description |
---|---|---|
width? |
number |
The toolbar item width. |
any
If no value is set, returns the toolbar item width; otherwise, returns the toolbar.
▸ open(x
, y
): void
Opens a toolbar in a specific position relative to the touch point.
Name | Type | Description |
---|---|---|
x |
number |
The x-coordinate. |
y |
number |
The y-coordinate. |
void
▸ 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();
Name | Type | Description |
---|---|---|
name |
string |
The name of the item to be removed. |
The removed item.
▸ 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());
Name | Type | Description |
---|---|---|
height? |
number |
The toolbar separator height. |
any
If no value is set, returns the toolbar separator height; otherwise, returns the toolbar.