BBjGrid::getColumnHeaderVerticalAlignment

Description

In BBj 7.00 and higher, this returns the default column header vertical alignment in the BBjGrid.

Syntax

Return Value Method
int getColumnHeaderVerticalAlignment()

Parameters

None.

Return Value

Returns one of the following alignment constants:

Align Value Constants
GRID_ALIGN_TOP
GRID_ALIGN_CENTER
GRID_ALIGN_BOTTOM

Example

rem ' BBjGrid::getColumnHeaderVerticalAlignment
sysgui! = bbjapi().openSysGui("X0")
title$ = "BBjGrid::getColumnHeaderVerticalAlignment"
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!.setColumnAlignment(0,grid!.GRID_ALIGN_LEFT)
grid!.setColumnAlignment(1,grid!.GRID_ALIGN_CENTER)
grid!.setColumnAlignment(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
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!.setDefaultVerticalAlignment(grid!.GRID_ALIGN_TOP)
  print "setDefaultVerticalAlignment",grid!.GRID_ALIGN_TOP," (GRID_ALIGN_TOP)"
  grid!.setRowHeaderVerticalAlignment(grid!.GRID_ALIGN_TOP)
  print "getRowHeaderVerticalAlignment",grid!.getRowHeaderVerticalAlignment()
  grid!.setColumnHeaderVerticalAlignment(grid!.GRID_ALIGN_TOP)
  print "getColumnHeaderVerticalAlignment",grid!.getColumnHeaderVerticalAlignment()
return
grid_align_center:
  grid!.setDefaultVerticalAlignment(grid!.GRID_ALIGN_CENTER)
  print "setDefaultVerticalAlignment",grid!.GRID_ALIGN_CENTER," (GRID_ALIGN_CENTER)"
  grid!.setRowHeaderVerticalAlignment(grid!.GRID_ALIGN_CENTER)
  print "getRowHeaderVerticalAlignment",grid!.getRowHeaderVerticalAlignment()
  grid!.setColumnHeaderVerticalAlignment(grid!.GRID_ALIGN_CENTER)
  print "getColumnHeaderVerticalAlignment",grid!.getColumnHeaderVerticalAlignment()
return
grid_align_bottom:
  grid!.setDefaultVerticalAlignment(grid!.GRID_ALIGN_BOTTOM)
  print "setDefaultVerticalAlignment",grid!.GRID_ALIGN_BOTTOM," (GRID_ALIGN_BOTTOM)"
  grid!.setRowHeaderVerticalAlignment(grid!.GRID_ALIGN_BOTTOM)
  print "getRowHeaderVerticalAlignment",grid!.getRowHeaderVerticalAlignment()
  grid!.setColumnHeaderVerticalAlignment(grid!.GRID_ALIGN_BOTTOM)
  print "getColumnHeaderVerticalAlignment",grid!.getColumnHeaderVerticalAlignment()
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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