![]() | ![]() |
Home |
|
|
Pocket PowerBuilder Resource Guide and Reference |
|
| Chapter 25: Event Reference |
Chapter 25
This chapter describes events that are used in Pocket PowerBuilder but not in PowerBuilder.
You can find descriptions of all the properties, functions, events, and objects that are used in Pocket PowerBuilder and PowerBuilder in the online Help.
Occurs when a scan operation is started.
Event ID | Objects |
None | BarcodeScanner objects |
None.
None.
Use this event with the ScanNoWait function and implement as an asynchronous (continuous) scan.
Example 1
The following code in the ScanTriggered event implements continuous scanning:
// Bar code trigger
// A scan event (typically read) has occured
int iRet
int itmp
string stmp
lb_res.AddItem( "==== Scan Triggered ====" )
lb_res.AddItem("Data: " + this.ScannerName )iRet = this.RetrieveData()
lb_res.AddItem("RetrieveData: " + string(iRet) )// ** Display the status **
choose case iRet
case 1
lb_res.AddItem("*SUCCESS*")case -9
// common
lb_res.AddItem("*Incorrect State (aborted?)")case -13
// common
lb_res.AddItem("*Timeout (benign)")case -12
// common
lb_res.AddItem("*Read Cancelled")// ** and the rare errors **
case -1
lb_res.AddItem("*ERR - General")case -8
lb_res.AddItem("*ERR - Buffer Allocation")case -10
lb_res.AddItem("*ERR - Device")case -11
lb_res.AddItem("*ERR - Read Pending")case else
lb_res.AddItem("*ERR - Other")end choose
// ** Display the data **
if iRet = 1 then
// Data:
stmp = this.ScannedData
lb_res.AddItem("Data: " + stmp )// Symbology:
itmp = this.ScannedSymbology
stmp = this.Decodername(itmp)
lb_res.AddItem("Symbology: " + string(itmp) + " : "&
+ stmp )// TimeStamp:
stmp = STRING( this.ScannedTimeStamp, "hh:mm:ss" )
lb_res.AddItem("TimeStamp: " + stmp )end if
// ** Continue? **
if cbx_rearm.checked then
iRet = this.ScanNoWait()
lb_res.AddItem("ScanNoWait: " + string(iRet) )end if
lb_res.SelectItem( lb_res.totalitems() )
ScanNoWait
Occurs when the Soft Input Panel (SIP) is opened.
Event ID | Objects |
pbm_sipup | Window |
Argument | Description |
flags | UnsignedLong by value. Values are:
Flags is the sum of all SIP states and statuses. |
Long. Return code choices (specify in a RETURN statement):
0 Continue processing
Because flags is a sum, you can determine the SIP state and status by subtracting the largest values one by one and checking the value that remains. For example:
If flags is 4, the SIP is locked (4), but not docked or visible.
If flags is 5, the SIP is locked (4) and visible (1), but not docked.
If flags is 7, the SIP is locked (4), docked (2), and visible (1).
Example 1
In the window's SipUp event, this code returns the SIP type:
SIPIMType sType
sType = GetSIPType()
Occurs when the Soft Input Panel (SIP) is closed.
Event ID | Objects |
pbm_sipdown | Window |
Argument | Description |
flags | UnsignedLong by value. Values are:
Flags is the sum of all SIP states and statuses. |
Long. Return code choices (specify in a RETURN statement):
0 Continue processing
Because flags is a sum, you can determine the SIP state and status by subtracting the largest values one by one and checking the value that remains. For example:
If flags is 4, the SIP is locked (4), but not docked or visible.
If flags is 5, the SIP is locked (4) and visible (1), but not docked.
If flags is 7, the SIP is locked (4), docked (2), and visible (1).
Example 1
In the window's SipDown event, this code gets the coordinates of the window and displays them in a multiline edit box:
String strDisplay="" int rc
long left = 0, top = 0, right = 0, bottom = 0rc = GetDeskRect(left, top, right, bottom)
strDisplay +=("Desk RECT:~r~n~t Left = " +string(left)& +"~r~n~t Top=" + String(top) + "~r~n~t Right = " &
+ String(right)+ "~r~n~t Bottom = " + String(bottom))mle_1.text = strDisplay|
|