eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'NoteBookView':

Home

everywhere
www.exept.de
for:
[back]

Class: NoteBookView


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--GraphicsMedium
            |
            +--DisplaySurface
               |
               +--SimpleView
                  |
                  +--View
                     |
                     +--NoteBookView
                        |
                        +--TabView

Package:
stx:libwidg2
Category:
Views-Layout
Version:
rev: 1.167 date: 2010/03/19 13:33:07
user: ca
file: NoteBookView.st directory: libwidg2
module: stx stc-classLibrary: libwidg2
Author:
Claus Atzkern

Description:


implements the noteBook.


Related information:

    TabView

Class protocol:

defaults
o  defaultFont

o  updateStyleCache
extract values from the styleSheet and cache them in class variables

image specs
o  tabBackgroundVista
This resource specification was automatically generated
by the ImageEditor of ST/X.


Instance protocol:

accepting-items
o  tabAtIndex: tabIndex put: newLabelOrTabItem
called if the contents of a tab changed; test whether the old layout can
be reused otherwise we must recompute the whole list

accessing
o  canvas
returns the canvas; the containter view

o  canvas: newCanvas
change the canvas; the container view

o  hierarchicalIndexOfChild: aView

o  lastUserSelection

o  lastUserSelection: something

o  list
return the list of Tabs or Labels

o  list: newTabItemListOrNil
set the tab-list

o  listIndexOf: something
convert something to an index into the list;
returns the index or nil if not found

o  numberOfLines

o  useIndex
use index instead of tab name

o  useIndex: aBoolean
set/clear the useIndex flag. If set, both actionBlock and change-messages
are passed the index(indices) of the selection as argument.
If clear, the value(s) (i.e. the selected string) is passed.
Default is false.

accessing-actions
o  accessTabMenuAction
callback to retrieve the menu for a specific tab.
the argument to the block is the index of the tab

o  accessTabMenuAction: aOneArgAction
callback to retrieve the menu for a specific tab.
the argument to the block is the index of the tab

o  action
get the action block to be performed on select; the argument to
the block is the selected index or nil in case of no selection.

o  action: oneArgBlock
set the action block to be performed on select; the argument to
the block is the selected index or nil in case of no selection.

accessing-behavior
o  destroyTabAction

o  destroyTabAction: aOneArgBlock

o  disableDestroyButtonOfInactiveTabs

o  enabled
returns true if tabs are enabled

o  enabled: aState
set the enabled state of tabs

o  isEnabled
returns the enabled state

o  keepCanvas: aBoolean
if false (the default), the previous canvas is destroyed, whenever
a new canvas is set.
if true, it is unmapped and kept.
Set this flag, if the application changes the canvas but wants
them to be kept for fast switching.

o  selectConditionBlock
get the conditionBlock; this block is evaluated before a selection
change is performed; the change will not be done, if the evaluation
returns false. The argument to the block is the selection index.

o  selectConditionBlock: aOneArgBlock
get the conditionBlock; this block is evaluated before a selection
change is performed; the change will not be done, if the evaluation
returns false. The argument to the block is the selection index.

o  showDestroyButtonOfInactiveTabs

o  translateLabel
true if labels are translated

o  translateLabel: aBoolean
set to true if labels should be translated

o  translateToDisplayLabel: aString
translate the label

accessing-colors
o  activeBackgroundColor
returns the bg color used when drawing the active tabs label

o  activeBackgroundColor: aColor
set the bg color used when drawing the active tabs label

o  activeForegroundColor
returns the color used when drawing the active tabs label

o  activeForegroundColor: aColor
set the color used when drawing the active tabs label

o  activeTabMarkerColor
win-XP style marker

o  activeTabMarkerColor: something

o  activeTabMarkerFgColor
win-XP style marker

o  backgroundColor
return the backgroundColor of the notebook view

o  destroyTabForegroundColor
returns the color used to draw the destroy button

o  disabledDestroyTabForegroundColor
returns the color used to draw a disabled destroy button

o  disabledForegroundColor
returns the color used when drawing disabled tab labels

o  drawLightColor
get the color to be used for lighted edges; bug fix caused by common drawEdge

o  foregroundColor
return the color used for drawing text

o  foregroundColor: aColor
set the color to be used for drawing text

o  halfLightColor

o  halfShadowColor

o  viewBackground: aColor

accessing-dimension
o  activeTabMarkerHeight

o  destroyButtonFrameForTab: aTab

o  destroyButtonHeight

o  destroyButtonSepX
separating space between tabs right and the destroyButton

o  destroyButtonSepY
separating space between tabs top and the destroyButton

o  destroyButtonUsedWidth
returns the additional width used for a destroy button

o  destroyButtonWidth

o  preferredExtent
compute max extent x/y based on one line

o  preferredExtentForTab: aTab
returns the preferred extent of a specific tab

accessing-mvc
o  canvasHolder
get the model, which keeps the canvas, a kind of SimpleView

o  canvasHolder: aValueHolder
set the model, which keeps the canvas, a kind of SimpleView

o  listHolder
get the model, which keeps the list of Tabs or Labels

o  listHolder: aValueHolder
set the model, which keeps the list of Tabs or Labels

o  model: aValueHolder
set the model, which keeps the selection

accessing-style
o  canvasInset
inset of the canvas relative to my frame
tabLevel + canvasInset == origin of canvas

o  canvasInset: anInset
inset of the canvas relative to my frame
tabLevel + canvasInset == origin of canvas

o  direction
returns the direction of tabs as symbol. On default the value is
set to #top. Valid symbols are:
#top arrange tabs to be on top of a view
#bottom arrange tabs to be on bottom of a view
#left arrange tabs to be on left of a view
#right arrange tabs to be on right of a view

o  direction: aDirection
change the direction of tabs. On default the value is set to #top.
Valid symbols are:
#top arrange tabs to be on top of a view
#bottom arrange tabs to be on bottom of a view
#left arrange tabs to be on left of a view
#right arrange tabs to be on right of a view

o  fitLastRow
in case of true, the last row is expanded to the view size like all
other raws. In case of false all the tabs in the last raw keep their
preferred extent (x or y) dependant on the direction.

o  fitLastRow: aBool
in case of true, the last row is expanded to the view size like all
other raws. In case of false all the tabs in the last raw keep their
preferred extent (x or y) dependant on the direction.

o  hasScrollButtons

o  hasScrollButtons: aBoolean

o  isHorizontal
returns true in case of direction is #top or #bottom

o  minimumTabWidth
answer the minimum required width of a tab or nil (use extent of tab only)

o  minimumTabWidth: aWidthOrNil
set the minimum required width of a tab or nil (use extent of tab only)

o  showDestroyTabButton

o  showDestroyTabButton: aBoolean

o  tabBottomMargin
returns the margin between the tabs and the canvas

o  tabBottomMargin: aMargin
set the margin between the tabs and the canvas

o  tabLabelInset
inset (a point) of the label relative to its frame
preferredExtent of Tab: label extent + tabLabelInset

o  tabLabelInset: aPoint
inset (a point) of the label relative to its frame
preferredExtent of Tab: label extent + tabLabelInset

o  tabLeftMargin
margin to the first visible tab or scroller button

o  tabLeftMargin: aMargin
margin to the first visible tab or scroller button

o  tabLevel
the level of the tabs and noteBook frame

o  tabLevel: aLevel
the level of the tabs and noteBook frame

o  tabRightMargin
margin from the last visible tab or scroller button to the view

o  tabRightMargin: aMargin
margin from the last visible tab or scroller button to the view

o  tabTopMargin
returns the margin between the tabs and the widget (not canvas)

o  tabTopMargin: aMargin
set the margin between the tabs and the widget (not canvas)

change & update
o  styleChanged
called if the tab style changed
list must be recomputed

o  update: something with: aParameter from: changedObject
one of my models changed its value

drawing
o  computeDrawingClipX: x y: y width: w height: h

o  drawActiveTabMarker: aTab
draw a tabs focus-rectangle

o  drawBorderEdges

o  drawDestroyButtonForTab: aTab
redraw a tabs destroy button

o  drawTabEdgesFor: aTab

o  drawTabFocus: aTab
draw a tabs focus-rectangle

o  invalidateSelectedTab

o  invalidateTab: aTab
invalidate a tab (i.e. force it to be redrawn)

o  redrawTab: aTab
redraw a tab

o  redrawX: x y: y width: w height: h
a region must be redrawn

event handling
o  buttonMotion: buttonState x: x y: y

o  buttonPress: button x: x y: y
a button is pressed; find tab under point and set the selection

o  buttonRelease: button x: x y: y
a button is released; see if its the destroyTab button

o  keyPress: aKey x: x y: y
selection might change; look for corresponding list entry

o  pointerLeave: state

o  processCursorKey: aKey x: x y: y
selection might change; look for corresponding list entry

o  processShortcutKeyEvent: event

o  sizeChanged: how
size of my view changed

focus handling
o  canTab
if the list of tabLabels is empty, we do not need the focus
by tabing - give the focus to my included subviews.

o  showFocus: explicit
got the keyboard focus

o  showNoFocus: explicit
lost the keyboard focus

o  supportsFocusOnTab
return true if the keyboard focus can ever be on the tab area

o  updateFocusIdOnSelectedTab
update the lastFocusId for the current selected tab

o  updateFocusView
called when updating the focusView within my canvas

o  wantsFocusWithButtonPress
never wants the focus by button press

help
o  flyByHelpTextAt: srcPoint

o  helpText
return the helpText for the currently selected item (empty if none)

o  helpTextAt: srcPoint
return the helpText for aPoint (i.e. when mouse-pointer is moved over an item).

o  helpTextForItemAt: anIndex

o  helpTextForTab: aTab

initialization & release
o  destroy
remove dependencies

o  initStyle
setup style attributes

o  initialize

o  mapped

o  postRealize
automatically set the initially selected notebook tab;
unless it has been set already (by setup code)

o  realize

layout
o  computeBorderLayout
returns the layout of the frame araound the canvas

o  computeLayoutForTab: aTab
calculate the effective bounds of a tab.
This includes any size changes for the active tab (overlap etc.).

o  makeToBaseLine: aLnNr
rotate lines to make the line #aLnNr be the new base line (i.e.
subtract (aLnNr-1) from all lines and take modulu the number of lines

o  recomputeList
recompute list

o  recomputeListHorizontal
compute layouts for all tabs

o  recomputeListVertical
compute layouts for all tabs

o  resizeCanvas

obsolete
o  canvasFrameLevel
ignorred

o  canvasFrameLevel: anInteger
ignorred

o  labels
return the list of labels

o  labels: aListOfLabels
set the list of labels

o  labelsHolder
get the model, which keeps the list of Tabs or Labels

o  labelsHolder: aValueHolder
set the model, which keeps the list of Tabs or Labels

private
o  indexOfTab: aTab

o  processAccessCharacter: aKey
a character is pressed; check for tab identified y the character
select the tab and return true or if no tab detected return false

o  processShortcutKey: aKey
if there is a short-key for that character, process it
and return true. Otherwise, return false.

o  tabContainingPointX: x y: y

private-buttons
o  buttonLayoutUpdate

o  buttonWidth
returns the button extent x or y dependent on the layout

o  hideButton: aButton

o  makeVisible: aTab
setup transformation to make the selection visible;
returns true if the transformation has changed otherwise false.

o  makeVisibleHorizontal: aTab
setup transformation to make the horizontal selection visible

o  makeVisibleVertical: aTab
setup transformation to make the vertical selection visible

o  scrollButtonPressed: whichButton

queries
o  hasTabSelected: aTab

o  isDestroyTabButtonShownFor: aTab
returns true if the destraoyButton for a tab is shown

o  isFirstTabInLine: aTab
returns true if the tab is the first tab in the line
used by drawing

o  isLastTabInLine: aTab
returns true if the tab is the last tab in the line
used by drawing

selection
o  isSelectable: anIndex
returns true if tab at an index is selectable

o  nextSelectableAfter: anIndex wrapAtEnd: wrapAtEnd
return the index of the next selectable entry after the index;
wrap at end if the wrapAtEnd flag is set to true.

o  previousSelectableBefore: anIndex wrapAtBegin: wrapAtBegin
return the index of the previous selectable entry before the index;
wrap at begin if the wrapAtBegin flag is set to true.

o  selectTab: aTab
select aTab - which may be a tab label or a TabItem

o  selectedTab
returns the selected tab or nil

o  selection
return the selection or nil/o; caring for the useIndex setting.

o  selection: anIndexOrNil
change the selection to index or nil. The model and/or actionBlock is notified

o  selectionChanged
selection has changed; update the model and evaluate change action

o  setSelection: anIndexOrNil
change the selection to anIndexOrNil. No notifications are raised

o  userSelection: anIndexOrNil
user changed the selection to index or nil. The model and/or actionBlock is notified

o  validateVisibleCanvas


Private classes:

    Tab

Examples:


tabs at top & bottom


|top tab1 tab2|

top := StandardSystemView extent:300@100.
tab1 := NoteBookView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:top.
tab1 direction:#top.
tab1 list:#( 'Foo' 'Bagr' 'Baz' 'Bgar' 'Baqz'  ).

tab2 := NoteBookView origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:top.
tab2 direction:#bottom.
tab2 list:#( 'Foo' 'Bagr' 'Baz' 'Bgar' 'Baqz'  ).
top open.
tabs at left & right


|top tab1 tab2|

top := StandardSystemView extent:100@300.
tab1 := NoteBookView origin:0.0 @ 0.0 corner:0.5 @ 01.0 in:top.
tab1 direction:#left.
tab1 list:#( 'Foo' 'Bagr' 'Baz' 'Bgar' 'Baqz'  ).

tab2 := NoteBookView origin:0.5 @ 0.0 corner:1.0 @ 1.0 in:top.
tab2 direction:#right.
tab2 list:#( 'Foo' 'Bagr' 'Baz' 'Bgar' 'Baqz'  ).
top open.


ST/X 6.1.1; WebServer 1.620 at exept:8081; Tue, 22 May 2012 21:24:44 GMT