eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TabSpecRuler':

Home

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

Class: TabSpecRuler


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--TabSpecRuler

Package:
stx:libwidg2
Category:
Views-Misc
Version:
rev: 1.27 date: 2023/10/05 08:18:30
user: stefan
file: TabSpecRuler.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

Description:


It shows the tabulator positions of a TabulatorSpecification
and allows its tab positions to be manipulated.
(as shown in a FileBrowser, when the longList is enabled).

[author]
    Claus Gittinger

copyright

COPYRIGHT (c) 1994 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

defaults
o  updateStyleCache
(comment from inherited method)
this method gets some heavily used style stuff and keeps
it in class-variables for faster access.
Subclasses should redefine this to load any cached style-values
into faster class variables as well. These should NOT do a
super updateStyleCache, since this method is called for all view-classes
anyway.


Instance protocol:

accessing
o  beAsynchronous
clear synchronousOperation mode;
if on, a move is immediately forwarded to dependents;
of off, its forwarded when the mouse button is released.

o  beSynchronous
set synchronousOperation mode;
if on, a move is immediately forwarded to dependents;
of off, its forwarded when the mouse button is released.

o  fixedTabs
return the collection of tabIndices which are fixed;
or nil, if all are variable

o  fixedTabs: something
set the collection of tabIndices which are fixed;
nil, if all are to be variable

o  hiddenTabs
return the collection of tabs which are to be hidden
(or nil if all are to be shown)

o  hiddenTabs: something
set the collection of tabs which are to be hidden
(or nil if all are to be shown)

o  isSynchronous
return the synchronousOperation mode settings value

o  masterView: aView
set my master view - if non-nil, I will follow the masters scroll-offset

o  synchronousOperation
return the synchronousOperation mode settings value

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  synchronousOperation: something
set/clear synchronousOperation mode;
if on, a move is immediately forwarded to dependents;
of off, its forwarded when the mouse button is released.

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  tabsAreVariable
return the value of the instance variable 'tabsAreVariable' (automatically generated)

o  tabsAreVariable: something
set/clear movability of tabs. If false, tab positions are only
displayed - but cannot be moved by the user.
The default is true.

o  tabulatorSpecification: aTabSpec
set my tabulator specification

o  titles: aCollectionOfStrings

change & update
o  update: something with: aParameter from: changedObject
(comment from inherited method)
an update request

event handling
o  buttonMotion: state x: x y: y
mouse-button was moved while pressed;
redraw thumb at its new position and, if scroll-mode is asynchronous,
the scroll action is performed

o  buttonPress: button x: x y: y
mouse-button was pressed;
start moving the tab

o  buttonRelease: button x: x y: y
mouse-button was pressed;
start moving the tab

o  pointerLeave: state
mouse left view - restore cursor.

initialization
o  initStyle
(comment from inherited method)
this method sets up all style dependent things.
If redefined, make sure that super initStyle is sent

o  initialize
TabSpecRuler new open

private
o  canMoveTabAtX: x

o  indexOfTabAtX: x

o  moveTabAtIndex: idx toX: movedTabX

queries-contents
o  widthOfContents
(comment from inherited method)
return the width of the contents in logical units
- defaults to views visible area here.
This method MUST be redefined in all view classess which are
going to be scrolled AND show data which has different size than
the view. For example, a view showing A4-size documents should return
the number of horizontal pixels such a document has on this device.
A view showing a bitmap of width 500 should return 500.
If not redefined, scrollbars have no way of knowing the actual size
of the contents being shown. This is called by scrollBars to compute
the relative width of the document vs. the view's actual width.
The value returned here must be based on a scale of 1, since users
of this will scale as appropriate.

redrawing
o  drawHandleAtX: x type: handleType
redraw a tabulator handle

o  positionOfTabAtIndex: idx

o  redraw
redraw the handles from by tabSpec

o  redrawTabAtIndex: idx
redraw a single handle

o  redrawTitleAtIndex: idx
redraw a single handle


Examples:


    |top head spec|

    top := View new.
    top extent:300@100.

    head := TabSpecRuler in:top.
    head width:1.0.
    head level:1.

    spec := TabulatorSpecification new.
    spec unit:#inch.
    spec positions:#(0     1     2.5    3.5    4       5        ).
    spec align:    #(#left #left #right #right #center #decimal ).

    head tabulatorSpecification:spec.
    top open.
    |top head spec|

    top := View new.
    top extent:300@100.

    head := TabSpecRuler in:top.
    head width:1.0.
    head level:1.
    head titles:#('col1' 'col2' 'col3' 'col4' 'col5' 'col6').

    spec := TabulatorSpecification new.
    spec unit:#inch.
    spec positions:#(0     1     2.5    3.5    4       5        ).
    spec align:    #(#left #left #right #right #center #decimal ).

    head tabulatorSpecification:spec.
    top open.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:35:59 GMT