BBjGrid::setRowVerticalAlignment

Description

In BBj 18.00 and higher, this method sets the vertical alignment for all cells in a BBjGrid row.

Syntax

Return Value Method
void setRowVerticalAlignment(int row, int align)

Parameters

Parameter Description
row Specifies the zero-based row index.
align

Specifies the cell vertical alignment from one of the following Align Value Constants:

  • GRID_ALIGN_TOP
  • GRID_ALIGN_CENTER
  • GRID_ALIGN_BOTTOM

Return Value

None.

Remarks

The default vertical alignment is GRID_ALIGN_CENTER.

In the GUI client, vertical alignment is only meaningful for the following non-editable cell styles:

Constant Cell Style
GRID_STYLE_BUTTON_DOWN Recessed button
GRID_STYLE_BUTTON_UP Raised button
GRID_STYLE_CHECKED Checked checkbox
GRID_STYLE_LABEL Label
GRID_STYLE_TEXT Text field
GRID_STYLE_UNCHECKED Unchecked checkbox

Example

rem ' BBjGrid::setRowVerticalAlignment
sysgui! = bbjapi().openSysGui("X0")
title$ = "BBjGrid::setRowVerticalAlignment"
window! = sysgui!.addWindow(25,25,800,600,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")
styles! = window!.addRadioGroup()
inpute! = window!.addRadioButton(91,25,25,175,25,"GRID_STYLE_INPUTE",$0000$)
inpute!.setCallback(inpute!.ON_CHECK_ON,"grid_style_inpute")
styles!.add(inpute!)
button! = window!.addRadioButton(92,200,25,175,25,"GRID_STYLE_BUTTON_UP",$0000$)
button!.setCallback(button!.ON_CHECK_ON,"grid_style_button_up")
styles!.add(button!)
label! = window!.addRadioButton(93,375,25,175,25,"GRID_STYLE_LABEL",$0000$)
label!.setCallback(label!.ON_CHECK_ON,"grid_style_label")
styles!.add(label!)
text! = window!.addRadioButton(94,550,25,175,25,"GRID_STYLE_TEXT",$0004$)
text!.setCallback(text!.ON_CHECK_ON,"grid_style_text")
styles!.add(text!)
grid! = window!.addGrid(101,25,75,750,500,$8046$,3,3)
grid!.setEditable(1)
grid!.setLineColor(BBjColor.LIGHT_GRAY)
grid!.setRowHeight(150)
grid!.setDefaultColumnWidth(220)
grid!.setDefaultGridStyle(grid!.GRID_STYLE_TEXT)
grid!.setMainGridVerticalAlignment(grid!.GRID_ALIGN_BOTTOM)
grid!.setRowHeaderCellVerticalAlignment(0,grid!.GRID_ALIGN_TOP)
grid!.setRowHeaderCellVerticalAlignment(1,grid!.GRID_ALIGN_CENTER)
grid!.setRowHeaderCellVerticalAlignment(2,grid!.GRID_ALIGN_BOTTOM)
grid!.setRowVerticalAlignment(0,grid!.GRID_ALIGN_TOP)
grid!.setRowVerticalAlignment(1,grid!.GRID_ALIGN_CENTER)
grid!.setRowVerticalAlignment(2,grid!.GRID_ALIGN_BOTTOM)
grid!.setColumnAlignment(0,grid!.GRID_ALIGN_LEFT)
grid!.setColumnAlignment(1,grid!.GRID_ALIGN_CENTER)
grid!.setColumnAlignment(2,grid!.GRID_ALIGN_RIGHT)
grid!.setColumnHeaderCellAlignment(0,grid!.GRID_ALIGN_LEFT)
grid!.setColumnHeaderCellAlignment(1,grid!.GRID_ALIGN_CENTER)
grid!.setColumnHeaderCellAlignment(2,grid!.GRID_ALIGN_RIGHT)
for col=0 to 2
  grid!.setColumnHeaderCellText(col,str(col))
next col
info$ = ""
info$ = info$ + "LEFT="+str(grid!.GRID_ALIGN_LEFT)
info$ = info$ + " CENTER="+str(grid!.GRID_ALIGN_CENTER)
info$ = info$ + " RIGHT="+str(grid!.GRID_ALIGN_RIGHT)
info$ = info$ + "; TOP="+str(grid!.GRID_ALIGN_TOP)
info$ = info$ + " CENTER="+str(grid!.GRID_ALIGN_CENTER)
info$ = info$ + " BOTTOM="+str(grid!.GRID_ALIGN_BOTTOM)
print info$
for row=0 to 2
  grid!.setRowHeaderCellText(row,str(row))
  for col=0 to 2
    grid!.setCellText(row,col,str(row)+","+str(col))
    r = 128 + rnd(128), g = 128 + rnd(128), b = 128 + rnd(128)
    grid!.setCellBackColor(row,col,sysgui!.makeColor(r,g,b))
  next col
  print "row",row,": getRowVerticalAlignment",grid!.getRowVerticalAlignment(row)
next row
process_events
eoj:
  release
resize:
  event! = sysgui!.getLastEvent()
  grid!.setSize(event!.getWidth()-50,event!.getHeight()-100)
return
grid_style_inpute:
  grid!.setDefaultGridStyle(grid!.GRID_STYLE_INPUTE)
return
grid_style_button_up:
  grid!.setDefaultGridStyle(grid!.GRID_STYLE_BUTTON_UP)
return
grid_style_label:
  grid!.setDefaultGridStyle(grid!.GRID_STYLE_LABEL)
return
grid_style_text:
  grid!.setDefaultGridStyle(grid!.GRID_STYLE_TEXT)
return

ClosedVersion History

  • BBj 18.00: BBjGrid::setRowVerticalAlignment added.

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

BBjGrid - Grid Cell Alignment

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