eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DataSetColumn':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: DataSetColumn


Inheritance:

   Object
   |
   +--DataSetColumn

Package:
stx:libwidg2
Category:
Views-DataSet
Version:
rev: 1.163 date: 2019/04/23 18:05:22
user: cg
file: DataSetColumn.st directory: libwidg2
module: stx stc-classLibrary: libwidg2
Author:
Claus Atzkern

Description:


represent one single column description of a DataSetView

[Instance variables:]

    columnNumber    <Integer>               sequence number (into list of columns)

    dataSet         <DSVColumnView>         the view it belongs to

    width           <Integer>               width of column

    description     <DataSetColumnSpec>     the column description (a spec)

    buttonExtent    <Point>                 extent of drawable form

    rendererType    <Type>                  renderer type (cached value from
                                            the column specification).

    backgroundColor <Color or nil>          background color of all cells or nil
                                            (nil: use default background color).

    foregroundColor <Color or nil>          foreground color of all cells or nil
                                            (nil: use default foreground color).

    columnAlignment <Symbol>                align text/icon #left #right or #center
                                            in row (on default: #left).

    label           <label/icon or nil>     label resolved by the builder shown
                                            in the column description field.

    readSelector    <Symbol>                cached readSelector (from the spec)

    columnAdaptor   <nil or any>            if non-nil, that one is asked (via
                                            read-writeSelectors to extract a column
                                            from a row object.
                                            If nil, the row object is used itself.

    showColSeparator <Boolean>              true: vertical separators are enabled;
                                            separator between columns

    showRowSeparator <Boolean>              true: horizontal separators are enabled;
                                            separator between rows

    rowSeparatorSelector <Selector or nil>  access specific showRowSeparator state
                                            for a cell

[from description:]
    fgSelector      <Selector or nil>       access specific foreground color for
                                            a cell

    bgSelector      <Selector or nil>       access specific background color for
                                            a cell

    numberOfRowsProbedForColumnSize         the number of rows which are queries
                            <Integer>       in order to compute the columns width.
                                            (for scrollBar/col width computation)
                                            Notice, if it's expensive to fetch rows
                                            (dataBase apps), this should be small.
                                            Default:15


Related information:

    DataSetColumnSpec
    DSVColumnView
    DataSetView

Class protocol:

utilities
o  shortenedStringFor: aString on: aGC maxWidth: maxWidth
common code to shorten a string; used in both the DSV label- and column Views,
if the string is too long for the column

o  shortenedStringFor: aString on: aGC maxWidth: maxWidth shortenedAtLeft: shortenedAtLeft
common code to shorten a string; used in both the DSV label- and column Views,
if the string is too long for the column


Instance protocol:

accessing
o  activeHelpText
get the active helpText or nil

o  activeHelpTextForLabel
get the active helpText for the label or nil

o  activeHelpTextForRow: rowNr
get the active helpText or nil

o  at: aRowNr
get the value of the cell at the row index, aRowNr

o  at: aRowNr put: something
set the value of the cell at the row index, aRowNr

o  columnAdaptor

o  columnAdaptor: anAdapter

o  columnNumber

o  description
returns the column spec

o  doubleClickedSelector

o  label
get the label assigned to the column

o  longStringCompression

o  longStringCompression: aBoolean

o  longStringCompressionAtLeft

o  rendererType
returns my renderer type

accessing-color & font
o  backgroundColor
returns the background color or nil

o  backgroundColor: aColor

o  backgroundColorAt: aRowNr
returns the background color for a row at list index a rowNr

o  backgroundColorFor: aRow at: aRowNr
return the background color for a row at list index a rowNr

o  colorFor: aRow at: aRowNr descriptionSelector: descriptionSelector descriptionColor: descriptionColor dataSetDefaultColor: dataSetColor
common code for returning a color for a row at list index a rowNr, asking both description and dataSet as fallBack

o  foregroundColor
returns the foreground color or nil

o  foregroundColor: aColor

o  foregroundColorFor: aRow at: aRowNr
returns the foreground color for a row at list index a rowNr

o  selectedBackgroundColorFor: aRow at: aRowNr
returns the selected background color for a row at list index a rowNr

o  selectedForegroundColorFor: aRow at: aRowNr
returns the selected foreground color for a row at list index a rowNr

o  selectedFrameColorFor: aRow at: aRowNr
returns the selected frame color for a row at list index a rowNr

accessing-dimension
o  minWidth
get the minimum width required by the column

o  minimumRequiredWidth
returns the minimum required width

o  setDescWidth: aWidth
set a fixed width

o  setWidth: pixels

o  width
returns the width in pixels
Warning:
only the first numberOfRowsProbedForColumnSize are probed,
in case the access is expensive (dataBase apps)
If the descriptor defines a width, that is used, and the items
are not probed at all.

o  width: aWidth

drawing
o  drawLabel: aLabelToDraw atX: xLeft y: yTop
draw aLabelToDraw; handle columnAlignment

o  drawLabelsAtX: xLeft y: yTop h: h from: start to: stop
redraw labels from start to stop

o  drawRendererInRow: rowNr x: xLeft y: y width: cellWidth value: cellValue

o  drawSeparatorsAtX: xLeft y: yTop h: h from: start to: stop
redraw separators for cells between start and stop

o  invalidate
invalidate width of column; forces a recomputation

o  redrawX: xLeft y: yTop h: h from: start to: stop
redraw all rows between start and stop

o  shownValueForRow: aRowOrNil rowNr: aRowNr
cannot remember what this was used for ...

editing
o  editorForRowAt: aRowNr
creates the editor for the row in a view and returns an editorAndModel, or nil

event handling
o  doesNotUnderstand: aMessage

grow & shrink
o  growWidth: n
grow the width for n pixels

initialization
o  on: aDSVColumnView description: aDescription columnNumber: aNumber label: aLabel
instance creation; set attributes dependent on the description

private
o  extractColFromRow: aRow rowNr: rowNr
I don't use valueWithOptionalArgument:and:and:and: here, to make better use of inline caches...

o  storeCol: newValueArg inRow: aRow

queries
o  canResize

o  canSelect: aRowNr
returns true if the cell in column is selectable.
(possibly calls the selectSelector, if any)

o  choicesFor: aRow at: aRowNr

o  containsText
returns true if text might exist

o  doubleClickOn: aRowNr

o  hasChoices: aRowNr

o  hasPotentialNonConstantBackground

o  hasRelativeWidth
returns true if width is relative

o  hasRowSeparatorAt: rowNumber

o  heightOfHighestRow
returns the height of the highest row in pixels.
Warning:
only the first numberOfRowsProbedForColumnSize are probed,
in case the access is expensive (dataBase apps)
If the descriptor defines a height, that is used, and the items are not probed at all.
If the descriptor's height is -1 or #fontHeight, that is used.
If the descriptor's height is #heightOfFirstRow, only the first columns height is probed.

o  heightOfLabel: aLabel
returns the height of the label

o  isResizeable
returns true if the row is resizeable

o  isRowVisible: rowNr

o  isSortable

o  showColSeparator
returns true if column separator is on

o  showSelectionHighLighted
returns true if selection is highLighted

o  translatedChoicesFor: aRow at: aRowNr

o  widthOfLabel: aLabel
returns the width of the label

searching
o  findRowNrStartingWithChar: aChar start: start stop: stop
find the first row starting at start to stop, which drawable label
starts with the character, aChar. The index of the detected row is
returned or if no row is found 0.



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 29 Mar 2024 14:05:32 GMT