Setupbuilder problem...or not

jschuchert

Active Member
Licensed User
Longtime User
I have used setupbuilder many times without a hitch. Tonight it would not cooperate until I removed the manual which I had included previously. It would not build the cab files (they stopped building after a message with the word 'sections' in it). Of course, ezsetup didn't work either because it was looking for the cab files.

The app exe is 456 kb and the manual is 90 kb in doc format which it handled before.

15 minutes later...while doing it again (3rd time) so I could read the line with 'sections', it worked. Go figure. What could have been the problem?

Incidentally, which dll must be included in the cabs in order for 'drawstring' to show text on the device? It does on the desktop without anything but form.lib, the same as it does using the application exe on the desktop. Nothing on the device.

Jim Schuchert
 

derez

Expert
Licensed User
Longtime User
For the second question - something I always forget to do - have you included a refresh command after drawing the string ?
 

jschuchert

Active Member
Licensed User
Longtime User
Thanks for the help derez but that doesn't work. I want to show the point numbers for corners of a figure I have plotted. The points show when executing on the desktop through the IDE but not on either my Ipaq, Dell Axim or the emulator. Here is the code:
B4X:
Sub btnPlotDataOK_Click
screenW=txtscreenw.Text 
screenH=txtscreenH.Text 
crd()=StrSplit(txtulcoord.Text,"-")
upltx=crd(0)
uplty=crd(1)
crd()=StrSplit(txtlrcoord.Text ,"-")
lwrtx=crd(0)
lwrty=crd(1)
ppts=txtplotpoints.Text
pts()=StrSplit(ppts,"-")
x=ArrayLen(pts())
'For i=1 To ArrayLen(ppts)
'FileClose(c)
FileOpen(c,strfilename,cRead)
lineoftext=FileRead(c)
Do Until lineoftext=EOF
coord()=StrSplit(lineoftext,",")
If coord(0)=pts(0) Then
dblnorth=coord(1)
dbleast=coord(2)
x1=(dbleast-upltx)/(lwrtx-upltx) * screenW
y1=(uplty-dblnorth)/(uplty-lwrty)* screenH
Exit 
End If
lineoftext=FileRead(c)
Loop
'crd()=StrSplit(txtplotpoints.Text ,"-")
FileClose(c)
For i=1 To ArrayLen(pts())-1
j=j+1
FileClose(c)
FileOpen(c,strfilename,cRead)
lineoftext=FileRead(c)
Do Until lineoftext=EOF
coord()=StrSplit(lineoftext,",")
If coord(0)= pts(j) Then
dblnorth=coord(1)
dbleast=coord(2)
x2=(dbleast-upltx)/(lwrtx-upltx) * screenW
y2=(uplty-dblnorth)/(uplty-lwrty)* screenH
Exit 
End If
lineoftext=FileRead(c)
Loop
frmPlotPoints.Show 
frmPlotPoints.Line (x1,y1,x2,y2,cBlack)
frmplotpoints.drawstring(coord(0),8,x2,y2,x2,y2,cBlack)
frmplotpoints.Refresh 
x1=x2
y1=y2
Next
FileClose(c)
End Sub

Since the plotting is done on another form, I also put a 'refresh' button there but without success. The lines plot fine.

Jim Schuchert
 

klaus

Expert
Licensed User
Longtime User
Hi Jim,

Your problem is the following, in this line:
B4X:
frmplotpoints.drawstring(coord(0),8,x2,y2,x2,y2,cBlack)
you have for x1 and x2 the value x2, that means you don't allow any width for the string display, same for y1 and y2 !

use this line:
B4X:
frmplotpoints.drawstring(coord(0),8,x2,y2,x2+200,y2+50,cBlack)

Why x2+200? To leave enough room to display on one line.
If the width, x2-x1, is smaller than the text width, DrawString will display the text multiline.

Best regards.
 

jschuchert

Active Member
Licensed User
Longtime User
I found the problem. In the drawstring line, if I put "x2,y2,400,400" then point numbers plot correctly. On the desktop I can use x2,y2,x2,y2 but not on the device or emulator. No further setupbuilder glitches.

Jim Schuchert
 

jschuchert

Active Member
Licensed User
Longtime User
Thanks, Klaus. I used the example from 'Help' and it is working. I would have used your solution if I had not stumbled upon mine. They both have the same results. Why does the x2,y2,x2,y2 work in the IDE version on the desktop?

Jim
 

jschuchert

Active Member
Licensed User
Longtime User
Another reason to always make sure it works on the device before deploying. Thanks again for your comments.

Jim
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…