It is a barcode reading plugin from here:
https://www.npmjs.com/package/org.madmo ... barscanner
Any help would be appreciated!
Code: Select all
Import "cordova plugins add cordova-plugin-cszbar"
EndImport
Procedure Events()
Select EventGadget()
Case 0
VibrateDevice(1000)
Case 1
Debug DeviceInfo(#PB_Device_Model)
Debug DeviceInfo(#PB_Device_Platform)
Debug DeviceInfo(#PB_Device_UUID)
Debug DeviceInfo(#PB_Device_Version)
Debug DeviceInfo(#PB_Device_Manufacturer)
Debug DeviceInfo(#PB_Device_Serial)
Case 2
Debug BatteryLevel()
Case 3
Debug "AccelerometerX: " + AccelerometerX()
Debug "AccelerometerY: " + AccelerometerY()
Debug "AccelerometerZ: " + AccelerometerZ()
Debug "AccelerometerTime: " + AccelerometerTime()
Case 4
Debug "GeolocationLatitude: " + GeolocationLatitude()
Debug "GeolocationLongitude: " + GeolocationLongitude()
Debug "GeolocationAltitude: " + GeolocationAltitude()
Debug "GeolocationSpeed: " + GeolocationSpeed()
Debug "GeolocationHeading: " + GeolocationHeading()
Debug "GeolocationTime: " + GeolocationTime()
Case 5
; THIS IS WHERE I AM RUNNING THE PLUGIN.
; --------------------------------------
!cloudSky.zBar.scan({text_title: "Title Text"}, function (success) { v_sb = success;
Debug sb.s
!}, function(failure) { v_sb = failure;
Debug sb.s
!});
EndSelect
EndProcedure
Procedure OnSizeDesktop()
Debug "size desktop"
ExamineDesktops()
Debug "DesktopWidth(): " + DesktopWidth(0)
Debug "DesktopHeight(): " + DesktopHeight(0)
EndProcedure
OpenWindow(0, 0, 0, 300, 350, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 0, 0, 300, 25, "Vibrate")
ButtonGadget(1, 0, 30, 300, 25, "SystemInfo")
ButtonGadget(2, 0, 60, 300, 25, "BatteryLevel")
ButtonGadget(3, 0, 90, 300, 25, "Accelerometer")
ButtonGadget(4, 0, 120, 300, 25, "Geolocation")
ButtonGadget(5, 0, 120, 300, 25, "Barcode")
StringGadget(6, 0, 150, 300, 50, "Geolocation", #PB_String_PlaceHolder)
StartAccelerometer(100)
StartGeolocation(30000)
BindEvent(#PB_Event_Gadget, @Events())
BindEvent(#PB_Event_SizeDesktop, @OnSizeDesktop())