TabSpecRuler.st
author Claus Gittinger <cg@exept.de>
Fri, 28 Mar 1997 15:40:43 +0100
changeset 330 e216c5a56f88
parent 328 d68048199989
child 342 9e7148fb27c4
permissions -rw-r--r--
hiding tabs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     1
"
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     3
	      All Rights Reserved
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     4
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     5
 This software is furnished under a license and may be used
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     6
 only in accordance with the terms of that license and with the
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     8
 be provided or otherwise made available to, or used by, any
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
     9
 other person.  No title to or ownership of the software is
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    10
 hereby transferred.
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    11
"
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    12
49
claus
parents: 40
diff changeset
    13
SimpleView subclass:#TabSpecRuler
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    14
	instanceVariableNames:'tabSpec titleEntry handleStyle handleCursor movedTabIndex
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    15
		movedTabX synchronousOperation handleWidth fixedTabs
330
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
    16
		tabsAreVariable hiddenTabs'
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    17
	classVariableNames:'DefaultHandleStyle'
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    18
	poolDictionaries:''
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    19
	category:'Views-Misc'
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    20
!
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    21
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    22
!TabSpecRuler class methodsFor:'documentation'!
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    23
38
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    24
copyright
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    25
"
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    26
 COPYRIGHT (c) 1994 by Claus Gittinger
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    27
	      All Rights Reserved
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    28
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    29
 This software is furnished under a license and may be used
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    30
 only in accordance with the terms of that license and with the
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    32
 be provided or otherwise made available to, or used by, any
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    33
 other person.  No title to or ownership of the software is
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    34
 hereby transferred.
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    35
"
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    36
!
858ec30d05fe *** empty log message ***
claus
parents: 36
diff changeset
    37
36
160b8f0dfd7d *** empty log message ***
claus
parents: 29
diff changeset
    38
documentation
160b8f0dfd7d *** empty log message ***
claus
parents: 29
diff changeset
    39
"
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    40
    It shows the tabulator positions of a TabulatorSpecification
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    41
    and allows its tab positions to be manipulated.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    42
    (as shown in a FileBrowser, when the longList is enabled).
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    43
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    44
    [author]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    45
        Claus Gittinger
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    46
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    47
    [see also:]
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    48
        TabulatorSpecification
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    49
        Ruler
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    50
        ListView
36
160b8f0dfd7d *** empty log message ***
claus
parents: 29
diff changeset
    51
"
160b8f0dfd7d *** empty log message ***
claus
parents: 29
diff changeset
    52
!
160b8f0dfd7d *** empty log message ***
claus
parents: 29
diff changeset
    53
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    54
examples
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    55
"
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    56
                                                                [exBegin]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    57
    |top head spec|
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    58
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    59
    top := View new.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    60
    top extent:300@100.
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    61
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    62
    head := TabSpecRuler in:top.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    63
    head width:1.0.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    64
    head level:1.
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    65
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    66
    spec := TabulatorSpecification new.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    67
    spec unit:#inch.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    68
    spec positions:#(0     1     2.5    3.5    4       5        ).
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    69
    spec align:    #(#left #left #right #right #center #decimal ).
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    70
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    71
    head tabulatorSpecification:spec.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    72
    top open.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    73
                                                                [exEnd]
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    74
"
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    75
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    76
! !
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    77
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    78
!TabSpecRuler class methodsFor:'defaults'!
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    79
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    80
updateStyleCache
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    81
    DefaultHandleStyle := StyleSheet at:'tabRulerHandleStyle'.
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    82
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    83
! !
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    84
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    85
!TabSpecRuler methodsFor:'accessing'!
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
    86
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    87
fixedTabs
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    88
    "return the collection of tabIndices which are fixed;
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    89
     or nil, if all are variable"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    90
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    91
    ^ fixedTabs
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    92
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    93
    "Created: 28.3.1997 / 15:02:29 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    94
    "Modified: 28.3.1997 / 15:03:05 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    95
!
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    96
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    97
fixedTabs:something
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    98
    "set the collection of tabIndices which are fixed;
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    99
     nil, if all are to be variable"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   100
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   101
    fixedTabs := something.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   102
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   103
    "Created: 28.3.1997 / 15:02:29 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   104
    "Modified: 28.3.1997 / 15:03:18 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   105
!
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   106
330
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   107
hiddenTabs
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   108
    "return the collection of tabs which are to be hidden
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   109
     (or nil if all are to be shown)"
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   110
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   111
    ^ hiddenTabs
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   112
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   113
    "Created: 28.3.1997 / 15:35:54 / cg"
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   114
    "Modified: 28.3.1997 / 15:36:18 / cg"
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   115
!
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   116
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   117
hiddenTabs:something
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   118
    "set the collection of tabs which are to be hidden
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   119
     (or nil if all are to be shown)"
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   120
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   121
    hiddenTabs := something.
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   122
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   123
    "Created: 28.3.1997 / 15:35:54 / cg"
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   124
    "Modified: 28.3.1997 / 15:36:24 / cg"
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   125
!
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   126
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   127
synchronousOperation
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   128
    "return the synchronousOperation mode settings value"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   129
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   130
    ^ synchronousOperation
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   131
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   132
    "Created: 28.3.1997 / 15:01:17 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   133
    "Modified: 28.3.1997 / 15:02:20 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   134
!
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   135
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   136
synchronousOperation:something
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   137
    "set/clear synchronousOperation mode;
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   138
     if on, a move is immediately forwarded to dependents;
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   139
     of off, its forwarded when the mouse button is released."
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   140
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   141
    synchronousOperation := something.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   142
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   143
    "Modified: 28.3.1997 / 15:02:07 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   144
!
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   145
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   146
tabsAreVariable
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   147
    "return the value of the instance variable 'tabsAreVariable' (automatically generated)"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   148
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   149
    ^ tabsAreVariable
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   150
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   151
    "Created: 28.3.1997 / 15:05:27 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   152
!
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   153
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   154
tabsAreVariable:something
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   155
    "set/clear movability of tabs. If false, tab positions are only
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   156
     displayed - but cannot be moved by the user.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   157
     The default is true."
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   158
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   159
    tabsAreVariable := something.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   160
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   161
    "Created: 28.3.1997 / 15:05:27 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   162
    "Modified: 28.3.1997 / 15:06:19 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   163
!
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   164
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   165
tabulatorSpecification:aTabSpec
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   166
    "set my tabulator specification"
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   167
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   168
    tabSpec := aTabSpec
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   169
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   170
    "Modified: 4.6.1996 / 22:34:31 / cg"
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   171
! !
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   172
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   173
!TabSpecRuler methodsFor:'event handling'!
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   174
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   175
buttonMotion:state x:x y:y
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   176
    "mouse-button was moved while pressed;
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   177
     redraw thumb at its new position and, if scroll-mode is asynchronous, 
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   178
     the scroll action is performed"
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   179
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   180
    |left right limit1 limit2 minSpacing newX|
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   181
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   182
    movedTabIndex notNil ifTrue:[
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   183
        minSpacing := 5.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   184
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   185
        left := limit1 := 0.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   186
        movedTabIndex > 1 ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   187
            left := self positionOfTabAtIndex:(movedTabIndex-1).
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   188
            limit1 := left + minSpacing.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   189
        ].
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   190
        right := limit2 := width.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   191
        movedTabIndex < tabSpec size ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   192
            right := self positionOfTabAtIndex:(movedTabIndex+1).
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   193
            limit2 := right - minSpacing.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   194
        ].
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   195
        newX := (x max:limit1) min:limit2.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   196
        x ~= newX ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   197
            self cursor:Cursor stop.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   198
        ] ifFalse:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   199
            self cursor:handleCursor
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   200
        ].
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   201
        newX ~= movedTabX ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   202
            movedTabX := newX.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   203
            self clearRectangleX:left+handleWidth y:0 
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   204
                           width:(right-left-handleWidth-handleWidth) height:height.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   205
            self redrawTabAtIndex:movedTabIndex.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   206
            synchronousOperation == true ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   207
                self moveTabAtIndex:movedTabIndex toX:movedTabX
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   208
            ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   209
        ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   210
    ] ifFalse:[
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   211
        (self canMoveTabAtX:x) ifTrue:[
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   212
            self cursor:handleCursor
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   213
        ] ifFalse:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   214
            self cursor:(Cursor normal)
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   215
        ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   216
    ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   217
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   218
    "Modified: 28.3.1997 / 15:17:14 / cg"
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   219
!
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   220
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   221
buttonPress:button x:x y:y
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   222
    "mouse-button was pressed;
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   223
     start moving the tab"
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   224
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   225
    movedTabIndex := nil.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   226
    (self canMoveTabAtX:x) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   227
        movedTabIndex := self indexOfTabAtX:x.
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   228
        self cursor:handleCursor.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   229
    ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   230
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   231
    "Modified: 28.3.1997 / 15:13:15 / cg"
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   232
!
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   233
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   234
buttonRelease:button x:x y:y
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   235
    "mouse-button was pressed;
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   236
     start moving the tab"
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   237
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   238
    |idx|
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   239
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   240
    idx := movedTabIndex.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   241
    movedTabIndex := nil.
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   242
    idx notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   243
        synchronousOperation == true ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   244
            self moveTabAtIndex:idx toX:movedTabX
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   245
        ]
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   246
    ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   247
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   248
    "Modified: 28.3.1997 / 15:10:23 / cg"
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   249
!
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   250
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   251
pointerLeave:state
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   252
    "mouse left view - restore cursor."
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   253
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   254
    self cursor:(Cursor normal).
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   255
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   256
    "Created: 28.3.1997 / 13:37:52 / cg"
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   257
! !
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   258
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   259
!TabSpecRuler methodsFor:'initialization'!
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   260
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   261
initStyle
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   262
    super initStyle.
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   263
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   264
    handleStyle := DefaultHandleStyle.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   265
    handleCursor := (VariablePanel cursorForOrientation:#horizontal) onDevice:device.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   266
    self is3D ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   267
        handleWidth := 2.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   268
    ] ifFalse:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   269
        handleWidth := 1
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   270
    ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   271
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   272
    "Modified: 28.3.1997 / 14:35:23 / cg"
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   273
!
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   274
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   275
initialize
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   276
    super initialize.
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   277
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   278
    tabsAreVariable := true.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   279
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   280
    self enableMotionEvents.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   281
    self enableEnterLeaveEvents.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   282
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   283
    self height:(font height + (2 * font descent)). 
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   284
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   285
    "
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   286
     TabSpecRuler new open
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   287
    "
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   288
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   289
    "Modified: 28.3.1997 / 15:06:29 / cg"
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   290
! !
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   291
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   292
!TabSpecRuler methodsFor:'private'!
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   293
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   294
canMoveTabAtX:x
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   295
    |idx|
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   296
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   297
    tabsAreVariable ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   298
        (idx := self indexOfTabAtX:x) ~~ 0 ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   299
            (fixedTabs notNil and:[fixedTabs includes:idx]) ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   300
                ^ true
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   301
            ]
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   302
        ]
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   303
    ].
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   304
    ^ false
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   305
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   306
    "Created: 28.3.1997 / 15:12:05 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   307
    "Modified: 28.3.1997 / 15:19:01 / cg"
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   308
!
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   309
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   310
indexOfTabAtX:x
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   311
    |xTab minDelta bestIndex|
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   312
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   313
    tabSpec isNil ifTrue:[^ 0].
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   314
    bestIndex := 0.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   315
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   316
    1 to:tabSpec size do:[:i |
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   317
        xTab := tabSpec positionOfTab:i on:self.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   318
        (x between:(xTab-5) and:(xTab+5)) ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   319
            (minDelta isNil 
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   320
            or:[(x - xTab) abs < minDelta]) ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   321
                minDelta := (x - xTab) abs.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   322
                bestIndex := i.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   323
            ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   324
        ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   325
    ].
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   326
    ^ bestIndex
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   327
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   328
    "Modified: 28.3.1997 / 13:43:47 / cg"
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   329
    "Created: 28.3.1997 / 15:12:09 / cg"
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   330
!
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   331
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   332
moveTabAtIndex:idx toX:movedTabX
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   333
    |unitPosition|
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   334
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   335
    unitPosition := (tabSpec unitsPerPixelOn:self) * movedTabX.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   336
    tabSpec moveTabAtIndex:idx to:unitPosition.
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   337
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   338
    "Modified: 28.3.1997 / 14:54:58 / cg"
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   339
! !
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   340
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   341
!TabSpecRuler methodsFor:'redrawing'!
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   342
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   343
drawHandleAtX:x type:handleType
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   344
    "redraw a tabulator handle"
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   345
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   346
    self paint:Black.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   347
    self displayLineFromX:x y:0 toX:x y:height - 1.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   348
    self is3D ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   349
        self paint:White.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   350
        self displayLineFromX:x+1 y:0 toX:x+1 y:height - 1
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   351
    ]
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   352
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   353
    "Modified: 28.3.1997 / 14:35:48 / cg"
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   354
!
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   355
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   356
positionOfTabAtIndex:idx
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   357
    ^ ( tabSpec positionOfTab:idx on:self ) rounded.
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   358
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   359
    "Created: 28.3.1997 / 14:26:28 / cg"
328
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   360
    "Modified: 28.3.1997 / 15:14:03 / cg"
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   361
!
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   362
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   363
redraw
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   364
    "redraw the handles from by tabSpec"
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   365
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   366
    tabSpec isNil ifTrue:[^ self].
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   367
    shown ifFalse:[^ self].
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   368
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   369
    1 to:tabSpec size do:[:idx |
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   370
        self redrawTabAtIndex:idx.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   371
    ]
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   372
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   373
    "Modified: 28.3.1997 / 13:58:26 / cg"
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   374
!
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   375
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   376
redrawTabAtIndex:idx
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   377
    "redraw a single handle"
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   378
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   379
    |x|
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   380
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   381
    tabSpec isNil ifTrue:[^ self].
330
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   382
    (hiddenTabs notNil and:[hiddenTabs includes:idx]) ifTrue:[^ self].
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   383
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   384
    idx == movedTabIndex ifTrue:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   385
        x := movedTabX
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   386
    ] ifFalse:[
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   387
        x := self positionOfTabAtIndex:idx.
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   388
    ].
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   389
    self drawHandleAtX:x type:(tabSpec typeOfTab:idx).
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   390
326
7abb145cb6f4 moving - not yet finished
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   391
    "Created: 28.3.1997 / 13:57:54 / cg"
330
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   392
    "Modified: 28.3.1997 / 15:37:07 / cg"
29
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   393
! !
b1663ac8f532 Initial revision
claus
parents:
diff changeset
   394
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   395
!TabSpecRuler class methodsFor:'documentation'!
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   396
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   397
version
330
e216c5a56f88 hiding tabs
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   398
    ^ '$Header: /cvs/stx/stx/libwidg2/TabSpecRuler.st,v 1.10 1997-03-28 14:40:43 cg Exp $'
200
e1ba0782f37c comments
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   399
! !