Post by metro on Aug 21, 2020 21:12:20 GMT -5
It could be just me but I see some strange behavior.
increasing the width of rowlabelwidth only pushes the whole GRID across on its "x" axis
labels do not move, so I cannot get labels centred to the column data.
It seems the columnwidths are also affected by the change in rowlabelwidth
nomainwin
dim A$(23)
dim result$(6,25)
A$(0)= "IBM|7029B|38946|119.95"
A$(1)= "IBM|1029A|38945|19.95"
A$(2)= "Commodore|VIC-20|84545|299.95"
A$(3)= "IBM|1029A|38945|19.95"
A$(4)= "Commodore|VIC-20|84545|299.95"
A$(5)= "IBM|1029A|38945|19.95"
A$(6)= "Commodore|VIC-20|84545|299.95"
A$(7)="IBM|1029A|38945|19.95"
A$(8)="Commodore|VIC-20|84545|299.95"
A$(9)= "IBM|1029A|38945|19.95"
A$(10)= "Commodore|VIC-20|84545|299.95"
A$(11)= "IBM|1029A|38945|19.95"
A$(12)= "Commodore|VIC-20|84545|299.95"
A$(13)= "IBM|1029A|38945|19.95"
A$(14)= "Commodore|VIC-20|84545|299.95"
A$(15)= "IBM|1029A|38945|19.95"
A$(16)= "Commodore|VIC-20|84545|299.95"
A$(17) = "IBM|1029A|38945|19.95"
A$(18)= "Commodore|VIC-20|84545|299.95"
A$(19)= "IBM|1029A|38945|19.95"
A$(20)= "Commodore|VIC-20|84545|299.95"
A$(21)= "IBM|1029A|38945|19.95"
A$(22)= "Commodore|VIC-20|84545|1299.95"
'***********************************************
'ROW NAMES
'***********************************************
for n=1 to 23
Rownames$=Rownames$+","+str$(n)
next
lenR=len(Rownames$)
Rownames$=right$(Rownames$,lenR-1)
'***********************************************
'***********************************************
'Load Data
'***********************************************
for x = 0 to 6
for y = 0 to 22
c$(x)= word$(A$(y),x+1,"|")
c$(x)=trim$(c$(x))
result$(x,y)= c$(x) '+ str$(y)
next
next
'***********************************************
WindowWidth = 800
WindowHeight = 500
grid #w.grid, result$(), [clicked], 25, 30, 600, 300
open "Grid test" for window as #w
#w.grid columnnames("MAKE", "MODEL", "SERIAL No", "COST")
#w.grid columnwidths(120)
#w.grid rowlabelwidth(50)
a = eval("#w.grid rownames("+Rownames$+")")
' #w.grid selectxy(2, 2)
' print #w.grid value$()
' #w.grid setvalue("yahoo")
' print #w.grid value$()
' print #w.grid debug$()
wait
[clicked]
notice "clicked: "; #w.grid cellxy$()
' print "clicked: "; #w.grid cellxy$()
wait
end