|
Class: TabSpecRuler
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
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
copyrightCOPYRIGHT (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.
defaults
-
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.
accessing
-
beAsynchronous
-
clear synchronousOperation mode;
if on, a move is immediately forwarded to dependents;
of off, its forwarded when the mouse button is released.
-
beSynchronous
-
set synchronousOperation mode;
if on, a move is immediately forwarded to dependents;
of off, its forwarded when the mouse button is released.
-
fixedTabs
-
return the collection of tabIndices which are fixed;
or nil, if all are variable
-
fixedTabs: something
-
set the collection of tabIndices which are fixed;
nil, if all are to be variable
-
hiddenTabs
-
return the collection of tabs which are to be hidden
(or nil if all are to be shown)
-
hiddenTabs: something
-
set the collection of tabs which are to be hidden
(or nil if all are to be shown)
-
isSynchronous
-
return the synchronousOperation mode settings value
-
masterView: aView
-
set my master view - if non-nil, I will follow the masters scroll-offset
-
synchronousOperation
-
return the synchronousOperation mode settings value
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
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) **
-
tabsAreVariable
-
return the value of the instance variable 'tabsAreVariable' (automatically generated)
-
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.
-
tabulatorSpecification: aTabSpec
-
set my tabulator specification
-
titles: aCollectionOfStrings
-
change & update
-
update: something with: aParameter from: changedObject
-
(comment from inherited method)
an update request
event handling
-
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
-
buttonPress: button x: x y: y
-
mouse-button was pressed;
start moving the tab
-
buttonRelease: button x: x y: y
-
mouse-button was pressed;
start moving the tab
-
pointerLeave: state
-
mouse left view - restore cursor.
initialization
-
initStyle
-
(comment from inherited method)
this method sets up all style dependent things.
If redefined, make sure that super initStyle is sent
-
initialize
-
TabSpecRuler new open
private
-
canMoveTabAtX: x
-
-
indexOfTabAtX: x
-
-
moveTabAtIndex: idx toX: movedTabX
-
queries-contents
-
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
-
drawHandleAtX: x type: handleType
-
redraw a tabulator handle
-
positionOfTabAtIndex: idx
-
-
redraw
-
redraw the handles from by tabSpec
-
redrawTabAtIndex: idx
-
redraw a single handle
-
redrawTitleAtIndex: idx
-
redraw a single handle
|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.
|
|