BBjGrid::setColumnHeaderCellVerticalAlignment

Description

In BBj 7.00 and higher, this method sets the vertical alignment for the column header cell in the BBjGrid.

Syntax

Return Value Method
void setColumnHeaderCellVerticalAlignment(int column, int align)

Parameters

Parameter Description
column 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 alignment is GRID_ALIGN_CENTER.

Example

rem ' BBjGrid::setColumnHeaderCellVerticalAlignment
sysgui! = bbjapi().openSysGui("X0")
title$ = "BBjGrid::setColumnHeaderCellVerticalAlignment"
window! = sysgui!.addWindow(25,25,800,650,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",$0004$)
label!.setCallback(label!.ON_CHECK_ON,"grid_style_label")
styles!.add(label!)
text! = window!.addRadioButton(94,550,25,175,25,"GRID_STYLE_TEXT",$0000$)
text!.setCallback(text!.ON_CHECK_ON,"grid_style_text")
styles!.add(text!)
align! = window!.addRadioGroup()
top! = window!.addRadioButton(96,25,75,175,25,"GRID_ALIGN_TOP",$0000$)
top!.setCallback(inpute!.ON_CHECK_ON,"grid_align_top")
align!.add(top!)
center! = window!.addRadioButton(97,200,75,175,25,"GRID_ALIGN_CENTER",$0000$)
center!.setCallback(button!.ON_CHECK_ON,"grid_align_center")
align!.add(center!)
bottom! = window!.addRadioButton(98,375,75,175,25,"GRID_ALIGN_BOTTOM",$0000$)
bottom!.setCallback(label!.ON_CHECK_ON,"grid_align_bottom")
align!.add(bottom!)
grid! = window!.addGrid(101,25,125,750,500,$8046$,3,3)
grid!.setEditable(1)
grid!.setLineColor(BBjColor.LIGHT_GRAY)
grid!.setRowHeight(150)
grid!.setDefaultColumnWidth(220)
grid!.setDefaultGridStyle(grid!.GRID_STYLE_LABEL)
grid!.setRowHeaderCellVerticalAlignment(0,grid!.GRID_ALIGN_TOP)
grid!.setRowHeaderCellVerticalAlignment(1,grid!.GRID_ALIGN_CENTER)
grid!.setRowHeaderCellVerticalAlignment(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)
grid!.setColumnHeaderCellVerticalAlignment(0,grid!.GRID_ALIGN_TOP)
grid!.setColumnHeaderCellVerticalAlignment(1,grid!.GRID_ALIGN_CENTER)
grid!.setColumnHeaderCellVerticalAlignment(2,grid!.GRID_ALIGN_BOTTOM)
for col=0 to 2
  grid!.setColumnHeaderCellText(col,str(col))
  print "getColumnHeaderCellVerticalAlignment",col,":",
  print grid!.getColumnHeaderCellVerticalAlignment(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,": getRowHeaderCellVerticalAlignment",
  print grid!.getRowHeaderCellVerticalAlignment(row)
  print "row",row,": getRowVerticalAlignment",
  print grid!.getRowVerticalAlignment(row)
next row
process_events
eoj:
  release
resize:
  event! = sysgui!.getLastEvent()
  grid!.setSize(event!.getWidth()-50,event!.getHeight()-150)
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
grid_align_top:
  grid!.setMainGridVerticalAlignment(grid!.GRID_ALIGN_TOP)
  print "getMainGridVerticalAlignment",grid!.getMainGridVerticalAlignment()
return
grid_align_center:
  grid!.setMainGridVerticalAlignment(grid!.GRID_ALIGN_CENTER)
  print "getMainGridVerticalAlignment",grid!.getMainGridVerticalAlignment()
return
grid_align_bottom:
  grid!.setMainGridVerticalAlignment(grid!.GRID_ALIGN_BOTTOM)
  print "getMainGridVerticalAlignment",grid!.getMainGridVerticalAlignment()
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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