I have a grid, created by a BASIC macro, that needs to contain 4 columns. I fail to match the width of the grid with the width of the columns :
const kWidthCol1 = 30
const kWidthCol2 = 50
const kWidthCol3 = 10
const kWidthCol4 = 75
...
hEventGrid = makeGrid (hDialog, "ttt", 20, 20, kWidthCol1+kWidthCol2+kWidthCol3+kWidthCol4, 150)
hColumn1 = makeColumn (hEventGrid, "Datum", kWidthCol1)
... etc
function makeGrid (oDlg, Title, x, y, w, h) as object
dim oGridControl as object
dim oGridModel as object
oGridControl = createUnoService ("com.sun.star.awt.grid.UnoControlGrid")
' oGridModel = oDlg.createInstance ("com.sun.star.awt.grid.UnoControlGridModel")
oGridModel = createUnoService ("com.sun.star.awt.grid.UnoControlGridModel")
oGridModel.useGridLines = true
oGridControl.setModel(oGridModel)
oGridControl.setPosSize (x, y, w, h, com.sun.star.awt.PosSize.POSSIZE)
oDlg.addControl (Title, oGridControl)
makeGrid = oGridControl
end function
function makeColumn (table, title, width) as object
dim col as object
col = createUnoService ("com.sun.star.awt.grid.GridColumn")
col.Title = title
col.columnWidth = width
col.maxWidth = width
col.minWidth = width
col.Resizeable = false
table.model.ColumnModel.addColumn (col)
makeColumn = col
end function
Resulting in a grid that is far too small :
This suggests to me that the width of the grid is using a different unit than the width of the columns. If so, what is the relation between these two units ?