BBjGrid::setDefaultAlignment

Description

Sets the default alignment for all of the cells in the BBjGrid.

Syntax

Return Value Method

void

setDefaultAlignment(int align)

Parameters

Variable

Description

align

Specifies the alignment from one of the following listed below:

Align value constants:

GRID_ALIGN_LEFT

GRID_ALIGN_RIGHT

GRID_ALIGN_CENTER

Return Value

None.

Remarks

The default grid alignment is centered.

Example

rem ' BBjGrid::setDefaultAlignment

title$ = "BBjGrid::setDefaultAlignment"
rows = 8
cols = 3

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(50,50,400,400,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")

grid! = window!.addGrid(100,25,25,350,300,$8042$,rows,cols)
grid!.setLineColor(BBjColor.BLUE)
grid!.setDefaultColumnWidth(115)
grid!.setRowHeight(30)
grid!.setGridEditable(1)

align = grid!.GRID_ALIGN_CENTER
gosub fill

group! = window!.addRadioGroup()

flags$ = iff(align=grid!.GRID_ALIGN_LEFT,$0024$,$0020$)
left! = window!.addRadioButton(101,25,350,100,25,"Left",flags$)
group!.add(left!)
left!.setCallback(left!.ON_CHECK_ON,"left")

flags$ = iff(align=grid!.GRID_ALIGN_CENTER,$0024$,$0020$)
center! = window!.addRadioButton(102,150,350,100,25,"Center",flags$)
group!.add(center!)
center!.setCallback(center!.ON_CHECK_ON,"center")

flags$ = iff(align=grid!.GRID_ALIGN_RIGHT,$0024$,$0020$)
right! = window!.addRadioButton(103,275,350,100,25,"Right",flags$)
group!.add(right!)
right!.setCallback(left!.ON_CHECK_ON,"right")

process_events

eoj:
release

left:
  grid!.setDefaultAlignment(grid!.GRID_ALIGN_LEFT)
  grid!.setColumnHeaderAlignment(grid!.GRID_ALIGN_LEFT)
  gosub fill
return

center:
  grid!.setDefaultAlignment(grid!.GRID_ALIGN_CENTER)
  grid!.setColumnHeaderAlignment(grid!.GRID_ALIGN_CENTER)
  gosub fill
return

right:
  grid!.setDefaultAlignment(grid!.GRID_ALIGN_RIGHT)
  grid!.setColumnHeaderAlignment(grid!.GRID_ALIGN_RIGHT)
  gosub fill
return

fill:
  for col = 0 to cols-1
    grid!.setColumnHeaderCellText(col,str(col))
    for row = 0 to rows-1
      text$ = str(row) + "," + str(col)
      grid!.setCellText(row,col,text$)
    next row
  next col
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.