BBjGrid::getMainGridVerticalAlignment

Description

In BBj 7.00 and higher, this method returns the vertical alignment of the cells in the main part of the BBjGrid (not including the row or column headers).

Syntax

Return Value Method
int getMainGridVerticalAlignment()

Parameters

None.

Return Value

Returns one of the following alignment constants for the grid:

Align Value Constants
GRID_ALIGN_TOP
GRID_ALIGN_CENTER
GRID_ALIGN_BOTTOM

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::getMainGridVerticalAlignment
sysgui! = bbjapi().openSysGui("X0")
title$ = "BBjGrid::getMainGridVerticalAlignment"
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)
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,": 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.