Touchscreen Control on Custom Screen

Touchscreen Control on Custom Screen

Introduction

This knowledge base article will assist developers about how to customise a Touchscreen Control in a Custom Screen used in the iVend Retail Point of Sale (POS) using the iVend Retail Add-on Extensibility Framework.Sale.

Environment:

iVend Version 6.5

Purpose

The iVend Retail Add-on Extensibility Framework allows developers to add Touchscreen functionality to Custom Screens at the iVend POS.

Adding Touchscreen Control to a Custom Screen for the POS

Sample of code for adding a Touchscreen Control on a POS Custom Screen:
using System;
using System.Collections.Generic;
using CXSRetailPOS;
using DevExpress.XtraVerticalGrid.Rows;
using CXS.Platform.UI.TouchScreen;
namespace POSTouchScreenSample
{
public partial class POSCustomScreen : BasePOSCustomView
{
List<DumyCustomer> m_CustomerList = null;
#region Event functions
public enum EventType
{
Ok,
Cancel
}
public class EventArgs : System.EventArgs
{
public EventType EventType;
public EventArgs(EventType eventType)
{
EventType = eventType;
}
}
public delegate void EventHandler(object sender, EventArgs args);
public event EventHandler OnEvent;
#endregion // Event functions
public POSCustomScreen()
{
InitializeComponent();
Title = "Custom Customer Search";
m_Button11.Visible = true;
m_Button11.Text = "Ok";
m_Button11.Click += new System.EventHandler(OkButtonClickHandler);
m_Button12.Visible = true;
m_Button12.Text = "Cancel";
m_Button12.Click += new System.EventHandler(CancelButtonClickHandler);
if (m_CustomerList == null) m_CustomerList = new List<DumyCustomer>();
m_CustomerList.Add(new DumyCustomer("test Customer", 15, DateTime.Today));
m_vGridControl.DataSource = m_CustomerList;
}
protected override void TextEntryViewEventHandler(object sender, CXSTextEntryView.EventArgs args)
{
if (args.EventType == CXSTextEntryView.EventType.Ok)
{
m_RowCustomerName.Properties.Value = m_TextEntryView.Value;
}
}
protected override void NumberEntryViewEventHandler(object sender, CXSNumberEntryView.EventArgs args)
{
if (args.EventType ==CXSNumberEntryView.EventType.Ok)
{
m_rowCustomerAge.Properties.Value = m_NumberEntryView.Value;
}
}
protected override void DateEntryViewEventHandler(object sender, CXSDateEntryView.EventArgs args)
{
if (args.EventType == CXSDateEntryView.EventType.Ok)
{
m_rowCustomerBirthDate.Properties.Value = m_DateEntryView.Value;
}
}
private void OkButtonClickHandler(object sender, System.EventArgs e)
{
FireDoneEvent(new EventArgs(EventType.Ok));
}
private void CancelButtonClickHandler(object sender, System.EventArgs e)
{
FireDoneEvent(new EventArgs(EventType.Cancel));
}
protected virtual void FireDoneEvent(EventArgs args)
{
StopBlocking(args);
if (OnEvent != null)
OnEvent(this, args);
}
private void m_vGridControl_FocusedRowChanged(object sender, DevExpress.XtraVerticalGrid.Events.FocusedRowChangedEventArgs e)
{
if (e.Row == null) return;
HandleFocussedRow(e.Row as EditorRow);
}
private void HandleFocussedRow(EditorRow row)
{
if (row == null) return;
// Setup View for new row
if (row == m_RowCustomerName)
{
ShowTextEntryView(m_RowCustomerName.Properties.Value.ToString(), 100, false);
}
else if (row == m_rowCustomerAge)
{
ShowNumberEntryView(Convert.ToDecimal(m_rowCustomerAge.Properties.Value), CXS.Platform.UI.TouchScreen.NumberPadModes.Int);
}
else if (row == m_rowCustomerBirthDate)
{
ShowDateEntryView(m_rowCustomerBirthDate.Properties.Value.ToString());
}
else
{
ShowXMarkView();
}
}
}
}
The following screen image illustrates the results from the above provided sample code:



    • Related Articles

    • Creating custom search screen

      Introduction iVend Add-on Framework is used for writing Custom Business Logic independently by a programmer. iVend Addon allows to extend business logic either in Management Console or at the Terminal POS.The addon framework allows deployment of ...
    • POS - Create Custom screen

      Introduction iVend Add-on Framework is used for writing Custom Business Logic independently by a programmer. iVend Addon allows to extend business logic either in Management Console or at the Terminal POS.The addon framework allows deployment of ...
    • POS - Create Custom screen

      Introduction: iVend Add-on Framework is used for writing Custom Business Logic independently by a programmer. iVend Addon allows to extend business logic either in Management Console or at the Terminal POS. The addon framework allows deployment of ...
    • MC - Create Custom Screen

      Introduction iVend Add-on Framework is used for writing Custom Business Logic independently by a programmer. iVend Addon allows to extend business logic either in Management Console or at the Terminal POS. The addon framework allows deployment of ...
    • Creating custom search screen

      Introduction: iVend Add-on Framework is used for writing Custom Business Logic independently by a programmer. iVend Addon allows to extend business logic either in Management Console or at the Terminal POS. The addon framework allows deployment of ...