mi ritrovo sempre questo errore quando faccio il debug su Microsoft Surface pro, cosa che non capita su tradizionali computer da tavolo pentuim i5 (lenovo), e non so dove sbattere la testa.
I always find this mistake when I debug on Microsoft Surface pro, something that doesn't happen on traditional pentuim i5 (lenovo) desktop computers, and I don't know where to hit my head.
I always find this mistake when I debug on Microsoft Surface pro, something that doesn't happen on traditional pentuim i5 (lenovo) desktop computers, and I don't know where to hit my head.
B4X:
Waiting for debugger to connect...
Program started.
apr 14, 2020 9:35:13 PM com.sun.javafx.css.parser.CSSParser term
WARNING: CSS Error parsing file:/C:/Users/Surface%20Pro%204/Desktop/LavagbaB4XUI/Files/dark.css: Unexpected token ';' at [64,25]
Errore nella linea: 175 (Main)
java.lang.NullPointerException
at anywheresoftware.b4a.objects.B4XCanvas.DrawRect(B4XCanvas.java:93)
at b4j.example.main._linegroup(main.java:420)
at b4j.example.menusx._bt_action(menusx.java:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA$1.run(BA.java:216)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
incriminated code, again under B4XCanvas:
Sub iniGriglia As Boolean
griglia.Initialize(lavagna)
background( griglia, 252526)
Dim x0,y0,x1,y1
x0=0
y0=0
x1=0
y1=lavagna.Height
For i=0 To lavagna.Width
griglia.DrawLine(x0,y0,x1,y1,xui.Color_DarkGray,0.5)
x0 = x0+10
x1=x0
Next
x0=0
y0=0
x1=lavagna.Width
y1=0
For i=0 To lavagna.Height
griglia.DrawLine(x0,y0,x1,y1,xui.Color_DarkGray,0.5)
y0 = y0+10
y1=y0
Next
Return True
End Sub
'-------------------------- gioco di linee gruppo ----------------------------------------------------------
Sub iniGroup As Boolean
groupline.Initialize(lavagna)
background( groupline,252526)
Return True
End Sub
Sub LineGroup
Dim cvsRect As B4XRect
cvsRect.Left=0
cvsRect.Top=0
cvsRect.Width=lavagna.Width
cvsRect.Height=lavagna.Height
groupline.ClearRect(cvsRect)
groupline.Invalidate
background( groupline,252526)
If groupValue = False Then Return
'crea base rettangolare colorata
listSlave.Clear
listMaster.Clear
For i = 0 To lavagna.NumberOfViews-1
If lavagna.GetView(i) Is Button Then
Dim ls As List = lavagna.GetView(i).Tag
' leggo appartenenza se master or slave
If ls.Get(18) = "master" Then
listMaster.Add(ls)
Else
listSlave.Add(ls)
End If
' credo il rect da disegnare
Dim cvsRect As B4XRect
cvsRect.Left=lavagna.GetView(i).Left-1
cvsRect.Top=lavagna.GetView(i).Top-1
cvsRect.Width=lavagna.GetView(i).Width+2
cvsRect.Height=lavagna.GetView(i).Height+4
groupline.DrawRect(cvsRect,HexToColor(ls.Get(17)) , True,3)
groupline.Invalidate
End If
Next
Dim x,y,x2,y2 As Int
' crea linee gruppo
For i=0 To listMaster.Size-1
Dim lsM As List = listMaster.Get(i)
x = lsM.Get(0) +( lsM.Get(2)/2)
y = lsM.Get(1) +( lsM.Get(3)/2)
For ii=0 To listSlave.Size-1
Dim lsS As List = listSlave.Get(ii)
If lsS.Get(16) = lsM.Get(16) Then
x2=lsS.Get(0) + ( lsS.Get(2)/2)
y2=lsS.Get(1) + ( lsS.Get(3)/2)
groupline.DrawLine(x, y, x2, y2, HexToColor(lsS.Get(17)) ,1)
groupline.Invalidate
End If
Next
Next
End Sub
'------------------------------------------------------------- codici funzioni -----------------------------------------------
Private Sub ColorToHex(clr As Int) As String
Dim bc As ByteConverter
Return bc.HexFromBytes(bc.IntsToBytes(Array As Int(clr)))
End Sub
Private Sub HexToColor(Hex As String) As Int
Dim bc As ByteConverter
If Hex.StartsWith("#") Then
Hex = Hex.SubString(1)
Else If Hex.StartsWith("0x") Then
Hex = Hex.SubString(2)
End If
Dim ints() As Int = bc.IntsFromBytes(bc.HexToBytes(Hex))
Return ints(0)
End Sub
Public Sub background(cv As B4XCanvas, color As Int)
Dim cvsRect As B4XRect
cvsRect.Left=0
cvsRect.Top=0
cvsRect.Width=lavagna.Width
cvsRect.Height=lavagna.Height
cv.DrawRect(cvsRect,color , True,3)
cv.ClearRect(cvsRect)
cv.Invalidate
End Sub