public class SelectAction : GrapeCity.Win.Spread.InputMan.CellType.ITouchBarAction
{
public bool CanExecute(object target)
{
GrapeCity.Win.Spread.InputMan.CellType.EditBase owner = target;
if (owner == null)
{
return false;
}
return true;
}
public void Execute(object target)
{
GrapeCity.Win.Spread.InputMan.CellType.EditBase owner = target;
owner.SelectAll();
}
}
public class DeselectAction : GrapeCity.Win.Spread.InputMan.CellType.ITouchBarAction
{
public bool CanExecute(object target)
{
GrapeCity.Win.Spread.InputMan.CellType.EditBase owner = target;
if (owner == null)
{
return false;
}
return true;
}
public void Execute(object target)
{
GrapeCity.Win.Spread.InputMan.CellType.EditBase owner = target;
owner.DeselectAll();
}
}
private void Form1_Load(object sender, EventArgs e)
{
GrapeCity.Win.Spread.InputMan.CellType.TouchToolBarButton selectBtn = new GrapeCity.Win.Spread.InputMan.CellType.TouchToolBarButton(new SelectAction(), "test1", null);
GrapeCity.Win.Spread.InputMan.CellType.TouchToolBarButton deselectBtn = new GrapeCity.Win.Spread.InputMan.CellType.TouchToolBarButton(new DeselectAction(), "test2", null);
GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType imtc = new GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType();
imtc.ShowTouchToolBar = GrapeCity.Win.Spread.InputMan.CellType.TouchToolBarDisplayOptions.TapSelection | GrapeCity.Win.Spread.InputMan.CellType.TouchToolBarDisplayOptions.TapGripper;
imtc.TouchToolBar.Items.Clear();
imtc.TouchToolBar.Items.AddRange(new ToolStripItem[] {
selectBtn,
new ToolStripSeparator(),
deselectBtn
});
fpSpread1.ActiveSheet.Columns[0].CellType = imtc;
}