This member of Class WaveLinkIO is supported on iOS, Windows Mobile, Windows CE, Palm, and DOS.
The LastExtendedType Method returns the extended type of the last input call. The extended type can be a barcode type or a widget ID.
Syntax
public int LastExtendedType()
Returns
The barcode type or widget ID of the last input call
Remarks
When processing input from a widget, use the LastExtendedType Method to obtain the widget ID. The widget ID is returned through a previous RFInput Method call.
The possible barcode types include:
B_UPC
CODABAR
CODE_11
CODE_39
CODE_93
CODE_128
CODE_D25
CODE_I25
D25_IATA
EAN_8
EAN_13
MSI
PDF_417
TO_39
UCC_128
UPC_A
UPC_E0
UPC_E1
WLNOSYMBOLOGY
See Constant Values for the numeric equates returned by the function.
Example
/**
* This source code is for demonstration purposes only and should be treated as such.
*
* NOTE: For this demo, we are assuming a 20x8 display area.
*/
package samplecode;
import com.wavelink.clientui.*;
import java.io.*;
public class IOSampleLastType extends WaveLinkApplication {
WaveLinkIO ioIface = new WaveLinkIO();
WaveLinkFactory factoryIface = new WaveLinkFactory();
WaveLinkWidgetCollection colIface = new WaveLinkWidgetCollection();
WaveLinkWidget widgetIfaceQuit;
WaveLinkWidget widgetIfaceKeepOn;
int quitID;
String resultStr;
public IOSampleLastType() throws WaveLinkError {
}
private void initialize() throws WaveLinkError {
// Create "Quit" widget and set the integer quitID to its widget ID.
widgetIfaceQuit = factoryIface.CreateButton(2, 2, 8, 1, "Quit", colIface);
widgetIfaceKeepOn = factoryIface.CreateButton(2, 5, 8, 1, "Keep on", colIface);
quitID = widgetIfaceQuit.getWidgetID();
colIface.StoreWidgets();
}
private void start() throws WaveLinkError{
try {
evaluate:
for ( ;; ) {
//Use RFInput or GetEvent to obtain input
resultStr = ioIface.GetEvent();
switch ( ioIface.LastInputType() ) {
case WaveLinkIO.WLCOMMANDTYPE:
//Process command type
McastSend.send("case WLCOMMANDTYPE") ;
break;
case WaveLinkIO.WLKEYTYPE:
//Process keyed command
McastSend.send("case WLKEYTYPE") ;
break;
case WaveLinkIO.WLWIDGETTYPE:
McastSend.send("case WLWIDGETTYPE") ;
if ( ioIface.LastExtendedType() == quitID ) {
//Quit button pressed, exit process
McastSend.send("LastExtendedType() == quitID") ;
break evaluate;
}
else {
McastSend.send("LastExtendedType() != quitID") ;
break;
}
}
}
}
catch ( WaveLinkError wlErr ) {
// Do error handling
}
}// initialize
public void WaveLinkMain( String arg[] )
{
try {
McastSend.send("Starting application 1" );
IOSampleLastType localObj = new IOSampleLastType();
localObj.initialize();
localObj.start();
}//try
catch ( WaveLinkError wlErr ) {
} // catch (WaveLinkError wlErr)
McastSend.send("Exiting application") ;
} // End of main
}
Was this article useful?
The topic was:
Inaccurate
Incomplete
Not what I expected
Other