Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Chapter 24: Property
Reference [Table of Contents] Chapter 26: Function
Reference

Pocket PowerBuilder Resource Guide and Reference

[-] Chapter 25: Event Reference

Chapter 25

Event Reference

About this chapter

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.

ScanTriggered

Description

Occurs when a scan operation is started.

Event ID

Event ID

Objects

None

BarcodeScanner objects

Arguments

None.

Return values

None.

Usage

Use this event with the ScanNoWait function and implement as an asynchronous (continuous) scan.

Examples

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() )

See also

ScanNoWait

SipUp

Description

Occurs when the Soft Input Panel (SIP) is opened.

Event ID

Event ID

Objects

pbm_sipup

Window

Arguments

Argument

Description

flags

UnsignedLong by value.

Values are:

  • 0 -- The SIP is off or not visible

  • 1 -- The SIP is visible

  • 2 -- The SIP is docked

  • 4 -- The SIP is locked and the user cannot change its visibility

Flags is the sum of all SIP states and statuses.

Return values

Long. Return code choices (specify in a RETURN statement):

Usage

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:

Examples

Example 1

In the window's SipUp event, this code returns the SIP type:

SIPIMType sType 
sType = GetSIPType()

See also

SipDown

Description

Occurs when the Soft Input Panel (SIP) is closed.

Event ID

Event ID

Objects

pbm_sipdown

Window

Arguments

Argument

Description

flags

UnsignedLong by value.

Values are:

  • 0 -- The SIP is off or not visible

  • 1 -- The SIP is visible

  • 2 -- The SIP is docked

  • 4 -- The SIP is locked and the user cannot change its visibility

Flags is the sum of all SIP states and statuses.

Return values

Long. Return code choices (specify in a RETURN statement):

Usage

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:

Examples

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

See also


Chapter 24: Property
Reference [Table of Contents] Chapter 26: Function
Reference