PenSelectable Property

Description

Indicates whether or not the field is pen-selectable.
 

Applies To Objects

Field
 

Syntax

Field.PenSelectable
 

Return Values

True if the field is pen-selectable, otherwise false. Read only boolean value.
 

Sample VB Code

Public AllSessions As OhioSessions
Public WithEvents MySession As OhioSession
Public MyScreen As OhioScreen

Private Sub Form_Load()

Set AllSessions = New OhioSessions
Set MySession = AllSessions.AddSession("C:\test.zcc", 1)
Set MyScreen = MySession.Screen

MySession.Connect

End Sub

Private Sub cmdGetField_Click()

Dim AllFields As OhioFields
Dim MyField As OhioField
Dim aData As Variant
Dim strText As String

Set AllFields = MyScreen.Fields
Set MyField = AllFields.Item(1)
With MyField

' get the text plane
aData = .GetData(OHIO_PLANE_TEXT)
For i = 0 To UBound(aData)

strText = strText & Chr(aData(i))

Next i

MsgBox _

"First Field" & vbNewLine & _
"   Start = " & .Start & vbNewLine & _
"   End = " & .End & vbNewLine & _
"   Length = " & .Length & vbNewLine & _
"   Protected = " & .Protected & vbNewLine & _
"   Hidden = " & .Hidden & vbNewLine & _
"   Modified = " & .Modified & vbNewLine & _
"   Numeric = " & .Numeric & vbNewLine & _
"   Attribute = " & .Attribute & vbNewLine & _
"   High Intensity = " & .HighIntensity & vbNewLine & _
"   PenSelectable = " & .PenSelectable & vbNewLine & _
"   String (first 80 chars) = " & Left(.String, 80) & vbNewLine & _
"   GetData (first 80 chars) = " & Left(strText, 80)

End With

End Sub

Private Sub Form_Unload(Cancel As Integer)

MySession.Disconnect
AllSessions.CloseSession MySession.SessionName

End Sub

Public AllSessions As OhioSessions
Public WithEvents MySession As OhioSession
Public MyScreen As OhioScreen

Private Sub Form_Load()

Set AllSessions = New OhioSessions
Set MySession = AllSessions.AddSession("C:\test.zcc", 1)
Set MyScreen = MySession.Screen

MySession.Connect

End Sub

Sample C++ Code

#define OHIO_UPDATE_HOST 0
#define OHIO_UPDATE_CLIENT 1
#define OHIO_PLANE_TEXT 1
#define OHIO_PLANE_COLOR 2
#define OHIO_PLANE_FIELD 4

#define OHIO_PLANE_EXTENDED 8

BEGIN_DISPATCH_MAP(CMyView, CView)

DISP_FUNCTION_ID(CMyView, "OnScreenChanged",  1, OnScreenChanged,  VT_EMPTY, VTS_I4 VTS_I4 VTS_I4)

END_DISPATCH_MAP()

void CMyView::OnScreenChanged(long iUpdate, long iStart, long iEnd)
{

if ( iUpdate == OHIO_UPDATE_HOST )
{

IOhioFields AllFields = m_MyScreen.GetFields();
IOhioField MyField = AllFields.GetItem( 1 );

VARIANT vData;
BSTR HUGEP *pArray;
HRESULT hr;
char szFieldData[81];

// get first row of data
vData = MyField.GetData( OHIO_PLANE_TEXT );
// Get a pointer to the elements of the array.
hr = SafeArrayAccessData( vData.parray, (void HUGEP**)&pArray );
if ( SUCCEEDED(hr) )
{

memcpy( szFieldData, pArray, 80 );
szFieldData[80] = '\0';
SafeArrayUnaccessData( vData.parray);

}
TRACE( "First Field\n"

"   Start = %d\n"
"   End = %d\n"
"   Length = %d\n"
"   Protected = %d\n"
"   Hidden = %d\n"
"   Modified = %d\n"
"   Numeric = %d\n"
"   Attribute = %d\n"
"   High Intensity = %d\n"
"   PenSelectable = %d\n"
"   String (first 80 chars) = %s\n"
"   GetData (first 80 chars) = %s\n",
MyField.GetStart(),
MyField.GetEnd(),
MyField.GetLength(),
MyField.GetProtected(),
MyField.GetHidden(),
MyField.GetModified(),
MyField.GetNumeric(),
MyField.GetAttribute(),
MyField.GetHighIntensity(),
MyField.GetPenSelectable(),
MyField.GetString().Left(80),
szFieldData );

}

}

Sample C# Code

try

{

PASSHIOLib.IOhioFields AllFields = screen.Fields;

PASSHIOLib.IOhioField MyField = AllFields[1];

System.Array aData = (System.Array)MyField.GetData (PASSHIOLib.OHIO_PLANE.OHIO_PLANE_TEXT);

String strFieldData = "";

for (int i = 0; i < aData.Length; i++)

strFieldData += Convert.ToChar (aData.GetValue (i));

MessageBox.Show ("First Field" +

"\n   Start = " + MyField.Start +

"\n   End = " + MyField.End +

"\n   Length = " + MyField.Length +

"\n   Protected = " + MyField.Protected +

"\n   Hidden = " + MyField.Hidden +

"\n   Modified = " + MyField.Modified +

"\n   Numeric = " + MyField.Numeric +

"\n   Attribute = " + MyField.Attribute +

"\n   High Intensity = " + MyField.HighIntensity +

"\n   PenSelectable = " + MyField.PenSelectable +

"\n   String = " + MyField.String +

"\n   GetData = " + strFieldData);

}

catch (Exception ex)

{

MessageBox.Show ("Exception: " + ex);

}