DSVColumnView.st
author Stefan Vogel <sv@exept.de>
Wed, 22 May 2019 18:07:59 +0200
changeset 6054 8b6b5de90065
parent 6053 88091f958e67
child 6072 f62d23bf936f
permissions -rw-r--r--
#BUGFIX by stefan class: DSVColumnView changed: #update:with:from: deselect when disabled fia enableChannel
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     1
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     3
              All Rights Reserved
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     4
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    10
 hereby transferred.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    11
"
1754
4dea21fbacee #buttonMotion:x:y: -- with autoScroll support
ca
parents: 1749
diff changeset
    12
"{ Package: 'stx:libwidg2' }"
4dea21fbacee #buttonMotion:x:y: -- with autoScroll support
ca
parents: 1749
diff changeset
    13
4772
11b5f36c5943 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4686
diff changeset
    14
"{ NameSpace: Smalltalk }"
11b5f36c5943 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4686
diff changeset
    15
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    16
View subclass:#DSVColumnView
6054
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    17
	instanceVariableNames:'labelView listHolder editValue editView multipleSelectOk useIndex
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    18
		selectedColIndexHolder selectedRowIndex selectRowOnDefault
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    19
		buttonMotionAction buttonReleaseAction rowHeight minRowHeight
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    20
		columnDescriptors viewOrigin colorMap rowFontAscent lockRowIndex
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    21
		rowIfAbsentBlock columnHolder registererImages list fgColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    22
		separatorSize catchChangeEvents beDependentOfRows bgColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    23
		actionBlock builder tabIntern doubleClickActionBlock
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    24
		verticalSpacing horizontalSpacing rowSelectorForm
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    25
		buttonLightColor buttonShadowColor buttonHalfLightColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    26
		buttonHalfShadowColor checkToggleExtent checkToggleForm
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    27
		checkToggleActiveImage checkTogglePassiveImage
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    28
		checkToggleDisabledActiveImage checkToggleDisabledPassiveImage
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    29
		checkToggleLevel radioButtonActiveImage radioButtonPassiveImage
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    30
		radioButtonDisabledActiveImage radioButtonDisabledPassiveImage
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    31
		comboButtonExtent comboButtonForm comboButtonDisabledForm
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    32
		comboButtonLevel dropSource columnAdaptor tabAtEndAction
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    33
		tabAtStartAction modifiedChannel autoScroll autoScrollBlock
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    34
		needFitColumns scrollWhenUpdating separatorOneDColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    35
		selectionForegroundColor selectionForegroundColorNoFocus
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    36
		selectionBackgroundColor selectionBackgroundColorNoFocus
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    37
		selectionFrameColor selectionFrameColorNoFocus previousExtent
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    38
		selectConditionBlock scrollRowWise autoScrollToColumn
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    39
		cachedPreferredExtent sortListInPlace labelFgColor labelBgColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    40
		updateListHolderWhenSorting ignoreReselect didEditWithDialog'
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    41
	classVariableNames:'DefaultForegroundColor DefaultBackgroundColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    42
		DefaultHilightForegroundColor DefaultHilightBackgroundColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    43
		DefaultHilightFrameColor ButtonLightColor ButtonShadowColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    44
		CheckToggleActiveImage CheckTogglePassiveImage
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    45
		CheckToggleDisabledActiveImage CheckToggleDisabledPassiveImage
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    46
		ButtonHalfLightColor ButtonHalfShadowColor ButtonEdgeStyle
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    47
		CheckToggleForm CheckToggleLevel CheckToggleExtent
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    48
		ComboButtonForm ComboButtonDisabledForm ComboButtonLevel
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    49
		ComboButtonExtent StopRedrawSignal RadioButtonActiveImage
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    50
		RadioButtonPassiveImage RadioButtonDisabledActiveImage
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    51
		RadioButtonDisabledPassiveImage PreselectAllWhenOpeningEditor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    52
		DefaultHilightForegroundColorNoFocus
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    53
		DefaultHilightBackgroundColorNoFocus DefaultLabelForegroundColor
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    54
		DefaultLabelBackgroundColor'
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    55
	poolDictionaries:''
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
    56
	category:'Views-DataSet'
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    57
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    58
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    59
!DSVColumnView class methodsFor:'documentation'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    60
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    61
copyright
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    62
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    63
 COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    64
              All Rights Reserved
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    65
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    66
 This software is furnished under a license and may be used
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    67
 only in accordance with the terms of that license and with the
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    68
 inclusion of the above copyright notice.   This software may not
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    69
 be provided or otherwise made available to, or used by, any
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    70
 other person.  No title to or ownership of the software is
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    71
 hereby transferred.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    72
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    73
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    74
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    75
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    76
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    77
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    78
documentation
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    79
"
2788
8f45f2da80fa selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
    80
    ColumnView part of a DataSetView.
8f45f2da80fa selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
    81
    implements a scrollable selection view based on rows and columns.
8f45f2da80fa selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
    82
    Used as the contents-part of a DataSetView.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    83
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    84
    [Instance variables:]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    85
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    86
        editValue               <Model>                 current editing model
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    87
        editView                <View>                  current editing component
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
    88
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
    89
        buttonReleaseAction     <Action or nil>         called if the mouse button is released
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
    90
        buttonMotionAction      <Action or nil>         called during mouse motion with one
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
    91
                                                        argument the point under the mouse.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
    92
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
    93
        multipleSelectOk        <Boolean>               multiple selection enabled/disabled
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
    94
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    95
        selectedColIndex        <Integer>               selected column index or 0
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
    96
        selectedRowIndex        <Integer>               selected row    index or 0
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
    97
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    98
        rowHeight               <Integer>               maximum height of any row
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
    99
        minRowHeight            <Integer>               minimum height of all displayed labels
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   100
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   101
        columnDescriptors       <SequancableCollection> list of column descriptors
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   102
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   103
        viewOrigin              <Point>                 current view origin
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   104
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   105
        colorMap                <Dictionary>            store and register used colors on device
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   106
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   107
        rowFontAscent           <SmallInteger>          inset of a printable text in a row
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   108
                                                        including separator and font ascent.
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   109
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   110
        lockRowIndex            <SmallInteger>          internal used to indicate a row which has
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   111
                                                        changed its contents but no redraw should be
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   112
                                                        done( at:put: ).
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   113
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   114
        columnHolder            <ValueHolder>           holder which keeps the list of column descriptors.
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   115
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   116
        registererImages        <IdentityDictionary>    list of images registered on the device
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   117
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   118
        list                    <SequancableCollection> list of rows
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   119
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   120
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   121
        catchChangeEvents       <Boolean>               internal used to discard change notifications
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   122
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   123
        beDependentOfRows       <Boolean>               keep rows dependent; on default is disabled.
567
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
   124
                                                        in case of enabled a row can raise a change
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
   125
                                                        notification whithout a parameter which
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
   126
                                                        will force a redraw of the row or the
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
   127
                                                        readSelector of the column which will
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
   128
                                                        redraw the cell in the row only.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   129
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   130
        fgColor                 <Color>                 foreground color
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   131
        bgColor                 <Color>                 background color
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   132
        hgLgFgColor             <Color>                 highlight foreground color (selected)
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   133
        hgLgBgColor             <Color>                 highlight background color (selected)
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   134
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   135
        buttonLightColor        <Color>                 LightColor      ( drawing the edge of a button )
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   136
        buttonShadowColor       <Color>                 ShadowColor     ( drawing the edge of a button )
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   137
        buttonHalfLightColor    <Color>                 HalfLightColor  ( drawing the edge of a button )
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   138
        buttonHalfShadowColor   <Color>                 HalfShadowColor ( drawing the edge of a button )
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   139
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   140
        actionBlock             <a OneArgBlock>         action block performed on select
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   141
        doubleClickActionBlock  <a OneArgBlock>         action block performed on double click
5308
4e35010e00be #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
   142
        rowIfAbsentBlock        <a OneArgBlock>         this block is performed on an empty list entry
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   143
                                                        to retrive the item from the application. The
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   144
                                                        argument to the block is the index into the list.
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   145
                                                        The block should return the row instance which
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   146
                                                        is put to the list under the index.
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   147
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   148
        builder                 <UIBuilder>             builder set by application
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   149
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   150
        verticalSpacing         <SmallInteger>          vertical   row spacing( top  & bottom )
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   151
        horizontalSpacing       <SmallInteger>          horizontal row spacing( left & right )
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   152
        separatorSize           <SmallInteger>          line width of a vertical or horizontal separator
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   153
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   154
        rowSelectorForm         <Form>                  form used by a row selector
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   155
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   156
        checkToggleForm         <Form>                  form used by a checkToggle
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   157
        checkToggleExtent       <Point>                 extent of a checkToggle
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   158
        checkToggleLevel        <SmallInteger>          level used to draw a check toggle
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   159
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   160
        comboButtonForm         <Form>                  form used by a comboList or -Box
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   161
        comboButtonExtent       <Point>                 extent of a comboList or -Box
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   162
        comboButtonLevel        <SmallInteger>          level used to draw a comboList or -Box
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   163
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   164
        dropTarget              <DropTarget>            drag & drop target
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   165
        dropSource              <DropSource>            drag & drop source
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   166
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   167
    [author:]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   168
        Claus Atzkern
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   169
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   170
    [see also:]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   171
        DataSetColumnSpec
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   172
        DataSetColumn
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   173
        DataSetView
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   174
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   175
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   176
647
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
   177
!DSVColumnView class methodsFor:'defaults'!
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
   178
1844
05a9cb2fc86f default font
martin
parents: 1842
diff changeset
   179
defaultFont
05a9cb2fc86f default font
martin
parents: 1842
diff changeset
   180
    ^ SelectionInListView defaultFont
05a9cb2fc86f default font
martin
parents: 1842
diff changeset
   181
!
05a9cb2fc86f default font
martin
parents: 1842
diff changeset
   182
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   183
horizontalSpacing
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   184
    "returns the default horizontal space between rows
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   185
    "
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   186
    ^ 4
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   187
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   188
!
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   189
3961
6cd0b3929aa2 added: #preselectAllWhenOpeningEditor:
Claus Gittinger <cg@exept.de>
parents: 3960
diff changeset
   190
preselectAllWhenOpeningEditor:aBoolean
6cd0b3929aa2 added: #preselectAllWhenOpeningEditor:
Claus Gittinger <cg@exept.de>
parents: 3960
diff changeset
   191
    PreselectAllWhenOpeningEditor := aBoolean
6cd0b3929aa2 added: #preselectAllWhenOpeningEditor:
Claus Gittinger <cg@exept.de>
parents: 3960
diff changeset
   192
6cd0b3929aa2 added: #preselectAllWhenOpeningEditor:
Claus Gittinger <cg@exept.de>
parents: 3960
diff changeset
   193
    "Created: / 02-11-2010 / 22:00:28 / cg"
6cd0b3929aa2 added: #preselectAllWhenOpeningEditor:
Claus Gittinger <cg@exept.de>
parents: 3960
diff changeset
   194
!
6cd0b3929aa2 added: #preselectAllWhenOpeningEditor:
Claus Gittinger <cg@exept.de>
parents: 3960
diff changeset
   195
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   196
updateStyleCache
2777
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   197
    "extract values from the styleSheet and cache them in class variables"
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   198
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   199
    <resource: #style (#textForegroundColor
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
   200
                       #'scrollableView.backgroundColor'
2777
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   201
                       #'button.lightColor'
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   202
                       #'button.shadowColor'
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   203
                       #'button.halfLightColor'
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   204
                       #'button.halfShadowColor'
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   205
                       #'button.edgeStyle'
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   206
                       #'checkToggle.activeImage'
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   207
                       #'checkToggle.passiveImage'
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   208
                       #'radioButton.activeImage'
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   209
                       #'radioButton.passiveImage'
582
222fc7c63af0 new resource naming
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   210
                       #'selection.hilightForegroundColor'
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   211
                       #'selection.hilightBackgroundColor'
4875
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   212
                       #'selection.hilightFrameColor'
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   213
                       #'dataSet.labelView.foregroundColor'
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   214
                       #'dataSet.labelView.backgroundColor'
3988
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   215
    )>
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   216
1333
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   217
    DefaultForegroundColor        := StyleSheet colorAt:#'textForegroundColor' default:(Color black).
3986
163354e9ee4c changed: #updateStyleCache
Claus Gittinger <cg@exept.de>
parents: 3964
diff changeset
   218
    "/ DefaultBackgroundColor        := StyleSheet colorAt:#'scrollableView.backgroundColor' default:DefaultViewBackgroundColor.
163354e9ee4c changed: #updateStyleCache
Claus Gittinger <cg@exept.de>
parents: 3964
diff changeset
   219
    DefaultBackgroundColor        := StyleSheet colorAt:#'selection.backgroundColor' default:DefaultViewBackgroundColor.
1333
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   220
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   221
    DefaultHilightForegroundColor := StyleSheet colorAt:#'selection.hilightForegroundColor' default:DefaultBackgroundColor.
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   222
    DefaultHilightBackgroundColor := StyleSheet colorAt:#'selection.hilightBackgroundColor' default:DefaultForegroundColor.
4644
a1734dfe9bfe class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4613
diff changeset
   223
    DefaultHilightForegroundColorNoFocus := StyleSheet colorAt:#'selection.hilightForegroundColorNoFocus'.
a1734dfe9bfe class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4613
diff changeset
   224
    DefaultHilightBackgroundColorNoFocus := StyleSheet colorAt:#'selection.hilightBackgroundColorNoFocus'.
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   225
    DefaultHilightFrameColor      := StyleSheet colorAt:#'selection.hilightFrameColor'. "/ no default; nil means: no frame
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
   226
647
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
   227
    DefaultHilightForegroundColor = DefaultHilightBackgroundColor ifTrue:[
988
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   228
        DefaultHilightBackgroundColor := Color black
647
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
   229
    ].
1333
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   230
    ButtonLightColor       := StyleSheet colorAt:#'button.lightColor'.
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   231
    ButtonShadowColor      := StyleSheet colorAt:#'button.shadowColor'.
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   232
    ButtonHalfLightColor   := StyleSheet colorAt:#'button.halfLightColor'.
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   233
    ButtonHalfShadowColor  := StyleSheet colorAt:#'button.halfShadowColor'.
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   234
    ButtonEdgeStyle        := StyleSheet at:#'button.edgeStyle'.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   235
1333
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   236
    CheckToggleActiveImage := StyleSheet at:#'checkToggle.activeImage'.
1100
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
   237
    CheckToggleActiveImage isNil ifTrue:[
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
   238
        CheckTogglePassiveImage := nil
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
   239
    ] ifFalse:[
1333
011e6414dae5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
   240
        CheckTogglePassiveImage := StyleSheet at:#'checkToggle.passiveImage'.
1100
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
   241
        CheckTogglePassiveImage isNil ifTrue:[
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
   242
            CheckToggleActiveImage := nil
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
   243
        ]
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
   244
    ].
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
   245
    "/ CheckToggleDisabledActiveImage := StyleSheet at:#'checkToggle.disabledActiveImage'.
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
   246
    "/ CheckToggleDisabledPassiveImage := StyleSheet at:#'checkToggle.disabledPassiveImage'.
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
   247
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   248
    CheckToggleForm   := nil.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   249
    CheckToggleLevel  := nil.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   250
    CheckToggleExtent := nil.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   251
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   252
    RadioButtonActiveImage := StyleSheet at:#'radioButton.activeImage'.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   253
    RadioButtonPassiveImage := StyleSheet at:#'radioButton.passiveImage'.
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
   254
    "/ RadioButtonDisabledActiveImage := StyleSheet at:#'radioButton.disabledActiveImage'.
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
   255
    "/ RadioButtonDisabledPassiveImage := StyleSheet at:#'radioButton.disabledPassiveImage'.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   256
    (RadioButtonActiveImage isNil or:[ RadioButtonPassiveImage isNil ]) ifTrue:[
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   257
        RadioButtonActiveImage := RadioButton roundOnForm.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   258
        RadioButtonPassiveImage := RadioButton roundOffForm.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   259
    ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   260
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   261
    ComboButtonForm   := nil.
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   262
    ComboButtonLevel  := nil.
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   263
    ComboButtonExtent := nil.
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   264
4875
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   265
    DefaultLabelBackgroundColor := StyleSheet at:#'dataSet.labelView.backgroundColor' default:nil.
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   266
    DefaultLabelForegroundColor := StyleSheet at:#'dataSet.labelView.foregroundColor' default:nil.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   267
2777
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   268
    "
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   269
     self updateStyleCache.
56bb352f6b91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2776
diff changeset
   270
    "
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   271
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   272
    "Modified: / 20-01-2011 / 08:44:28 / cg"
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
   273
    "Modified (comment): / 17-08-2018 / 17:06:46 / Claus Gittinger"
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   274
!
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   275
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   276
verticalSpacing
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   277
    "returns the default vertical space between rows
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   278
    "
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   279
    ^ 2
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
   280
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   281
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   282
2711
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   283
!DSVColumnView class methodsFor:'image specs'!
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   284
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   285
dragIconMulti
988
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   286
    "This resource specification was automatically generated
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   287
     by the ImageEditor of ST/X."
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   288
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   289
    "Do not manually edit this!! If it is corrupted,
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   290
     the ImageEditor may not be able to read the specification."
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   291
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   292
    "
988
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   293
     self dragIconMulti inspect
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   294
     ImageEditor openOnClass:self andSelector:#dragIconMulti
5100
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   295
     Icon flushCachedIcons
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   296
    "
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   297
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   298
    <resource: #image>
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   299
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   300
    ^Icon
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   301
        constantNamed:'DSVColumnView class dragIconMulti'
5100
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   302
        ifAbsentPut:[(Depth1Image width:32 height:32) bits:(ByteArray fromPackedString:'
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   303
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O?<0@C??L@@<@@@@O@@@@C3??L@<??3@OO?<<C3??O@<??0@OO?<@C3???0<???<OO???C3???0<???<OO???@C?
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   304
??0@???<@O???@C???0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b')
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   305
            colorMapFromArray:#[0 0 0 255 255 255]
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   306
            mask:((ImageMask width:32 height:32) bits:(ByteArray fromPackedString:'
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   307
@@@@@@@@@@@@@@@@@@@@@O??<@C???@@???<@O???@C????@????0O????C????0?????O????3?????????????????????????????????????????????
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   308
????????@????0O???<C????@????0@@@@@@@@@@@@@@@@@@@@@b'); yourself); yourself]
1926
9bcb6b59ea37 if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents: 1844
diff changeset
   309
!
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   310
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   311
dragIconSingle
988
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   312
    "This resource specification was automatically generated
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   313
     by the ImageEditor of ST/X."
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   314
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   315
    "Do not manually edit this!! If it is corrupted,
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   316
     the ImageEditor may not be able to read the specification."
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   317
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   318
    "
988
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   319
     self dragIconSingle inspect
d077faaade27 better hilight colors
tz
parents: 896
diff changeset
   320
     ImageEditor openOnClass:self andSelector:#dragIconSingle
5100
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   321
     Icon flushCachedIcons
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   322
    "
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   323
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   324
    <resource: #image>
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   325
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   326
    ^Icon
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   327
        constantNamed:'DSVColumnView class dragIconSingle'
5100
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   328
        ifAbsentPut:[(Depth1Image width:32 height:32) bits:(ByteArray fromPackedString:'
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   329
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O?<0@C??L@@??30@O?<<@C??@@@??0@@O???@C???0@???<@O???@C???0@???<@O???@C???0@???<@O???@C??
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   330
?0@???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b')
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   331
            colorMapFromArray:#[0 0 0 255 255 255]
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   332
            mask:((ImageMask width:32 height:32) bits:(ByteArray fromPackedString:'
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   333
@@@@@@@@@@@@@@@@@@@@@O??<@C???@@???<@O???@C???<@????@O???<C????@????0O???<C????@????0O???<C????@????0O???<C????@????0O??
16a95d366ed5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
   334
?<C????@????0O???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b'); yourself); yourself]
2711
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   335
!
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   336
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   337
rowSelectorImage
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   338
    "This resource specification was automatically generated
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   339
     by the ImageEditor of ST/X."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   340
2711
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   341
    "Do not manually edit this!! If it is corrupted,
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   342
     the ImageEditor may not be able to read the specification."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   343
2711
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   344
    "
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   345
     self rowSelectorImage inspect
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   346
     ImageEditor openOnClass:self andSelector:#rowSelectorImage
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   347
     Icon flushCachedIcons
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   348
    "
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   349
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   350
    <resource: #image>
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   351
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   352
    ^Icon
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   353
        constantNamed:'DSVColumnView class rowSelectorImage'
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   354
        ifAbsentPut:[(Depth2Image width:11 height:11) bits:(ByteArray fromPackedString:'@ @@@#@@*#0@@C,@O>(0N*($J*$P@BT@*!!P@@!!@@@ @@')
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   355
            colorMapFromArray:#[0 0 0 127 127 127 170 170 170 255 255 255]
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   356
            mask:((ImageMask width:11 height:11) bits:(ByteArray fromPackedString:'C@@N@@<@?8C?0O? ?<C? @<@C @L@@@a'); yourself); yourself]
1926
9bcb6b59ea37 if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents: 1844
diff changeset
   357
! !
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   358
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   359
!DSVColumnView class methodsFor:'signal constants'!
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   360
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   361
stopRedrawSignal
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   362
    "returns the signal which is raised during drawing if the
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   363
     required label height is less than the current rowHeight
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   364
    "
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   365
    StopRedrawSignal isNil ifTrue:[
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   366
        StopRedrawSignal := Notification newSignalMayProceed:true.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   367
        StopRedrawSignal nameClass:self message:#stopRedrawSignal.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   368
    ].
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   369
    ^ StopRedrawSignal
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   370
! !
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
   371
886
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   372
!DSVColumnView methodsFor:'accessing'!
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   373
1042
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
   374
builder
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   375
    "get the builder (UIBuilder or nil)"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   376
1042
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
   377
    ^ builder
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
   378
!
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
   379
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   380
builder:aBuilder
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   381
    "set the builder (UIBuilder or nil)"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   382
1042
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
   383
    builder := aBuilder
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
   384
!
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
   385
886
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   386
columnView
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   387
    "returns self"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   388
886
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   389
    ^ self
1067
c66188014600 keep a reference to my dataSetView.
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   390
!
c66188014600 keep a reference to my dataSetView.
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   391
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   392
heightOfContents
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   393
    "return the height of the contents in pixels"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   394
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
   395
    cachedPreferredExtent isNil ifTrue:[
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   396
        self preferredExtent
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   397
    ].
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
   398
    ^ cachedPreferredExtent y
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   399
!
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   400
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
   401
labelView
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
   402
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
   403
    ^labelView
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
   404
!
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
   405
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   406
labelView:aView
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   407
    labelView := aView for:self.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   408
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
   409
    labelView layout:(LayoutFrame
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   410
                        leftFraction:0 offset:0
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   411
                        rightFraction:1 offset:0
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   412
                        topFraction:0 offset:0
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
   413
                        bottomFraction:0 offset:[self preferredLabelViewHeight]).
1067
c66188014600 keep a reference to my dataSetView.
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   414
!
c66188014600 keep a reference to my dataSetView.
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   415
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   416
level:aLevel
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   417
    "change the level and thus the level of the labelView"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   418
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   419
    aLevel ~~ level ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   420
        super level:aLevel.
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
   421
"/        labelView level:aLevel.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   422
    ]
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   423
!
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   424
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
   425
preferredLabelViewHeight
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
   426
    ^ labelView preferredHeight "/ + (labelView margin + self verticalSpacing * 2).
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
   427
!
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
   428
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   429
rowFontAscent
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   430
    "returns the inset of a printable text in a row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   431
1087
8e97cbfebe12 add some comment
ca
parents: 1067
diff changeset
   432
    ^ rowFontAscent
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   433
!
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   434
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   435
selectedColIndex:newSelectedColIndex
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   436
    self selectedColIndexHolder value:newSelectedColIndex
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   437
!
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   438
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   439
selectedColIndexHolder
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   440
    selectedColIndexHolder isNil ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   441
        selectedColIndexHolder := ValueHolder new.
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   442
    ].
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
   443
    ^ selectedColIndexHolder
886
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   444
! !
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   445
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
   446
!DSVColumnView methodsFor:'accessing-actions'!
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   447
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   448
action:aOneArgAction
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   449
    "set the action block to be performed on select"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   450
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   451
    actionBlock := aOneArgAction
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   452
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   453
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   454
doubleClickAction:aOneArgAction
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   455
    "set the action block to be performed on doubleclick"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   456
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   457
    doubleClickActionBlock := aOneArgAction
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   458
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   459
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   460
rowIfAbsent:aOneArgAction
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   461
    "set the action block to be performed on each 'nil' entry into the
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   462
     list. The argument to the block is the index into the list. The
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   463
     block returns the row which is put to the list"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   464
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   465
    rowIfAbsentBlock := aOneArgAction
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   466
!
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   467
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   468
selectConditionBlock
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   469
    "get the select-conditionBlock; this block is evaluated before
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   470
     any selection change is performed (passing the to-be-changed row number
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   471
     index as arg).
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   472
     The change will not be done, if the block returns false. "
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   473
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   474
    ^ selectConditionBlock
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   475
!
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   476
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   477
selectConditionBlock:aOneArgBlockOrNil
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   478
    "set the select-conditionBlock; this block is evaluated before
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   479
     any selection change is performed (passing the to-be-changed row number
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   480
     index as arg).
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   481
     The change will not be done, if the block returns false. "
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   482
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   483
    selectConditionBlock := aOneArgBlockOrNil.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   484
!
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
   485
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   486
tabAtEndAction:aNoneArgAction
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   487
    "set the action, called without any argument at end of the list entering
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   488
     tab next.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   489
     The default is to give the focus to the view after self in the focusSequence"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   490
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   491
    tabAtEndAction := aNoneArgAction
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   492
!
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   493
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   494
tabAtStartAction:aNoneArgAction
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   495
    "set the action, called without any argument at start of the list entering
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   496
     tab previous.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   497
     The default is to give the focus to the view before self in the focusSequence"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   498
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
   499
    tabAtStartAction := aNoneArgAction
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   500
! !
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   501
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
   502
!DSVColumnView methodsFor:'accessing-behavior'!
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
   503
3130
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   504
autoScrollToColumn
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   505
    "return true, if I scroll to the column, when one is selected."
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   506
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   507
    ^ autoScrollToColumn
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   508
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   509
    "Created: / 22-10-2006 / 11:01:25 / cg"
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   510
!
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   511
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   512
autoScrollToColumn:aBoolean
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   513
    "control, if I should scroll to the column, when one is selected.
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   514
     The default is true"
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   515
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   516
    autoScrollToColumn := aBoolean
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   517
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   518
    "Created: / 22-10-2006 / 11:01:46 / cg"
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   519
!
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
   520
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   521
beDependentOfRows
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   522
    "make myself dependent of any row; in this case any change notification
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   523
     raised by a row is catched and the cell identified by the 'readSelector'
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   524
     is redrawn. In case of a nil readSelector, the whole raw is redrawn.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   525
        -> row changed:'what'
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   526
     By default, the attribute is set to false (disabled)."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   527
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   528
    ^ beDependentOfRows
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   529
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   530
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   531
beDependentOfRows:aBool
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   532
    "make myself dependent of any row; in this case any change notification
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   533
     raised by a row is catched and the cell identified by the 'readSelector'
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   534
     is redrawn. In case of a nil readSelector, the whole raw is redrawn.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   535
        -> row changed:'what'
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   536
     By default, the attribute is set to false (disabled)."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   537
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   538
    aBool ~~ beDependentOfRows ifTrue:[
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
   539
        beDependentOfRows := aBool.
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   540
        aBool ifTrue:[
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   541
            self makeDependentOfRows
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   542
        ] ifFalse:[
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   543
            self makeIndependentOfRows
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   544
        ].
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
   545
    ]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
   546
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
   547
1805
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   548
enableChannel:aChannel
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   549
    enableChannel notNil ifTrue:[
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   550
        enableChannel removeDependent:self
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   551
    ].
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   552
    (enableChannel := aChannel) notNil ifTrue:[
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   553
        enableChannel addDependent:self
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   554
    ].
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   555
!
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
   556
5664
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   557
ignoreReselect
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   558
    "controls if clicking on an already selected item should
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   559
     be ignored or should perform the select action again.
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   560
     By default, these are ignored"
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   561
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   562
    ^ ignoreReselect
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   563
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   564
    "Created: / 22-10-2006 / 11:01:25 / cg"
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   565
!
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   566
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   567
ignoreReselect:aBoolean
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   568
    "controls if clicking on an already selected item should
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   569
     be ignored or should perform the select action again.
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   570
     By default, these are ignored"
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   571
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   572
    ignoreReselect := aBoolean
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   573
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   574
    "Created: / 22-10-2006 / 11:01:25 / cg"
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   575
!
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
   576
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   577
makeDependentOfRows
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   578
    "make myself dependent of any row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   579
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   580
    list size ~~ 0 ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   581
        list do:[:aRow |
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   582
            aRow notNil ifTrue:[
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   583
                aRow addDependent:self
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   584
            ]
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   585
        ]
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   586
    ]
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   587
!
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   588
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   589
makeIndependentOfRows
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   590
    "make myself independent of any row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   591
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   592
    list size ~~ 0 ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   593
        list do:[:aRow |
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   594
            aRow notNil ifTrue:[
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   595
                aRow removeDependent:self
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   596
            ]
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   597
        ]
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   598
    ]
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   599
!
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
   600
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
   601
multipleSelectOk
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   602
    "allow/disallow multiple row selections; the default is false"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   603
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
   604
    ^ multipleSelectOk
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
   605
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
   606
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   607
multipleSelectOk:sBoolean
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   608
    "allow/disallow multiple row selections; the default is false"
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   609
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   610
    |colIdx rowIdx|
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   611
5447
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
   612
    sBoolean == multipleSelectOk ifTrue:[^ self ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   613
    colIdx := rowIdx := 0.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   614
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   615
    self hasSelection ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   616
        colIdx := self selectedColIndex.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   617
        rowIdx := self selectedRowIndex.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   618
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   619
        rowIdx isSequenceable ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   620
            rowIdx := rowIdx at:1 ifAbsent:0
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   621
        ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   622
        self setSelectColIndex:0 rowIndex:0 openEditor:false.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   623
    ].
5447
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
   624
    multipleSelectOk := sBoolean.
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
   625
    self selectColIndex:colIdx rowIndex:rowIdx openEditor:false.
5447
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
   626
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
   627
    "Modified (format): / 04-02-2017 / 21:31:30 / cg"
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
   628
!
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
   629
1938
079c19d965c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
   630
opaqueColumnResize
079c19d965c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
   631
    ^ labelView opaqueColumnResize
079c19d965c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
   632
!
079c19d965c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
   633
079c19d965c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
   634
opaqueColumnResize:aBoolean
079c19d965c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
   635
    labelView opaqueColumnResize:aBoolean
079c19d965c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
   636
!
079c19d965c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
   637
1946
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   638
scrollWhenUpdating
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   639
    "return the scroll behavior, when I get a new text
1946
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   640
     (via the model or the #contents/#list)
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   641
     Possible returnValues are:
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   642
        #keep / nil     -> no change
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   643
        #endOfText      -> scroll to the end
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   644
        #beginOfText    -> scroll to the top
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   645
     The default is #beginOfText.
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   646
     This may be useful for fields which get new values assigned from
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   647
     the program (i.e. not from the user)"
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   648
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   649
    ^ scrollWhenUpdating
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   650
!
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   651
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   652
scrollWhenUpdating:aSymbolOrNil
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   653
    "define how to scroll, when I get a new text
1946
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   654
     (via the model or the #contents/#list)
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   655
     Allowed arguments are:
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   656
        #keep / nil     -> no change
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   657
        #endOfText      -> scroll to the end
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   658
        #beginOfText    -> scroll to the top
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   659
     The default is #beginOfText.
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   660
     This may be useful for fields which get new values assigned from
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   661
     the program (i.e. not from the user)"
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   662
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   663
    scrollWhenUpdating := aSymbolOrNil
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   664
!
0738b9f8c19f preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents: 1941
diff changeset
   665
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
   666
selectRowOnDefault
3449
2ba8e55953aa some comments changed into reasonable english
Claus Gittinger <cg@exept.de>
parents: 3428
diff changeset
   667
    "if true, in case of selecting a none selectable cell, the row is selected.
2ba8e55953aa some comments changed into reasonable english
Claus Gittinger <cg@exept.de>
parents: 3428
diff changeset
   668
     If false, nothing is selected. The default is true."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   669
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
   670
    ^ selectRowOnDefault
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
   671
!
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
   672
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   673
selectRowOnDefault:aBool
3449
2ba8e55953aa some comments changed into reasonable english
Claus Gittinger <cg@exept.de>
parents: 3428
diff changeset
   674
    "if true, in case of selecting a none selectable cell, the row is selected.
2ba8e55953aa some comments changed into reasonable english
Claus Gittinger <cg@exept.de>
parents: 3428
diff changeset
   675
     If false, nothing is selected. The default is true."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   676
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
   677
    selectRowOnDefault := aBool
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   678
!
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   679
5195
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   680
sortListInPlace
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   681
    "when false (default for backward compatibility):
5195
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   682
     if sorting, create a copy
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   683
     of the list, which is wrong when useIndex is on,
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   684
     as the application will get the index in the sorted
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   685
     list, which is probably different from tha apps list mode.
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   686
     When true (should be default, but that might break many
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   687
     users), the passed in list is sorted in place (i.e. possibly
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   688
     sorting the application's list)."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   689
5195
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   690
    ^ sortListInPlace
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   691
!
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   692
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   693
sortListInPlace:aBoolean
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   694
    "when false (default for backward compatibility):
5195
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   695
     if sorting, create a copy
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   696
     of the list, which is wrong when useIndex is on,
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   697
     as the application will get the index in the sorted
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   698
     list, which is probably different from tha apps list mode.
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   699
     When true (should be default, but that might break many
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   700
     users), the passed in list is sorted in place (i.e. possibly
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   701
     sorting the application's list)."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   702
5195
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   703
    sortListInPlace := aBoolean.
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   704
!
1d15a878af42 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5194
diff changeset
   705
1668
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
   706
tabIntern
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   707
    "returns true if tabing is supported in the widget"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   708
1668
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
   709
    ^ tabIntern
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
   710
!
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
   711
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   712
tabIntern:aBool
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   713
    "returns true if tabing is supported in the widget"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   714
1668
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
   715
    tabIntern := aBool ? true
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
   716
!
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
   717
5194
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   718
updateListHolderWhenSorting
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   719
    "return true if the the listHolder's value are be updated,
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   720
     when I sort a list.
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   721
     By default, this is false so it must be set explicitly
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   722
     (for bug-backward compatibility,
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   723
     and to avoid introducing new side effects)."
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   724
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   725
    ^ updateListHolderWhenSorting
5194
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   726
!
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   727
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   728
updateListHolderWhenSorting:aBoolean
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   729
    "define if the the listHolder's value should be updated,
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   730
     when I sort a list.
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   731
     By default, this is false so it must be set explicitly
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   732
     (for bug-backward compatibility,
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   733
     and to avoid introducing new side effects)."
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   734
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   735
    updateListHolderWhenSorting := aBoolean
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   736
!
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
   737
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   738
useIndex
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   739
    "specify, if the selected components value or its index in the
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   740
     list should be sent to the model. The default is its index."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   741
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   742
    ^ useIndex
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   743
!
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   744
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   745
useIndex:aBool
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   746
    "specify, if the selected components value or its index in the
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   747
     list should be sent to the model. The default is its index."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   748
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   749
    useIndex := aBool
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   750
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   751
5639
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   752
!DSVColumnView methodsFor:'accessing-channels'!
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   753
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   754
modifiedChannel
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   755
    ^ modifiedChannel
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   756
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   757
    "Created: / 30.1.2000 / 12:10:57 / cg"
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   758
!
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   759
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   760
modifiedChannel:something
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   761
    modifiedChannel := something.
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   762
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   763
    "Created: / 30.1.2000 / 12:10:57 / cg"
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   764
! !
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   765
f3534ebb5c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5603
diff changeset
   766
!DSVColumnView methodsFor:'accessing-color & font'!
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   767
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   768
backgroundColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   769
    "get the background color of the rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   770
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   771
    ^ bgColor
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   772
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   773
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   774
backgroundColor:aColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   775
    "set the background color of the rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   776
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   777
    bgColor ~~ aColor ifTrue:[
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   778
        super viewBackground:bgColor.
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   779
        self realized ifTrue:[
4991
ddee68d07788 device access
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
   780
            bgColor := aColor onDevice:device.
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   781
            self invalidate
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   782
        ] ifFalse:[
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   783
            bgColor := aColor
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   784
        ]
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   785
    ]
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   786
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   787
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   788
foregroundColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   789
    "return the foreground color of the rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   790
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   791
    ^ fgColor
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   792
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   793
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   794
foregroundColor:aColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   795
    "set the foreground color of the rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   796
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   797
    fgColor ~~ aColor ifTrue:[
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   798
        self realized ifTrue:[
4991
ddee68d07788 device access
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
   799
            fgColor := aColor onDevice:device.
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   800
            self invalidate
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   801
        ] ifFalse:[
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   802
            fgColor := aColor
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   803
        ]
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   804
    ]
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   805
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   806
4875
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   807
labelBackgroundColor
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   808
    "get the background color of the label row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   809
4875
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   810
    ^ labelBgColor ? bgColor
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   811
!
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   812
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   813
labelForegroundColor
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   814
    "get the foreground color of the label row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   815
4875
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   816
    ^ labelFgColor ? fgColor
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   817
!
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
   818
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
   819
selectionBackgroundColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   820
    "returns the background color of a selected row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   821
3138
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   822
    self hasFocus ifTrue:[
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   823
        ^ selectionBackgroundColor
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   824
    ].
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   825
    ^ selectionBackgroundColorNoFocus.
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   826
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   827
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
   828
selectionForegroundColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   829
    "returns the foreground color of a selected row"
3138
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   830
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   831
    self hasFocus ifTrue:[
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   832
        ^ selectionForegroundColor
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   833
    ].
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
   834
    ^ selectionForegroundColorNoFocus.
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   835
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   836
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   837
selectionFrameColor
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   838
    "returns the frame color of a selected row"
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   839
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   840
    self hasFocus ifTrue:[
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   841
        ^ selectionFrameColor
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   842
    ].
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   843
    ^ selectionFrameColorNoFocus.
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   844
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   845
    "Created: / 20-01-2011 / 08:45:08 / cg"
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   846
!
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   847
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   848
separatorDarkColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   849
    "returns the dark color used for drawing a shadowed separator (3D)"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   850
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   851
    ^ shadowColor
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   852
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   853
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   854
separatorLightColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   855
    "returns the light color used for drawing a shadowed separator (3D)"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   856
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   857
    ^ lightColor
2637
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   858
!
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   859
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   860
separatorOneDColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   861
    "returns the color used for drawing a oneD separator"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   862
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   863
    separatorOneDColor isNil ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   864
        ^ fgColor
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   865
    ].
2637
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   866
    ^ separatorOneDColor
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   867
!
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   868
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   869
separatorOneDColor:aColorOrNil
2637
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   870
    "set the color used for drawing a oneD separator; if the color
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   871
     is nil, the current forgroundColor is used"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   872
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   873
    separatorOneDColor = aColorOrNil ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   874
        ^ self
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   875
    ].
2637
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   876
    separatorOneDColor := aColorOrNil.
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   877
    self realized ifTrue:[
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   878
        separatorOneDColor notNil ifTrue:[
4991
ddee68d07788 device access
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
   879
            separatorOneDColor := separatorOneDColor onDevice:device.
2637
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   880
        ].
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   881
        self invalidate.
d563163414b8 add color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   882
    ].
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   883
! !
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
   884
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
   885
!DSVColumnView methodsFor:'accessing-columns'!
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   886
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   887
columnAt:anIndex
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   888
    <resource: #obsolete>
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   889
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   890
    "returns the column at an index"
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   891
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   892
    self obsoleteMethodWarning:'use columnDescriptorAt:'.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   893
    ^ self columnDescriptorAt:anIndex
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   894
!
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   895
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   896
columnDescriptorAt:anIndex
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   897
    "returns the columnDescriptor at an index"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   898
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
   899
    ^ columnDescriptors at:anIndex ifAbsent:nil
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   900
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   901
886
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   902
columnDescriptors
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   903
    "returns list of column descriptors"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   904
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   905
    ^ columnDescriptors collect:[:aCol | aCol description ]
886
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   906
!
57bd1eddba23 catch empty line in redraw
ca
parents: 874
diff changeset
   907
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   908
columnDescriptors:aColumnDescriptionList
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   909
    "set the columnDescriptors;
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   910
     scroll to top and deselect"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   911
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   912
    self columnDescriptors:aColumnDescriptionList deselect:true scrollToTop:true
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   913
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   914
    "Modified: / 13-09-2017 / 15:05:05 / cg"
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   915
!
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   916
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   917
columnDescriptors:aColumnDescriptionList deselect:deselect scrollToTop:scrollToTop
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   918
    "set the columnDescriptors;
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   919
     if deselect is true, then deselect;
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   920
     if scrollToTop is true, then scroll to top;
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   921
     otherwise, take the current selection and try to make it visible"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   922
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   923
    |delta indexOfFirstRow|
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   924
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   925
    deselect ifTrue:[
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   926
        self deselect.
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   927
    ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   928
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   929
    (viewOrigin x ~~ 0 or:[ viewOrigin y ~~ 0 ]) ifTrue:[
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   930
        scrollToTop ifTrue:[
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   931
            delta := viewOrigin negated.
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   932
            viewOrigin := 0 @ 0.
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   933
            self originChanged:delta
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   934
        ] ifFalse:[
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   935
            indexOfFirstRow := self yVisibleToRowNr:0.
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   936
        ].
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   937
    ].
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   938
    self setColumnDescriptors:aColumnDescriptionList.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   939
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   940
    indexOfFirstRow notNil ifTrue:[
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   941
        self scrollToRowAt:indexOfFirstRow colAt:1.
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   942
    ].
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   943
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   944
    "Created: / 13-09-2017 / 15:04:50 / cg"
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   945
!
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   946
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   947
columnDescriptors:aColumnDescriptionList scrollToTop:scrollToTop
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   948
    "set the columnDescriptors and deselect;
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   949
     if scrollToTop is true, then scroll to top;
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   950
     otherwise, take the current selection and try to make it visible"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   951
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   952
    self columnDescriptors:aColumnDescriptionList deselect:true scrollToTop:scrollToTop
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   953
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
   954
    "Created: / 13-09-2017 / 15:03:15 / cg"
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   955
!
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   956
2703
252b881f86ad added accessor #dataSetColumns
james
parents: 2702
diff changeset
   957
dataSetColumns
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   958
    "returns the list of DataSetColumns; each column represents a DataSetColumnSpec"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   959
2703
252b881f86ad added accessor #dataSetColumns
james
parents: 2702
diff changeset
   960
    ^ columnDescriptors
252b881f86ad added accessor #dataSetColumns
james
parents: 2702
diff changeset
   961
!
252b881f86ad added accessor #dataSetColumns
james
parents: 2702
diff changeset
   962
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   963
firstColumn
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   964
    "returns the first column"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   965
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   966
    ^ columnDescriptors at:1
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   967
!
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   968
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   969
lastColumn
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   970
    "returns the last column"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   971
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   972
    ^ columnDescriptors last
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   973
!
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   974
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   975
setColumnDescriptors:aColumnDescriptionList
5310
8b7aff55b666 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5308
diff changeset
   976
    "set the columnDescriptors; don't deselect and do not scroll to top"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   977
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   978
    |cid|
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   979
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   980
    cid := 0.
3536
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   981
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   982
    aColumnDescriptionList isEmptyOrNil ifTrue:[
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   983
        columnDescriptors := OrderedCollection new.
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   984
    ] ifFalse:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   985
        columnDescriptors := aColumnDescriptionList
3536
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   986
            collect:
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   987
                [:el||dsc lbl|
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
   988
                    dsc := el isSequenceable
3536
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   989
                                ifTrue:[DataSetColumnSpec decodeFromLiteralArray:el]
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   990
                                ifFalse:[el].
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   991
                    cid := cid + 1.
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   992
                    lbl := DataSetLabel new description:dsc builder:builder on:labelView.
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   993
                    DataSetColumn new on:self description:dsc columnNumber:cid label:lbl
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   994
                ].
3afcdcca3101 bugfix: setColumnDescriptors:
ca
parents: 3519
diff changeset
   995
    ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   996
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
   997
    cachedPreferredExtent := nil.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   998
    labelView columns:columnDescriptors.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   999
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1000
    self fitColumns.
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1001
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1002
    "Modified: / 07-01-2012 / 16:46:59 / cg"
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  1003
    "Modified (format): / 13-09-2017 / 15:04:01 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1004
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1005
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
  1006
!DSVColumnView methodsFor:'accessing-interactors'!
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1007
1100
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  1008
checkToggleActiveImage
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  1009
    ^ checkToggleActiveImage
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  1010
!
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  1011
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1012
checkToggleExtent
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1013
    "returns the extent of a checkToggle"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1014
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1015
    ^ checkToggleExtent
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1016
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1017
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1018
checkToggleForm
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1019
    "returns the form of a checkToggle"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1020
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1021
    ^ checkToggleForm
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1022
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1023
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1024
checkToggleLevel
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1025
    "returns the level of a checkToggle button"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1026
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1027
    ^ checkToggleLevel
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1028
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1029
1100
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  1030
checkTogglePassiveImage
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  1031
    ^ checkTogglePassiveImage
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  1032
!
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  1033
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1034
comboButtonExtent
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1035
    "returns the extent of a comboList or -Box"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1036
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1037
    ^ comboButtonExtent
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1038
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1039
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1040
comboButtonForm
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1041
    "returns the form of a comboList or -Box"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1042
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1043
    ^ comboButtonForm
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1044
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1045
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1046
comboButtonLevel
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1047
    "returns the level of a comboList or -Box button"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1048
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1049
    ^ comboButtonLevel
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1050
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1051
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1052
radioButtonExtent
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1053
    "returns the extent of a radio button"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1054
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1055
    ^ radioButtonActiveImage extent
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1056
!
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1057
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1058
rowSelectorExtent
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1059
    "returns the bitmap of a selected row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1060
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1061
    ^ rowSelectorForm extent
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1062
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1063
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1064
rowSelectorForm
2711
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1065
    "returns the (arrow-) image shown for a selected row.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1066
     (the arrow shown in the first column)"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1067
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1068
    ^ rowSelectorForm
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1069
! !
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  1070
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
  1071
!DSVColumnView methodsFor:'accessing-mvc'!
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1072
1008
7874385db982 changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
  1073
columnAdaptor
7874385db982 changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
  1074
    "return the value of the instance variable 'columnAdaptor' (automatically generated)"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1075
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1076
    columnAdaptor isValueModel ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1077
        ^ columnAdaptor value
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1078
    ].
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1079
    ^ columnAdaptor
1711
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1080
!
1008
7874385db982 changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
  1081
5969
fa2bd856b54d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5952
diff changeset
  1082
columnAdaptor:usuallyAnApplication
1008
7874385db982 changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
  1083
    "set the value of the instance variable 'columnAdaptor' (automatically generated)"
7874385db982 changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
  1084
1711
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1085
    columnAdaptor isValueModel ifTrue:[
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1086
        columnAdaptor removeDependent:self
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1087
    ].
5969
fa2bd856b54d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5952
diff changeset
  1088
    (columnAdaptor := usuallyAnApplication) isValueModel ifTrue:[
1711
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1089
        columnAdaptor addDependent:self
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1090
    ].
5969
fa2bd856b54d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5952
diff changeset
  1091
fa2bd856b54d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5952
diff changeset
  1092
    "Modified (format): / 21-11-2018 / 19:32:57 / Claus Gittinger"
1711
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1093
!
1008
7874385db982 changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
  1094
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1095
columnHolder
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1096
    "get the valueHolder, which keeps the list of column descriptions"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1097
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1098
    ^ columnHolder
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1099
!
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1100
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1101
columnHolder:aValueHolder
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1102
    "set the valueHolder, which keeps the list of column descriptions"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1103
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1104
    |columns|
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1105
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1106
    columnHolder notNil ifTrue:[
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1107
        columnHolder removeDependent:self
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1108
    ].
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1109
    (columnHolder := aValueHolder) notNil ifTrue:[
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1110
        columnHolder addDependent:self.
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1111
        columns := columnHolder value.
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1112
        columns notNil ifTrue:[
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1113
            self columnDescriptors:columns
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1114
        ]
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1115
    ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1116
!
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1117
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1118
listAt:index put:newElement
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1119
    "kludge callback, when an element hs to be replaced
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1120
     due to a col-adaptor returning a new row element"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1121
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1122
    |list|
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1123
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1124
    (list := listHolder value) notNil ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1125
        list at:index put:newElement
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1126
    ]
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1127
!
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1128
2318
41a4297a87af access method for the listHolder
ca
parents: 2276
diff changeset
  1129
listHolder
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1130
    "get the valueHolder which holds the list of rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1131
2318
41a4297a87af access method for the listHolder
ca
parents: 2276
diff changeset
  1132
    ^ listHolder
41a4297a87af access method for the listHolder
ca
parents: 2276
diff changeset
  1133
!
41a4297a87af access method for the listHolder
ca
parents: 2276
diff changeset
  1134
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1135
listHolder:aListHolder
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1136
    "set the valueHolder which holds the list of rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1137
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1138
    listHolder ~~ aListHolder ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1139
        listHolder notNil ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1140
            listHolder removeDependent:self
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1141
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1142
        (listHolder := aListHolder) notNil ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1143
            listHolder addDependent:self
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1144
        ]
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1145
    ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1146
    self pushEvent:#list: with:(listHolder value).
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1147
!
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1148
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1149
model:aModel
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1150
    "set the valueHolder which holds the selection and maybe the list of rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1151
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1152
    model notNil ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1153
        model removeDependent:self.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1154
        (model respondsTo:#list) ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1155
            (model list == listHolder) ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1156
                self listHolder:nil
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1157
            ]
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1158
        ]
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1159
    ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1160
    (model := aModel) notNil ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1161
        model addDependent:self.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1162
        (aModel respondsTo:#list) ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1163
            self listHolder:model list
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1164
        ]
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1165
    ]
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1166
! !
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1167
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
  1168
!DSVColumnView methodsFor:'accessing-rows'!
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1169
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1170
at:aRowNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1171
    "return the row at an index, aRowNr"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1172
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1173
    |row|
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1174
3994
f44c9cded11e changed: #at:
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  1175
    list isNil ifTrue:[^ nil].
3757
05d3a8228fdd changed: #at:
Claus Gittinger <cg@exept.de>
parents: 3742
diff changeset
  1176
    (row := list at:aRowNr ifAbsent:nil) isNil ifTrue:[
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1177
        lockRowIndex := aRowNr.
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1178
1034
bd02c4cd7582 care for nonexisting rowIfAbsentBlock when a nil-row is encountered.
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
  1179
        (rowIfAbsentBlock notNil
bd02c4cd7582 care for nonexisting rowIfAbsentBlock when a nil-row is encountered.
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
  1180
        and:[(row := rowIfAbsentBlock value:aRowNr) notNil]) ifTrue:[
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1181
            list at:aRowNr put:row.
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1182
            beDependentOfRows ifTrue:[row addDependent:self].
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1183
        ].
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1184
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1185
        lockRowIndex := 0
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1186
    ].
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1187
    ^ row
1034
bd02c4cd7582 care for nonexisting rowIfAbsentBlock when a nil-row is encountered.
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
  1188
3994
f44c9cded11e changed: #at:
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  1189
    "Modified: / 22-01-2011 / 09:14:48 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1190
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1191
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1192
at:aRowNr ifAbsent:exceptionBlock
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1193
    "return the row at a aRowNr. If the index is invalid, return the
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1194
     result of evaluating the exceptionblock"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1195
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  1196
    (aRowNr between:1 and:list size) ifTrue:[
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1197
        ^ self at:aRowNr
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1198
    ].
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1199
    ^ exceptionBlock value
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1200
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1201
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1202
at:aRowNr put:aRow
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1203
    "change the row at an index. The added row is returned"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1204
1956
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1205
    lockRowIndex ~~ aRowNr ifTrue:[
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1206
        (aRowNr <= list size and:[ (list at:aRowNr) == aRow ]) ifTrue:[
1956
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1207
            self invalidateRowAt:aRowNr
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1208
        ] ifFalse:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1209
            self
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1210
                replaceFrom:aRowNr
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1211
                to:aRowNr
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1212
                with:(Array with:aRow)
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1213
                startingAt:1.
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1214
        ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1215
    ].
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1216
    ^ aRow
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1217
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1218
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1219
first
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1220
    "return the first row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1221
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1222
    ^ self at:1
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1223
!
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1224
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1225
identityIndexOfRow:aRow
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1226
    "returns index of a row or 0"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1227
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1228
    (list size ~~ 0 and:[ aRow notNil ]) ifTrue:[
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1229
        ^ list identityIndexOf:aRow
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1230
    ].
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1231
    ^ 0
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1232
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1233
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1234
last
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1235
    "return the last row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1236
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  1237
    ^ self at:(list size)
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1238
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1239
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1240
list
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1241
    "get the list of rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1242
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1243
    ^ list
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1244
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1245
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1246
list:aRawList
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1247
    "set the list of rows"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1248
3897
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1249
    |newList selectionHasChanged sortColNr sortSelectorOrBlock sortBlockSelector sortBlock|
656
96a9b94e5472 bugfix:
ca
parents: 649
diff changeset
  1250
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1251
    "/ remove selection without redraw
622
2588f809445d update:with:from:
ca
parents: 618
diff changeset
  1252
1259
be271bf31e4b raise selectionChanged notification in case that
tm
parents: 1258
diff changeset
  1253
    selectionHasChanged := self hasSelection.
be271bf31e4b raise selectionChanged notification in case that
tm
parents: 1258
diff changeset
  1254
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  1255
    self destroyEditView.
622
2588f809445d update:with:from:
ca
parents: 618
diff changeset
  1256
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  1257
    self selectedColIndex:0.
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1258
    selectedRowIndex := multipleSelectOk ifTrue:[nil] ifFalse:[0].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1259
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1260
    shown ifFalse:[
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1261
        cachedPreferredExtent := nil
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1262
    ] ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1263
        aRawList size == 0 ifTrue:[
2834
edddf1a3c2ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2816
diff changeset
  1264
            "/ keep old column-width information
edddf1a3c2ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2816
diff changeset
  1265
        ] ifFalse:[
2524
a41c43dba6c9 care for nil colDescr.
Claus Gittinger <cg@exept.de>
parents: 2523
diff changeset
  1266
            columnDescriptors notNil ifTrue:[
a41c43dba6c9 care for nil colDescr.
Claus Gittinger <cg@exept.de>
parents: 2523
diff changeset
  1267
                columnDescriptors do:[:aCol| aCol invalidate ].
a41c43dba6c9 care for nil colDescr.
Claus Gittinger <cg@exept.de>
parents: 2523
diff changeset
  1268
            ].
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1269
            cachedPreferredExtent := nil.
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1270
        ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1271
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1272
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1273
    beDependentOfRows ifTrue:[
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1274
        self makeIndependentOfRows
656
96a9b94e5472 bugfix:
ca
parents: 649
diff changeset
  1275
    ].
643
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  1276
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1277
    aRawList size == 0 ifTrue:[
1948
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  1278
        list := nil.
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  1279
        viewOrigin := 0 @ 0.
2834
edddf1a3c2ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2816
diff changeset
  1280
    ] ifFalse:[
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1281
        "/ list := OrderedCollection withAll:aRawList.
4613
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1282
        sortListInPlace ifTrue:[
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1283
            newList := aRawList
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1284
        ] ifFalse:[
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1285
            newList := aRawList copyAsOrderedCollection.
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1286
        ].
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1287
        (sortColNr := labelView indexOfSortColumn) notNil ifTrue:[
3897
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1288
            sortBlockSelector := (columnDescriptors at:sortColNr) sortBlockSelector.
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1289
            sortBlockSelector notNil ifTrue:[
3964
df77ea0f171d changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1290
                sortBlock := self application aspectFor:sortBlockSelector.
3897
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1291
                newList sort:sortBlock
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1292
            ] ifFalse:[
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1293
                sortSelectorOrBlock := (columnDescriptors at:sortColNr) sortSelector.
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1294
                sortSelectorOrBlock notNil ifTrue:[
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1295
                    sortSelectorOrBlock isBlock ifTrue:[
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1296
                        newList sort:sortSelectorOrBlock
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1297
                    ] ifFalse:[
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1298
                        newList sort:[:a :b | (a perform:sortSelectorOrBlock) < (b perform:sortSelectorOrBlock)]
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1299
                    ].
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1300
                ].
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1301
            ].
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1302
            labelView reverseSort ifTrue:[
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1303
                newList reverse.
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1304
            ].
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1305
        ].
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1306
        list := newList.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1307
5194
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  1308
        sortListInPlace ifFalse:[
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  1309
            listHolder notNil ifTrue:[
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  1310
                updateListHolderWhenSorting ifTrue:[
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  1311
                    listHolder value:newList withoutNotifying:self.
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  1312
                ].
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  1313
            ].
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  1314
        ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1315
2836
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1316
        beDependentOfRows ifTrue:[
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1317
            self makeDependentOfRows
5989b6c71e87 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1318
        ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1319
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1320
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  1321
    shown ifTrue:[
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  1322
        self fitColumns
1949
0d9451776275 delayed fitColumns if not shown while list is changed.
ps
parents: 1948
diff changeset
  1323
    ] ifFalse:[
0d9451776275 delayed fitColumns if not shown while list is changed.
ps
parents: 1948
diff changeset
  1324
        needFitColumns := true
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  1325
    ].
1259
be271bf31e4b raise selectionChanged notification in case that
tm
parents: 1258
diff changeset
  1326
    selectionHasChanged ifTrue:[
be271bf31e4b raise selectionChanged notification in case that
tm
parents: 1258
diff changeset
  1327
        self selectionChanged.
be271bf31e4b raise selectionChanged notification in case that
tm
parents: 1258
diff changeset
  1328
    ].
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1329
    cachedPreferredExtent := nil.
2044
8e36106065f0 fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents: 2032
diff changeset
  1330
    self contentsChanged.
3897
3c7724395afc changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3855
diff changeset
  1331
3964
df77ea0f171d changed: #list:
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1332
    "Modified: / 08-11-2010 / 22:07:49 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1333
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1334
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1809
diff changeset
  1335
!DSVColumnView methodsFor:'accessing-visibility'!
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1336
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1337
font:aFont
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1338
    "set the font for all shown rows."
5563
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1339
    |newGCFont|
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1340
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1341
    (aFont isNil or:[aFont = self font]) ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1342
        ^ self
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1343
    ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1344
5563
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1345
    columnDescriptors isEmptyOrNil ifTrue:[
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  1346
        super font:aFont.
5563
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1347
        self labelView font:aFont.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1348
        rowFontAscent := self font ascent.
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  1349
        rowHeight     := verticalSpacing + (self font height) + verticalSpacing + separatorSize.
5563
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1350
        minRowHeight  := rowHeight.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1351
        ^ self
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1352
    ].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1353
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1354
    "/ close current editor if open
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1355
    self destroyEditView.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1356
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1357
    newGCFont := aFont.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1358
    realized ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1359
        |visibleColumns font oldSize newSize factor minimum|
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1360
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1361
        newGCFont := aFont onDevice:self graphicsDevice.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1362
        factor := (newGCFont height / gc font height) asFloat.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1363
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1364
        minimum := self separatorSize + (2 * self horizontalSpacing).
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1365
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1366
        factor = 1 ifFalse:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1367
            "/ there are columns which are more or less invisible (exlude rowSelector)
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1368
            visibleColumns := columnDescriptors select:[:eachColumn|
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1369
                (eachColumn rendererType ~~ #rowSelector and:[eachColumn width > minimum])
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1370
            ].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1371
        ].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1372
        visibleColumns notEmptyOrNil ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1373
            factor < 1 ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1374
                "/ check if zoomOut is allowed
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1375
                visibleColumns do:[: eachColumn|
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1376
                    (eachColumn width * factor) > (minimum+1) ifFalse:[^ self].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1377
                ].
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1378
            ].
5563
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1379
            visibleColumns do:[:eachColumn|
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1380
                eachColumn setDescWidth:(eachColumn width * factor) rounded.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1381
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1382
                font := eachColumn label font.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1383
                font notNil ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1384
                    font sizeUnit ~~ #px ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1385
                        oldSize := font size.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1386
                        newSize := (oldSize * factor) rounded.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1387
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1388
                        (newSize ~= oldSize and:[newSize >= 4]) ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1389
                            font := font asSize:newSize.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1390
                            font notNil ifTrue:[eachColumn label font:font].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1391
                        ].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1392
                    ].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1393
                ].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1394
            ].
1842
402a364ee001 delegate font to labelView
martin
parents: 1818
diff changeset
  1395
        ].
5563
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1396
    ].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1397
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1398
    super font:newGCFont.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1399
5563
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1400
    rowFontAscent := self font ascent.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1401
    rowHeight     := verticalSpacing + self font height + verticalSpacing + separatorSize.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1402
    minRowHeight  := rowHeight.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1403
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1404
    columnDescriptors do:[:eachColumn| eachColumn invalidate].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1405
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1406
    labelView font:self font.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1407
    self labelView fontChanged.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1408
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1409
    cachedPreferredExtent := nil.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1410
    viewOrigin := 0 @ 0.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1411
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1412
    realized ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1413
        self fitColumns.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1414
        superView recomputeLayouts.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1415
        self invalidate.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1416
        self labelView invalidate.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1417
        self contentsChanged.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1418
        self makeSelectionVisible.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  1419
    ].
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  1420
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  1421
    "Modified (format): / 13-09-2017 / 15:34:22 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1422
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1423
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1424
has3Dseparators
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1425
    "returns true if shown in 3D mode"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1426
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1427
    ^ separatorSize ~~ 1
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1428
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1429
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1430
has3Dseparators:aBool
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1431
    "enable or disable 3D mode"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1432
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1433
    |newSepSize|
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1434
3672
ff861e62db1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3604
diff changeset
  1435
    newSepSize := aBool ifTrue:[2] ifFalse:[1].
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1436
    newSepSize ~~ separatorSize ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1437
        separatorSize := newSepSize.
1149
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1438
        realized ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1439
            columnDescriptors do:[:aCol |
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1440
                aCol invalidate
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1441
            ].
1136
4a9d9db81422 set bg/fg color when drawing an interactor
ca
parents: 1134
diff changeset
  1442
            self preferredExtentChanged.
1149
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1443
            self invalidate.
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1444
            self contentsChanged
647
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  1445
        ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1446
    ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1447
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1448
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1449
horizontalSpacing
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1450
    "horizontal spacing used by columns"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1451
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1452
    ^ horizontalSpacing
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1453
!
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1454
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1455
horizontalSpacing:aNumber
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1456
    "horizontal spacing used by columns"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1457
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1458
    horizontalSpacing ~~ aNumber ifTrue:[
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1459
        horizontalSpacing := aNumber.
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1460
        self preferredExtentChanged.
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1461
    ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1462
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1463
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1464
showLabels
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1465
    "control the labels view to be visible or unvisible"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1466
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1467
    ^ labelView isVisible
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1468
!
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1469
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1470
showLabels:aBoolean
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1471
    "control the labels view to be visible or unvisible"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1472
5447
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
  1473
    labelView isVisible:aBoolean
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
  1474
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
  1475
    "Modified (format): / 04-02-2017 / 21:31:43 / cg"
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1476
!
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1477
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1478
verticalSpacing
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1479
    "vertical spacing used by columns"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1480
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1481
    ^ verticalSpacing
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1482
!
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1483
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1484
verticalSpacing:aNumber
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1485
    "vertical spacing used by columns"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1486
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1487
    verticalSpacing ~~ aNumber ifTrue:[
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1488
        verticalSpacing := aNumber.
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1489
        self preferredExtentChanged.
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  1490
    ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1491
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1492
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1493
!DSVColumnView methodsFor:'adding & removing rows'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1494
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1495
add:aRow
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1496
    "insert row at end"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1497
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  1498
    ^ self add:aRow beforeIndex:(1 + list size)
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1499
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1500
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1501
add:aRow afterIndex:aRowNr
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1502
    "add a new row after slot aRowNr and redisplay; returns nil in case
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1503
     of an invalid index or the row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1504
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1505
    ^ self add:aRow beforeIndex:(aRowNr + 1)
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1506
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1507
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1508
add:aRow beforeIndex:aRowNr
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1509
    "add a new row before slot aRowNr and redisplay; returns nil in case
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1510
     of an invalid index or the row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1511
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1512
    self addAll:(Array with:aRow) beforeIndex:aRowNr.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1513
    ^ aRow.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1514
!
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1515
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1516
addAll:aList beforeIndex:start
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1517
    "add a collection of rows before slot start and redisplay"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1518
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1519
    |y0 y1 yD h dH size noSel|
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1520
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1521
    (size := aList size) == 0 ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1522
        ^ self
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1523
    ].
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1524
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1525
    beDependentOfRows ifTrue:[
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1526
        aList do:[:aRow| aRow notNil ifTrue:[aRow addDependent:self]]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1527
    ].
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  1528
4116
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1529
    list isNil ifTrue:[
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1530
        self list:aList.
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1531
    ] ifFalse:[
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1532
        noSel := self numberOfSelections.
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1533
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1534
        noSel ~~ 0 ifTrue:[
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1535
            multipleSelectOk ifFalse:[
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1536
                selectedRowIndex >= start ifTrue:[
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1537
                    selectedRowIndex := selectedRowIndex + size
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1538
                ]
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1539
            ] ifTrue:[
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1540
                1 to:noSel do:[:i||v|
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1541
                    (v := selectedRowIndex at:i) >= start ifTrue:[
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1542
                        selectedRowIndex at:i put:(v + size)
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1543
                    ]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1544
                ]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1545
            ]
4116
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1546
        ].
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1547
        list addAll:aList beforeIndex:start.
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1548
    ].
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  1549
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1550
    self recomputeHeightOfContents.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1551
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1552
    y0 := (start - 1) * rowHeight.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1553
    yD := size * rowHeight.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1554
    y1 := y0 + yD.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1555
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1556
    y0 < viewOrigin y ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1557
        self originWillChange.
1948
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  1558
        viewOrigin := viewOrigin x @ (yD + viewOrigin y).
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  1559
        "/ viewOrigin y:(yD + viewOrigin y).
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1560
        self originChanged:(0 @ yD).
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1561
    ].
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1562
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1563
    (shown not or:[self sensor hasDamageFor:self]) ifTrue:[
2044
8e36106065f0 fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents: 2032
diff changeset
  1564
        self invalidate.
8e36106065f0 fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents: 2032
diff changeset
  1565
        self contentsChanged.
8e36106065f0 fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents: 2032
diff changeset
  1566
        ^ self
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1567
    ].
645
53c78cc2ee08 redraw twice in case of expose event during adding a new entry
ca
parents: 643
diff changeset
  1568
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1569
    y0 := self yVisibleOfRowNr:start.
1258
d41cbd2c3dc8 addAll:...
tm
parents: 1227
diff changeset
  1570
    h  := height - margin.
d41cbd2c3dc8 addAll:...
tm
parents: 1227
diff changeset
  1571
    y1 := y0 + yD min:h.
d41cbd2c3dc8 addAll:...
tm
parents: 1227
diff changeset
  1572
d41cbd2c3dc8 addAll:...
tm
parents: 1227
diff changeset
  1573
    (y1 > margin and:[y0 < h]) ifTrue:[
1952
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1574
        "/ cg: if I have a non-solid background color,
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1575
        "/ or individual items have a bgColor selector,
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1576
        "/ invalidate the area (and readraw) instead of a scroll.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1577
        (viewBackground isImageOrForm
1952
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1578
        or:[ self anyColumnHasPotentialNonConstantBackground ])
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1579
        ifTrue:[
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1580
            "/ do not scroll but invalidate ...
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1581
            self invalidateX:margin y:y0 width:width - margin - margin height:(height - y0).
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1582
        ] ifFalse:[
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1583
            h  := h - y1.
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1584
            y0 := y0 max:margin.
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1585
            dH := y1 - y0.
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1586
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1587
            start == list size ifFalse:[
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1588
                self copyFrom:self x:0 y:y0 toX:0 y:y1 width:width height:h async:false
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1589
            ].
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1590
            self invalidateX:margin y:y0 width:width - margin - margin height:dH.
1da01418012a if any col has potential non-constant background,
ps
parents: 1951
diff changeset
  1591
        ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1592
    ].
3478
85c3eb472b36 scrollToBottom if scrollWhenUpdating is #endOfText in #addAll:beforeIndex:
fm
parents: 3458
diff changeset
  1593
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1594
    self contentsChanged.
3478
85c3eb472b36 scrollToBottom if scrollWhenUpdating is #endOfText in #addAll:beforeIndex:
fm
parents: 3458
diff changeset
  1595
85c3eb472b36 scrollToBottom if scrollWhenUpdating is #endOfText in #addAll:beforeIndex:
fm
parents: 3458
diff changeset
  1596
    (scrollWhenUpdating == #end or:[scrollWhenUpdating == #endOfText]) ifTrue:[
85c3eb472b36 scrollToBottom if scrollWhenUpdating is #endOfText in #addAll:beforeIndex:
fm
parents: 3458
diff changeset
  1597
        self scrollToBottom.
85c3eb472b36 scrollToBottom if scrollWhenUpdating is #endOfText in #addAll:beforeIndex:
fm
parents: 3458
diff changeset
  1598
    ].
567
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
  1599
!
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
  1600
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1601
addFirst:aRow
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1602
    "insert a row at start"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1603
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1604
    ^ self add:aRow beforeIndex:1
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1605
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1606
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1607
remove:aRow
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1608
    "remove a row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1609
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1610
    |idx|
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1611
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1612
    idx := list identityIndexOf:aRow.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1613
    idx ~~ 0 ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1614
        self removeFrom:idx to:idx.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1615
    ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1616
    ^ aRow
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1617
!
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1618
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1619
removeFirst
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1620
    "remove first row; returns the removed row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1621
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  1622
    ^ self removeIndex:1
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1623
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1624
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1625
removeFrom:startIndex to:stopIndex
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1626
    "remove rows from start to stop"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1627
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1628
    |coll noRedraw
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1629
     noSel "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1630
     size  "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1631
     start "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1632
     stop  "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1633
     y0    "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1634
     y1    "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1635
     oY    "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1636
     dY    "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1637
     yB    "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1638
     h     "{ Class: SmallInteger }"
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1639
    |
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1640
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1641
    (    (start := startIndex) < 1
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1642
     or:[(stop := stopIndex) > list size]
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1643
    ) ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1644
        ^ self subscriptBoundsError:start
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  1645
    ].
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1646
    size := stop - start + 1.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1647
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1648
    beDependentOfRows ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1649
        list from:start to:stop do:[:r| r notNil ifTrue:[r removeDependent:self]].
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1650
    ].
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1651
    noSel := self numberOfSelections.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1652
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1653
    noSel ~~ 0 ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1654
        noSel == 1 ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1655
            noSel := self firstIndexSelected.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1656
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1657
            noSel < start ifFalse:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1658
                noSel > stop ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1659
                    noSel := noSel - size.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1660
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1661
                    multipleSelectOk ifFalse:[selectedRowIndex := noSel]
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1662
                                      ifTrue:[selectedRowIndex at:1 put:noSel]
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1663
                ] ifFalse:[
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  1664
                    editValue notNil ifTrue:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  1665
                        editValue removeDependent:self.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  1666
                        editValue := nil.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  1667
                    ].
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1668
                    self deselect.
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  1669
                ]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1670
            ]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  1671
        ] ifFalse:[
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1672
            coll := OrderedCollection new:noSel.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1673
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1674
            selectedRowIndex do:[:i|
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1675
                i < start ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1676
                    coll add:i
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1677
                ] ifFalse:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1678
                    i > stop ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1679
                        coll add:(i - size)
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1680
                    ]
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1681
                ]
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1682
            ].
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1683
            coll size == 0 ifTrue:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1684
                self deselect
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1685
            ] ifFalse:[
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1686
                selectedRowIndex := coll
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1687
            ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1688
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1689
    ].
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1690
    list removeFrom:start to:stop.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1691
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1692
    y0 := (start - 1) * rowHeight.
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1693
    dY := size * rowHeight.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1694
    y1 := dY + y0.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1695
    yB := y1 + margin - viewOrigin y.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1696
    self recomputeHeightOfContents.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1697
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1698
    y0 < (oY := viewOrigin y) ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1699
        (noRedraw := y1 <= oY) ifFalse:[dY := y0 - oY]
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1700
                                ifTrue:[dY := dY negated].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1701
        self originWillChange.
1948
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  1702
        viewOrigin := viewOrigin x @ (dY + oY).
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  1703
        "/ viewOrigin y:(dY + oY).
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1704
        self originChanged:(0 @ dY).
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1705
    ] ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1706
        noRedraw := y0 > (height + viewOrigin y)
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1707
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1708
1483
c9fd1b1d775d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1709
    (shown not or:[self sensor hasDamageFor:self]) ifTrue:[
c9fd1b1d775d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1710
          self invalidate.
c9fd1b1d775d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1711
        ^ self contentsChanged.
c9fd1b1d775d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1712
    ].
c9fd1b1d775d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1713
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1714
    (noRedraw or:[shown not]) ifFalse:[
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1715
        y0 := self yVisibleOfRowNr:start.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1716
        y0 := y0 max:margin.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1717
1951
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1718
        "/ cg: if I have a non-solid background color,
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1719
        "/ or individual items have a bgColor selector,
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1720
        "/ invalidate the area (and readraw) instead of a scroll.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1721
        (viewBackground isImageOrForm
1951
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1722
        or:[ self anyColumnHasPotentialNonConstantBackground ])
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1723
        ifTrue:[
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1724
            "/ do not scroll but invalidate ...
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1725
        ] ifFalse:[
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1726
            y1 := yB.
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1727
            h  := height - margin - yB.
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1728
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1729
            h > 0 ifTrue:[
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1730
                self copyFrom:self x:0 y:yB toX:0 y:y0 width:width height:h async:false
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1731
            ].
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  1732
            y0 := y0 + h.
561
43b62e424d52 check height is positive before copy
ca
parents: 556
diff changeset
  1733
        ].
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  1734
        self invalidateX:margin y:y0 width:width - margin - margin height:(height - y0).
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1735
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1736
    self contentsChanged.
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1737
!
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1738
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1739
removeIndex:aRowNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1740
    "remove row at an index; returns the removed row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1741
861
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1742
    |row|
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1743
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1744
    row := list at:aRowNr ifAbsent:nil.
a227a3ca27e7 bug fix in multi selection
ca
parents: 859
diff changeset
  1745
    self removeFrom:aRowNr to:aRowNr.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1746
    ^ row
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1747
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1748
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1749
removeLast
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1750
    "remove last row; the row is returned"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1751
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  1752
    ^ self removeIndex:(list size)
1956
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1753
!
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1754
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1755
replaceFrom:start to:stop with:aCollection startingAt:repStart
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1756
    "replace elements in the receiver between index start and stop,
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1757
     with elements  taken from replacementCollection starting at repStart.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1758
     Return the receiver."
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1759
2032
6eb610caad85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1760
    |inSelList listSize repStop run|
1956
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1761
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1762
    inSelList := OrderedCollection new.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1763
    listSize  := list size.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1764
    repStop   := repStart + (stop - start).
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1765
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1766
    list isNil ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1767
        list := OrderedCollection new
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1768
    ].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1769
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1770
    [listSize < stop] whileTrue:[ list add:nil. listSize := listSize + 1 ].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1771
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1772
    start to:stop do:[:i| |aRow|
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1773
        aRow := list at:i ifAbsent:nil.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1774
1956
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1775
        aRow notNil ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1776
            beDependentOfRows ifTrue:[aRow removeDependent:self].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1777
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1778
            (self isInSelection:i) ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1779
                inSelList add:i
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1780
            ].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1781
            list at:i put:nil.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1782
        ]
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1783
    ].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1784
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1785
    beDependentOfRows ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1786
        aCollection from:repStart to:repStop do:[:aRow|
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1787
            aRow notNil ifTrue:[aRow addDependent:self]
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1788
        ]
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1789
    ].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1790
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1791
    run := start.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1792
    aCollection from:repStart to:repStop do:[:aRow|
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1793
        list at:run put:aRow.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1794
        run := run + 1.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1795
    ].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1796
    self invalidateRowsFrom:start to:stop.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1797
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1798
    inSelList size ~~ 0 ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1799
        self numberOfSelections == inSelList size ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1800
            self deselect
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1801
        ] ifFalse:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1802
            selectedRowIndex := selectedRowIndex select:[:i| (inSelList identityIndexOf:i) == 0 ].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1803
            self selectionChanged.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1804
        ]
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  1805
    ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1806
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1807
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1808
!DSVColumnView methodsFor:'change & update'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1809
1492
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  1810
changeWidthOfColumn:aColumn deltaX:aDeltaX
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  1811
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  1812
    aColumn setDescWidth:(aColumn width + aDeltaX).
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1813
    cachedPreferredExtent notNil ifTrue:[self fitColumns]
1492
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  1814
!
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  1815
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1816
update:what with:aPara from:chgObj
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1817
    "one of my rows/cells changed its value"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1818
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1819
    |row listHoldersList arg1 arg2 col|
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1820
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1821
    chgObj == columnHolder ifTrue:[
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1822
        cachedPreferredExtent := nil.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1823
        self columnDescriptors:(columnHolder value).
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1824
        ^ self.
622
2588f809445d update:with:from:
ca
parents: 618
diff changeset
  1825
    ].
1711
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1826
    chgObj == columnAdaptor ifTrue:[
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1827
        col := columnAdaptor value.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1828
        columnDescriptors do:[:aCol |
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1829
            aCol columnAdaptor:col
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1830
        ].
2776
73715c613579 *** empty log message ***
penk
parents: 2733
diff changeset
  1831
        self invalidate.
73715c613579 *** empty log message ***
penk
parents: 2733
diff changeset
  1832
        ^ self
1711
97e1fd579b89 columnAdapter can now be a valueHolder
ca
parents: 1673
diff changeset
  1833
    ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1834
    chgObj == editValue ifTrue:[
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1835
        self updateColumnFromEditValue.
1227
2dd18061afc5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1836
        ^ self
622
2588f809445d update:with:from:
ca
parents: 618
diff changeset
  1837
    ].
6053
88091f958e67 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6051
diff changeset
  1838
    chgObj == enableChannel ifTrue:[
6054
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
  1839
        enableChannel value ifFalse:[
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
  1840
            self deselect.  "Selected Checkboxes can still be edited, so deselect"
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
  1841
        ].        
6053
88091f958e67 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6051
diff changeset
  1842
        self invalidate.
88091f958e67 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6051
diff changeset
  1843
        ^ self
88091f958e67 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6051
diff changeset
  1844
    ].
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1845
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1846
    chgObj == model ifTrue:[
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1847
        (what == #selectionIndex or:[ what == #selection ]) ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1848
            self selectRowIndex:(model selectionIndex copy).
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1849
            ^ self.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1850
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1851
        what == #list ifTrue:[
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1852
            cachedPreferredExtent := nil.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1853
            self listHolder:model list.
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1854
            ^ self.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1855
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1856
        what == #value ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1857
            model == listHolder ifTrue:[
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1858
                cachedPreferredExtent := nil.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1859
                self list:(listHolder value)
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1860
            ] ifFalse:[
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  1861
                useIndex ifTrue:[
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  1862
                    self selectRowIndex:model value
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  1863
                ] ifFalse:[
6051
d7240d502ea7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6043
diff changeset
  1864
                    |myList newSel|
d7240d502ea7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6043
diff changeset
  1865
d7240d502ea7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6043
diff changeset
  1866
                    myList := self list ? #().
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  1867
                    multipleSelectOk ifTrue:[
6051
d7240d502ea7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6043
diff changeset
  1868
                        newSel := (model value ? #()) 
d7240d502ea7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6043
diff changeset
  1869
                                    collect:[:each | myList indexOf:each]
d7240d502ea7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6043
diff changeset
  1870
                                    thenSelect:[:eachIdx | eachIdx ~~ 0].
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  1871
                    ] ifFalse:[
6051
d7240d502ea7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6043
diff changeset
  1872
                        newSel := myList indexOf:model value
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  1873
                    ].
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  1874
                    self selectRowIndex:newSel
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  1875
                ].
2776
73715c613579 *** empty log message ***
penk
parents: 2733
diff changeset
  1876
            ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1877
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1878
        ^ self
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1879
    ].
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1880
4219
5038c1c44e84 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4176
diff changeset
  1881
    (chgObj == listHolder) ifTrue:[
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1882
        cachedPreferredExtent := nil.
1953
9190339e9fad lost dependents in row bug fix (when changing lists contents with #contents:)
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1883
        listHoldersList := listHolder value.
4219
5038c1c44e84 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4176
diff changeset
  1884
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1885
        what == #value ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1886
            self list:listHoldersList.
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1887
            ^ self.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1888
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1889
        aPara isCollection ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1890
            arg1 := aPara at:1.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1891
            arg2 := aPara at:2.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1892
        ] ifFalse:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1893
            arg1 := arg2 := aPara
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1894
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1895
        what == #at: ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1896
            self at:arg1 put:(listHoldersList at:arg1).
2776
73715c613579 *** empty log message ***
penk
parents: 2733
diff changeset
  1897
            ^ self.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1898
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1899
        what == #insert: ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1900
            self add:(listHoldersList at:arg1) beforeIndex:arg1.
2776
73715c613579 *** empty log message ***
penk
parents: 2733
diff changeset
  1901
            ^ self.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1902
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1903
        what == #remove: ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1904
            self removeFrom:arg1 to:arg1.
2776
73715c613579 *** empty log message ***
penk
parents: 2733
diff changeset
  1905
            ^ self.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1906
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1907
        what == #removeFrom: ifTrue:[
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1908
            listHoldersList size == 0 ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1909
                self list:nil
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1910
            ] ifFalse:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1911
                self removeFrom:arg1 to:arg2
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1912
            ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1913
            ^ self
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1914
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1915
        what == #insertCollection: ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1916
            arg2 ~~ 0 ifTrue:[
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1917
                self addAll:(listHoldersList copyFrom:arg1 to:(arg1 + arg2 - 1))
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1918
                    beforeIndex:arg1
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1919
            ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1920
            ^ self.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1921
        ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1922
        what == #replace: ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1923
            self
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1924
                replaceFrom:arg1 to:arg2
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  1925
                with:listHoldersList startingAt:arg1.
2537
cf1b9b6eeb41 change update:with:from: - ask cg
penk
parents: 2535
diff changeset
  1926
            ^ self
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1927
        ].
2537
cf1b9b6eeb41 change update:with:from: - ask cg
penk
parents: 2535
diff changeset
  1928
        self list:listHoldersList.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1929
        ^ self
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1930
    ].
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  1931
1593
2188ae28557e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
  1932
    arg1 := aPara ? what.
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  1933
    row := (what isNumber) ifTrue:[what] ifFalse:[chgObj].
2190
9c7777ad9594 bad names: redraw vs. invalidate
penk
parents: 2157
diff changeset
  1934
    self invalidateVisibleRow:row readSelector:arg1.
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1935
    editView notNil ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1936
        (self isInSelection:(self identityIndexOfRow:row)) ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1937
            self updateEditorFromChangedRow
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1938
        ]
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1939
    ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1940
5719
d53bae9fd8b2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 5718
diff changeset
  1941
    "Modified: / 30-01-2000 / 12:16:49 / cg"
d53bae9fd8b2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 5718
diff changeset
  1942
    "Modified: / 08-03-2018 / 18:06:19 / stefan"
6051
d7240d502ea7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6043
diff changeset
  1943
    "Modified: / 21-05-2019 / 17:22:20 / Claus Gittinger"
6054
8b6b5de90065 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 6053
diff changeset
  1944
    "Modified: / 22-05-2019 / 16:26:57 / Stefan Vogel"
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1945
!
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1946
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1947
updateColumnFromEditValue
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1948
    |editValueBefore firstSelectedIndex newValue realValue col|
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1949
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1950
    editValueBefore := editValue.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1951
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1952
    firstSelectedIndex := self firstIndexSelected.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1953
    newValue := editValue value.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1954
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1955
    col := self selectedColumn.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1956
    col at:firstSelectedIndex put:newValue.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1957
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1958
    col editorType == #RadioButton ifTrue:[
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1959
        "/ turn off the other column
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1960
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1961
        1 to:list size do:[:rowNr |
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1962
            rowNr ~~ firstSelectedIndex ifTrue:[
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1963
                (col at:rowNr) ~~ false ifTrue:[
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1964
                    col at:rowNr put:false.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1965
                    self invalidateRowAt:rowNr colAt:col columnNumber.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1966
                ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1967
            ]
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1968
        ]
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1969
    ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1970
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1971
    realValue := col at:firstSelectedIndex.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1972
    (realValue ~= newValue) ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1973
        "/ some validation by the row-object; the stored value
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1974
        "/ is different from what I think.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1975
        "/ update my input fields modelValue
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1976
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1977
        "/ just in case someone nilled or changed the editValue
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1978
        "/ Q: is this CA's paranoia or could this really be done in the at:put: above ???
3518
ab2b4b5cfda0 Fix reset of editValue when changed model does not exept change
Stefan Vogel <sv@exept.de>
parents: 3512
diff changeset
  1979
        "/ A (sv): it me happen, if the set method specified in the column descriptor did not set the
ab2b4b5cfda0 Fix reset of editValue when changed model does not exept change
Stefan Vogel <sv@exept.de>
parents: 3512
diff changeset
  1980
        "/         model.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  1981
        (editValueBefore == editValue) ifTrue:[
3518
ab2b4b5cfda0 Fix reset of editValue when changed model does not exept change
Stefan Vogel <sv@exept.de>
parents: 3512
diff changeset
  1982
            editValue value:realValue withoutNotifying:self.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1983
        ].
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1984
    ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1985
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1986
    modifiedChannel notNil ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1987
        modifiedChannel value:true.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1988
    ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1989
!
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1990
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1991
updateEditorFromChangedRow
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1992
    |rowsValue rowNr|
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1993
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1994
    (rowNr := selectedRowIndex) isNumber ifFalse:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1995
        rowNr := rowNr first.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  1996
    ].
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1997
    rowsValue := (self columnDescriptorAt:self selectedColIndex) at:rowNr.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1998
    (editValue notNil and:[ editValue value ~= rowsValue ]) ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1999
        editValue value:rowsValue withoutNotifying:self.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2000
        editView
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2001
            withAllSubViewsDo:[:v |
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2002
                v isInputField ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2003
                    v flash.
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2004
                ]
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  2005
            ]
2702
35892dc4449a bugfix: test whether editValue notNil
ca
parents: 2695
diff changeset
  2006
    ].
3773
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2007
!
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2008
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2009
updateList
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2010
    listHolder notNil ifTrue:[
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2011
        self list:listHolder value.
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2012
        ^ self
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2013
    ].
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2014
    model notNil ifTrue:[
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2015
        self list:model value.
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2016
        ^ self
c4fcafeada43 sortable
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
  2017
    ].
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2018
! !
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2019
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2020
!DSVColumnView methodsFor:'drag & drop'!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2021
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2022
canDrag
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2023
    "returns true if dragging is enabled"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2024
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2025
    ^ dropSource notNil
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2026
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2027
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2028
canStartDragAt:aPoint clickedAt:clickPoint
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2029
    self canDrag ifFalse:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2030
        ^ false
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2031
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2032
    ^ (aPoint dist:clickPoint) > (UserPreferences current motionDistanceToStartDrag)
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2033
!
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2034
5809
c43c2f1c38ba #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5805
diff changeset
  2035
dragAutoScroll:aDropContext
2575
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2036
    "called by the DragAndDropManager to scroll during a drag/drop operation
5805
a76e98c02491 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5737
diff changeset
  2037
     if required (decided by the widget itself). 
a76e98c02491 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5737
diff changeset
  2038
     If a scroll is done, return true;
a76e98c02491 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5737
diff changeset
  2039
     otherwise false (used to restore the background)"
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2040
2575
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2041
    |yInset absLnNr y|
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2042
5809
c43c2f1c38ba #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5805
diff changeset
  2043
    (super dragAutoScroll:aDropContext) ifTrue:[^ true].
c43c2f1c38ba #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5805
diff changeset
  2044
c43c2f1c38ba #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5805
diff changeset
  2045
    y := aDropContext targetPoint y.
2575
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2046
    yInset := margin + rowHeight.
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2047
    y > yInset ifTrue:[
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2048
        y >= (height - yInset) ifFalse:[^ false].
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2049
    ].
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2050
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2051
    absLnNr := self yVisibleToRowNr:y.
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2052
    absLnNr isNil ifTrue:[^ false].
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2053
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2054
    (absLnNr > 1 and:[absLnNr < self size]) ifFalse:[
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2055
        ^ false
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2056
    ].
5809
c43c2f1c38ba #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5805
diff changeset
  2057
    aDropContext contentsWillChange.
2575
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2058
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2059
    y > yInset
2580
aea885fae0de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  2060
        ifTrue:[self scrollDown:rowHeight]
aea885fae0de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  2061
        ifFalse:[self scrollUp:rowHeight].
2575
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2062
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2063
    ^ true
5805
a76e98c02491 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5737
diff changeset
  2064
5809
c43c2f1c38ba #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5805
diff changeset
  2065
    "Modified: / 14-06-2018 / 11:21:13 / Claus Gittinger"
2575
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2066
!
fe15b02fbaf6 support sutoScroll during drag & drop
ca
parents: 2543
diff changeset
  2067
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2068
dropSource
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2069
    "returns the dropSource or nil"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2070
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2071
    ^ dropSource
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2072
!
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2073
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2074
dropSource:aDropSourceOrNil
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2075
    "set the dropSource or nil"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2076
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2077
    dropSource := aDropSourceOrNil.
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2078
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2079
824
d2e60c8ac775 support of Drag & Drop
ca
parents: 809
diff changeset
  2080
startDragAt:aPoint
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2081
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2082
    dropSource notNil ifTrue:[
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2083
        buttonReleaseAction := buttonMotionAction := nil.
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2084
        dropSource startDragIn:self at:aPoint.
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2085
    ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2086
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2087
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2088
!DSVColumnView methodsFor:'drawing'!
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2089
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2090
colorOnDevice:aColor
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2091
    "returns color on device"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2092
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2093
    |col|
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2094
641
tz
parents: 637
diff changeset
  2095
    aColor = Color noColor ifFalse:[
tz
parents: 637
diff changeset
  2096
        col := colorMap at:aColor ifAbsent:nil.
tz
parents: 637
diff changeset
  2097
        col isNil ifTrue:[
4991
ddee68d07788 device access
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
  2098
            colorMap at:aColor put:(col := aColor onDevice:device)
641
tz
parents: 637
diff changeset
  2099
        ].
tz
parents: 637
diff changeset
  2100
        ^ col
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2101
    ].
641
tz
parents: 637
diff changeset
  2102
    ^ bgColor
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2103
!
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2104
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2105
forceRedraw
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2106
    "a redraw forced by any other component"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2107
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2108
    shown ifTrue:[
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2109
        self invalidate
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2110
    ]
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2111
!
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2112
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2113
invalidate
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2114
    "recompute extent before repair range"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2115
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2116
    self recomputeHeightOfContents.
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2117
    super invalidate.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2118
!
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2119
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2120
invalidateRowAt:aRowNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2121
    "redraw total row at an index"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2122
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2123
    self invalidateRowAt:aRowNr colAt:0
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2124
!
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2125
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2126
invalidateRowAt:aRowNr colAt:aColNr
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  2127
    "redraw either a single column in a row,
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  2128
     or the complete visible row (in case of aColNr == 0).
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2129
     If the row/column is hidden, no redraw is done"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2130
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2131
    |x "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2132
     y "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2133
     h "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2134
     w "{ Class:SmallInteger }"
2523
a7d71e57632f care for non-existing column
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
  2135
     col|
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2136
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2137
    (shown and:[aRowNr notNil and:[aRowNr between:1 and:list size]]) ifTrue:[
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2138
        h := rowHeight.
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2139
        y := self yVisibleOfRowNr:aRowNr.
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2140
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2141
        y < margin ifTrue:[
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2142
            (h := h + y) <= margin ifTrue:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2143
                ^ self
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2144
            ].                                                  "/ row not visible
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2145
            h := h - margin.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2146
            y := margin.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2147
        ] ifFalse:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2148
            y >= height ifTrue:[^ self].
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2149
        ].
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2150
        aColNr ~~ 0 ifTrue:[                                    "/ redraw column in row
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2151
            col := (self columnDescriptorAt:aColNr).
3672
ff861e62db1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3604
diff changeset
  2152
            w := col isNil ifTrue:[0] ifFalse:[col width].
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2153
            x := self xVisibleOfColNr:aColNr.
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2154
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2155
            x < margin ifTrue:[
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2156
                (w := w + x) <= margin ifTrue:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2157
                    ^ self
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2158
                ].                                              "/ column not visible
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2159
                w := w - margin.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2160
                x := margin.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2161
            ] ifFalse:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2162
                x >= width ifTrue:[^ self].
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2163
            ]
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2164
        ] ifFalse:[                                             "/ redraw whole row
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2165
            x := margin.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2166
            w := width.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2167
        ].
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2168
        self invalidateX:x y:y width:w height:h
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2169
    ]
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2170
!
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2171
2469
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2172
invalidateRows:aCollection
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2173
    "redraw some visible rows"
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2174
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2175
    shown ifTrue:[
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2176
        aCollection do:[:rowIndex |
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2177
            self invalidateRowAt:rowIndex
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2178
        ]
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2179
    ]
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2180
!
a6e3ffd6df94 Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents: 2458
diff changeset
  2181
1956
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2182
invalidateRowsFrom:aStart to:aStop
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2183
    "redraw visible row from start to stop"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2184
1956
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2185
    |size start stop y0 y1|
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2186
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2187
    shown ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2188
        size  := list size.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2189
        start := aStart notNil ifTrue:[aStart max:1]    ifFalse:[1].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2190
        stop  := aStop  notNil ifTrue:[aStop  min:size] ifFalse:[size].
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2191
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2192
        start <= stop ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2193
            y0 := (self yVisibleOfRowNr:start)              max:margin.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2194
            y1 := ((self yVisibleOfRowNr:stop) + rowHeight) min:height.
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2195
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2196
            y0 < y1 ifTrue:[
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2197
                self invalidateX:margin y:y0 width:width height:(y1 - y0)
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2198
            ]
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2199
        ]
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2200
    ]
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2201
!
bd553f644454 implement: #replaceFrom:to:with:startingAt:
ca
parents: 1954
diff changeset
  2202
3138
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2203
invalidateSelection
5214
1f88a970e4db #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5204
diff changeset
  2204
    "invalidate (force async redraw) the current selection"
1f88a970e4db #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5204
diff changeset
  2205
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2206
    |colIndex|
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2207
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2208
    shown ifTrue:[
3138
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2209
        colIndex := self selectedColIndex ? 0.
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2210
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2211
        self selectionIndicesDo:[:aRowIndex|
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2212
            self invalidateRowAt:aRowIndex colAt:colIndex.
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2213
        ].
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2214
    ]
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2215
!
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  2216
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2217
invalidateVisibleRow:aRow
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2218
    "redraw row if visible"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2219
2190
9c7777ad9594 bad names: redraw vs. invalidate
penk
parents: 2157
diff changeset
  2220
    self invalidateVisibleRow:aRow colAt:0
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2221
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2222
2190
9c7777ad9594 bad names: redraw vs. invalidate
penk
parents: 2157
diff changeset
  2223
invalidateVisibleRow:aRow colAt:aColNr
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  2224
    "redraw either a single column in a row,
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  2225
     or the complete visible row (in case of aColNr == 0).
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2226
     If the row/column is hidden, no redraw is done"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2227
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2228
    |start "{ Class:SmallInteger }"
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2229
     stop  "{ Class:SmallInteger }"
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2230
    |
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2231
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2232
    (start := self indexOfFirstRowShown) ~~ 0 ifTrue:[
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  2233
        stop := (start + (height // rowHeight)) min:(list size).
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2234
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2235
        aRow isNumber ifTrue:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2236
            (aRow between:start and:stop) ifTrue:[
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2237
                self invalidateRowAt:aRow colAt:aColNr
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2238
            ]
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2239
        ] ifFalse:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2240
            start to:stop do:[:i|
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2241
                (self at:i) == aRow ifTrue:[
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  2242
                    ^ self invalidateRowAt:i colAt:aColNr
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2243
                ]
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2244
            ]
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2245
        ]
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2246
    ]
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2247
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2248
2190
9c7777ad9594 bad names: redraw vs. invalidate
penk
parents: 2157
diff changeset
  2249
invalidateVisibleRow:aRow readSelector:aSelector
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2250
    "redraw a column identified by its read selector; if no column with
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2251
     the specified read selector is detected, the whole line is drawn."
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2252
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2253
    |row idx|
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2254
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2255
    aSelector isNil ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2256
        idx := 0
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2257
    ] ifFalse:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2258
        (row := aRow) isNumber ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2259
            (row := self at:aRow) isNil ifTrue:[ ^ self ]
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2260
        ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2261
        idx := columnDescriptors
4686
dda678ab83bf class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4664
diff changeset
  2262
                findFirst:[:aCol| aCol description readSelector == aSelector]
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2263
    ].
2190
9c7777ad9594 bad names: redraw vs. invalidate
penk
parents: 2157
diff changeset
  2264
    self invalidateVisibleRow:aRow colAt:idx
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2265
!
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2266
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2267
redrawX:x y:y width:w height:h
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2268
    "redraw part of myself immediately, given logical coordinates "
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2269
4161
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2270
    |c0 savClip stopRedraw selWidth
1149
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2271
     start "{ Class:SmallInteger }"
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2272
     stop  "{ Class:SmallInteger }"
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2273
     x0    "{ Class:SmallInteger }"
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2274
     x1    "{ Class:SmallInteger }"
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2275
     maxX  "{ Class:SmallInteger }"
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2276
     yTop  "{ Class:SmallInteger }"
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2277
     yBot  "{ Class:SmallInteger }"
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2278
     clHg  "{ Class:SmallInteger }"
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2279
     size  "{ Class:SmallInteger }"
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  2280
     lineColor
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2281
    |
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2282
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2283
    shown ifFalse:[^ self].
3993
6840bc23b584 changed: #redrawX:y:width:height:
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
  2284
    self isReallyShown ifFalse:[^ self].
6840bc23b584 changed: #redrawX:y:width:height:
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
  2285
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2286
    gc paint:bgColor.
1115
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2287
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2288
    columnDescriptors isEmpty ifTrue:[
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2289
        ^ gc fillRectangleX:x y:y width:w height:h
1115
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2290
    ].
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  2291
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2292
    size  := list size.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2293
    yTop  := margin - viewOrigin y.
1115
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2294
    c0    := y - yTop max:0.
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2295
    start := (c0 // rowHeight) + 1.
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  2296
    stop  := (((c0 + h - 1) // rowHeight) + 1) min:size.
1115
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2297
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2298
    stop < start ifTrue:[
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2299
        ^ gc fillRectangleX:x y:y width:w height:h
1115
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2300
    ].
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  2301
    savClip := self clippingBoundsOrNil.
1149
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2302
1115
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2303
    maxX := (x + w) min:(width - margin).
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2304
    x0   := margin - viewOrigin x.
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2305
    yTop := yTop + ((start - 1) * rowHeight).
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2306
    clHg := (stop - start + 1) * rowHeight.
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2307
    yBot := yTop + clHg.
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2308
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2309
    stopRedraw := false.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2310
5737
eeb4d51e4e3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  2311
    self class stopRedrawSignal handle:[:ex |
eeb4d51e4e3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  2312
        "/ redraw aborted due to too many changes while drawing.
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2313
        stopRedraw := true.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2314
    ] do:[
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2315
        columnDescriptors do:[:aCol| |cw|
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2316
            x1 := x0 + aCol width.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2317
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2318
            (x1 > x and:[x0 < maxX]) ifTrue:[
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2319
                |left right rect|
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2320
                left  := x0 max:x.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2321
                right := x1 min:maxX.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2322
                rect  := Rectangle left:left top:y width:(right - left) height:h.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2323
5737
eeb4d51e4e3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  2324
                "/ self clippingBounds:nil.
5204
fccb63f32188 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5195
diff changeset
  2325
                self clippingBounds:rect.
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2326
                aCol redrawX:x0 y:yTop h:clHg  from:start to:stop.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2327
            ].
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2328
            x0 := x1
1115
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2329
        ].
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2330
    ].
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2331
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  2332
    "/ restore old clipping rectangle
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  2333
    self clippingBounds:savClip.
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2334
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2335
    stopRedraw ifTrue:[
5737
eeb4d51e4e3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  2336
        "/ redraw aborted due to too many changes while drawing.
eeb4d51e4e3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  2337
        "/ try again after some grace period
eeb4d51e4e3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  2338
        Processor addTimedBlock:[self invalidate] after:0.1 seconds.
eeb4d51e4e3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  2339
        "/  self invalidate.
eeb4d51e4e3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  2340
        "/ self makeSelectionVisible.
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2341
        ^ self
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2342
    ].
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2343
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2344
    stop == size ifTrue:[
1115
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2345
        yTop := y + h.
7f3f4581c3d3 clear background
ca
parents: 1112
diff changeset
  2346
        yBot < (yTop - margin) ifTrue:[
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  2347
            "/ clear to bottom of screen
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2348
            gc paint:bgColor.
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2349
            gc fillRectangleX:x y:yBot width:w height:(yTop - yBot).
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2350
        ]
1136
4a9d9db81422 set bg/fg color when drawing an interactor
ca
parents: 1134
diff changeset
  2351
    ].
4a9d9db81422 set bg/fg color when drawing an interactor
ca
parents: 1134
diff changeset
  2352
1149
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2353
    (c0 := w + x- x1) > 0 ifTrue:[
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  2354
        "/ clear to right of screen
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2355
        gc paint:bgColor.
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2356
        gc fillRectangleX:x1 y:y width:c0 height:h.
1136
4a9d9db81422 set bg/fg color when drawing an interactor
ca
parents: 1134
diff changeset
  2357
    ].
4161
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2358
    "/ if only rows are selected we have to draw
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2359
    "/  - the selection frame around the labels
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2360
    "/  - and to fill the selection area behind the table if not bound to the width of the view
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2361
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2362
    self hasRowSelection ifFalse:[ ^ self ].  "/ nothing to do
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2363
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2364
    selWidth := width-margin-x1.
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  2365
    lineColor := self selectionFrameColor.
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  2366
4161
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2367
    self selectionIndicesDo:[:rowNr |
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2368
        | yVis |
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2369
        yVis := self yVisibleOfRowNr:rowNr.
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2370
        selWidth > 0 ifTrue:[
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2371
            gc paint:selectionBackgroundColor.
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2372
            gc fillRectangleX:x1 y:yVis width:selWidth height:rowHeight.
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  2373
        ].
4161
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2374
        lineColor notNil ifTrue:[
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2375
            gc paint:lineColor.
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2376
            gc displayLineFromX:x y:yVis toX:width y:yVis.
4161
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2377
            yVis := yVis+rowHeight -1.
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2378
            gc displayLineFromX:x y:yVis toX:width y:yVis.
4161
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  2379
        ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2380
    ].
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  2381
3993
6840bc23b584 changed: #redrawX:y:width:height:
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
  2382
    "Modified: / 21-01-2011 / 15:58:11 / cg"
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2383
! !
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2384
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2385
!DSVColumnView methodsFor:'drawing interactors'!
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2386
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2387
displayLabel:aLabel x:xLeft y:yTop
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2388
    "display the label at x y; test whether the height of the label matches to the current
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2389
     rowHeight. If not, an exception is raised and the rowHeight is recomputed"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2390
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2391
    |y h |
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2392
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2393
    aLabel notNil ifTrue:[
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2394
        aLabel isString ifTrue:[
2593
24ddc48c5ad4 bugfix: recomputation of rowHeight if label is heigher than current rowHeight
ca
parents: 2592
diff changeset
  2395
            y := yTop + self rowFontAscent.
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2396
        ] ifFalse:[
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2397
            h := aLabel heightOn:self.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2398
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2399
            h > minRowHeight ifTrue:[
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2400
                minRowHeight := h.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2401
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  2402
                cachedPreferredExtent notNil ifTrue:[
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  2403
"/                    rowHeight := (minRowHeight + separatorSize + verticalSpacing + verticalSpacing + 1) // 2 * 2.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2404
                    cachedPreferredExtent := Point
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  2405
                                            x: cachedPreferredExtent x
3172
65f4533fbf75 preferredExtent race condition
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
  2406
                                            y: (list size * rowHeight).
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2407
                    self contentsChanged.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2408
                ].
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2409
                self class stopRedrawSignal raiseRequest.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2410
            ].
2593
24ddc48c5ad4 bugfix: recomputation of rowHeight if label is heigher than current rowHeight
ca
parents: 2592
diff changeset
  2411
            y := yTop + (aLabel ascentOn:self).
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2412
        ].
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2413
        aLabel displayOn:self x:xLeft y:y.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2414
    ].
3172
65f4533fbf75 preferredExtent race condition
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
  2415
65f4533fbf75 preferredExtent race condition
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
  2416
    "Modified: / 05-02-2007 / 09:07:10 / cg"
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2417
!
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  2418
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2419
drawCheckToggleAtX:xLeft y:yTop w:cellWidth state:cellValue
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2420
    "draw a check toggle button"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2421
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2422
    |e form
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2423
     y "{ Class:SmallInteger }"
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2424
     x "{ Class:SmallInteger }"
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2425
     h "{ Class:SmallInteger }"
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2426
     w "{ Class:SmallInteger }"
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2427
     state|
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2428
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2429
    state := (cellValue ? false).
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2430
    state isBoolean ifFalse:[ state := false ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2431
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2432
    w := checkToggleExtent x.
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2433
    h := checkToggleExtent y.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2434
    y := yTop + ((rowHeight - h) // 2).
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2435
    x := xLeft + ((cellWidth  - w) // 2).
1529
aa5e8fae6f23 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  2436
    h odd ifTrue:[y := y + 1].
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2437
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2438
    checkToggleActiveImage isNil ifTrue:[
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2439
        gc paint:bgColor.
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2440
        gc fillRectangleX:x y:y width:w height:h.
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2441
        self drawEdgesAtX:x y:y width:w height:h level:checkToggleLevel on:self.
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2442
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2443
        state ifFalse:[
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2444
            ^ self
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2445
        ].
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2446
        gc paint:fgColor on:bgColor.
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2447
        form := checkToggleForm
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2448
    ] ifFalse:[
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2449
        form := self isEnabled
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2450
                    ifTrue:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2451
                        state
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2452
                            ifTrue:[checkToggleActiveImage]
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2453
                            ifFalse:[checkTogglePassiveImage]] 
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2454
                    ifFalse:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2455
                        state
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2456
                            ifTrue:[(checkToggleDisabledActiveImage ? checkToggleActiveImage)]
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2457
                            ifFalse:[(checkToggleDisabledPassiveImage ? checkTogglePassiveImage)]].
859
e63eb6f321e1 support List for columns
ca
parents: 833
diff changeset
  2458
    ].
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2459
    e := (checkToggleExtent - form extent) // 2.
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2460
    gc displayForm:form x:(x + e x) y:(y + e y).
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2461
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2462
    "Modified: / 17-08-2018 / 17:33:03 / Claus Gittinger"
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2463
!
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2464
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2465
drawComboButtonAtX:xTop y:yTop w:rowWidth
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2466
    "draw a combo button"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2467
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2468
    |e
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2469
     x "{ Class:SmallInteger }"
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2470
     y "{ Class:SmallInteger }"
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2471
     h "{ Class:SmallInteger }"
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2472
     w "{ Class:SmallInteger }"|
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2473
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2474
    w := comboButtonExtent x.
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2475
    h := comboButtonExtent y.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2476
    y := yTop + ((rowHeight - h) // 2).
1149
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2477
    x := xTop + (rowWidth  - w - separatorSize - 1).
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2478
    e := (comboButtonExtent - comboButtonForm extent) // 2.
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2479
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2480
    gc paint:bgColor.
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2481
    gc fillRectangleX:x y:y width:w height:h.
1131
ef8f528399aa clear background under button
ca
parents: 1129
diff changeset
  2482
    self drawEdgesAtX:x   y:y width:w height:h level:comboButtonLevel on:self.
5421
3fd7edaeb379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 5347
diff changeset
  2483
    gc paint:fgColor on:bgColor.
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2484
    gc 
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2485
        displayForm:
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2486
            (self isEnabled 
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2487
                ifTrue:[comboButtonForm]
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2488
                ifFalse:[comboButtonDisabledForm ? comboButtonForm])
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2489
        x:(x + e x) 
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2490
        y:(y + e y)
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2491
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2492
    "Modified: / 17-08-2018 / 17:35:20 / Claus Gittinger"
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2493
!
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  2494
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2495
drawEdgesAtX:x y:y width:w height:h level:aLevel on:aGC
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2496
    "draw edges for a cell or label"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2497
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2498
    aGC
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2499
        drawEdgesForX:x
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2500
        y:y
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2501
        width:w
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2502
        height:h
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2503
        level:aLevel
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2504
        shadow:buttonShadowColor
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2505
        light:buttonLightColor
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2506
        halfShadow:buttonHalfShadowColor
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2507
        halfLight:buttonHalfLightColor
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2508
        style:ButtonEdgeStyle.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2509
!
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2510
5447
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
  2511
drawRadioButtonAtX:xLeft y:yTop w:cellWidth state:aBooleanOrNil
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2512
    "draw a radio button"
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2513
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2514
    |image
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2515
     y "{ Class:SmallInteger }"
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2516
     x "{ Class:SmallInteger }"
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2517
     h "{ Class:SmallInteger }"
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2518
     w "{ Class:SmallInteger }"|
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2519
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2520
    w := radioButtonActiveImage extent x.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2521
    h := radioButtonActiveImage extent y.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2522
    y := yTop + ((rowHeight - h) // 2).
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2523
    x := xLeft + ((cellWidth - w) // 2).
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2524
    h odd ifTrue:[y := y + 1].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2525
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2526
    image := self isEnabled
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2527
                ifTrue:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2528
                    (aBooleanOrNil == true)
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2529
                        ifTrue:[radioButtonActiveImage]
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2530
                        ifFalse:[radioButtonPassiveImage]]
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2531
                ifFalse:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2532
                    (aBooleanOrNil == true)
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2533
                        ifTrue:[radioButtonDisabledActiveImage ? radioButtonActiveImage]
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2534
                        ifFalse:[radioButtonDisabledPassiveImage ? radioButtonPassiveImage]].
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2535
4991
ddee68d07788 device access
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
  2536
    image := image onDevice:device.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2537
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2538
    self displayForm:image x:x y:y.
5447
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
  2539
867fdca4b691 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5421
diff changeset
  2540
    "Modified (format): / 04-02-2017 / 21:31:16 / cg"
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  2541
    "Modified: / 17-08-2018 / 17:36:23 / Claus Gittinger"
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2542
! !
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2543
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2544
!DSVColumnView methodsFor:'enumerating columns'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2545
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2546
columnsDo:aOneArgBlock
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2547
    "evaluate the argument, aOneArgBlock for every columnDescriptor"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2548
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2549
    columnDescriptors do:aOneArgBlock
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2550
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2551
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2552
columnsFrom:start to:stop do:aOneArgBlock
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2553
    "evaluate the argument, aOneArgBlock for the columns with index start to
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2554
     stop in the collection of column descriptors"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2555
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2556
    columnDescriptors
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2557
        from:start
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2558
        to:stop
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2559
        do:aOneArgBlock
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2560
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2561
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2562
!DSVColumnView methodsFor:'event handling'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2563
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2564
buttonControlPressAt:clickPoint rowNr:aRowNr colNr:aColNr
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2565
    |isSelected prvRow doAdd chgSet|
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2566
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2567
    buttonMotionAction := buttonReleaseAction := nil.
3239
7b18b6694058 ctrl-click toggles
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
  2568
    isSelected := self isInSelection:aRowNr.
7b18b6694058 ctrl-click toggles
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
  2569
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2570
    multipleSelectOk ifFalse:[
3239
7b18b6694058 ctrl-click toggles
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
  2571
        isSelected ifTrue:[
7b18b6694058 ctrl-click toggles
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
  2572
            self deselect.
7b18b6694058 ctrl-click toggles
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
  2573
        ] ifFalse:[
7b18b6694058 ctrl-click toggles
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
  2574
            self selectRowAt:aRowNr colAt:aColNr atPoint:clickPoint openEditor:false.
7b18b6694058 ctrl-click toggles
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
  2575
        ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2576
        ^ self
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2577
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2578
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2579
    isSelected ifTrue:[ self removeRowFromSelection:aRowNr ]
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2580
              ifFalse:[ self addRowToSelection:aRowNr ].
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2581
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2582
    multipleSelectOk ifFalse:[ ^ self ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2583
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2584
    prvRow := aRowNr.
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2585
    chgSet := IdentitySet new.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2586
    doAdd  := isSelected not.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2587
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2588
    buttonMotionAction := [:p|
2907
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  2589
        |rowNr mustRestore step f|
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  2590
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2591
        rowNr := self yVisibleToRowNr:(p y).
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2592
        (rowNr notNil and:[rowNr ~~ prvRow]) ifTrue:[
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2593
            rowNr == aRowNr ifTrue:[
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2594
                mustRestore := true
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2595
            ] ifFalse:[
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2596
                rowNr > aRowNr ifTrue:[ mustRestore := (rowNr < prvRow) ]
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2597
                              ifFalse:[ mustRestore := (rowNr > prvRow) ].
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2598
            ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2599
            prvRow > rowNr ifTrue:[ step := -1 ]
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2600
                          ifFalse:[ step :=  1 ].
2907
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  2601
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  2602
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2603
            mustRestore ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2604
                [ prvRow ~~ rowNr ] whileTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2605
                    (chgSet removeIdentical:prvRow ifAbsent:nil) notNil ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2606
                        doAdd ifFalse:[ self addRowToSelection:prvRow ]
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2607
                               ifTrue:[ self removeRowFromSelection:prvRow ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2608
                    ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2609
                    prvRow := prvRow + step.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2610
                ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2611
            ] ifFalse:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2612
                [ prvRow ~~ rowNr ] whileTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2613
                    prvRow := prvRow + step.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2614
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2615
                    doAdd ~~ (self isInSelection:rowNr) ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2616
                        chgSet add:prvRow.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2617
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2618
                        doAdd ifTrue:[ self addRowToSelection:prvRow ]
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2619
                             ifFalse:[ self removeRowFromSelection:prvRow ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2620
                    ]
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2621
                ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2622
            ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2623
        ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2624
    ].
3130
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
  2625
3239
7b18b6694058 ctrl-click toggles
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
  2626
    "Modified: / 21-07-2007 / 22:00:27 / cg"
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2627
!
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2628
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2629
buttonMotion:buttonMask x:x y:y
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2630
    "mouse-move while button was pressed - handle multiple selection changes"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2631
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2632
    self isEnabled ifFalse:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2633
        ^ self
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2634
    ].
2788
8f45f2da80fa selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2635
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2636
    buttonMotionAction notNil ifTrue:[
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2637
        buttonMotionAction value:(x @ y).
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2638
        buttonMotionAction notNil ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2639
            autoScroll ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2640
                "/ if moved outside of view, start autoscroll
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2641
                (y < 0) ifTrue:[
2670
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  2642
                    ^ self startAutoScroll:#scrollUp distance:y.
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2643
                ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2644
                (y > height) ifTrue:[
2670
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  2645
                    ^ self startAutoScroll:#scrollDown distance:(y - height).
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2646
                ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2647
            ]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2648
        ]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2649
    ].
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2650
    self stopAutoScroll.
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2651
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2652
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2653
buttonMultiPress:button x:x y:y
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2654
    "a button was pressed twice - handle doubleclick here"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2655
3217
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  2656
    |selectedCol|
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  2657
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2658
    buttonMotionAction := buttonReleaseAction := nil.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2659
1805
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  2660
    self isEnabled ifFalse:[^ self].
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  2661
3742
a4bb22bc79e2 preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2662
    (button == 1) ifFalse:[
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2663
        ^ super buttonMultiPress:button x:x y:y
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2664
    ].
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2665
    self numberOfSelections == 1 ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2666
        self firstIndexSelected == (self yVisibleToRowNr:y) ifTrue:[
3217
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  2667
            selectedCol := self selectedColIndex.
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  2668
            ( selectedCol == 0
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  2669
              or:[selectedCol == (self xVisibleToColNr:x)]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2670
            ) ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2671
                self doubleClicked
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  2672
            ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2673
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2674
    ]
3217
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  2675
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  2676
    "Modified: / 26-03-2007 / 15:19:04 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2677
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2678
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2679
buttonPress:button x:x y:y
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2680
    "a button was pressed - handle selection here"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2681
4664
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2682
    |rowNr colNr sensor clickPoint clickedIntoSelection column columnEditorType|
2802
fa5806bd210a select behavior changed:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
  2683
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2684
    buttonMotionAction := buttonReleaseAction := nil.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2685
1805
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  2686
    self isEnabled ifFalse:[^ self].
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  2687
4664
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2688
    rowNr := self yVisibleToRowNr:y.
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2689
    colNr := self xVisibleToColNr:x.
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2690
5895
7eb99c8f6368 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5890
diff changeset
  2691
    (button == 2) ifTrue:[ 
7eb99c8f6368 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5890
diff changeset
  2692
        |openMenu|
7eb99c8f6368 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5890
diff changeset
  2693
4664
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2694
        openMenu := false.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2695
3922
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2696
        UserPreferences current selectOnRightClick ifFalse:[
4664
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2697
            openMenu := true.
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2698
        ] ifTrue:[
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2699
            UserPreferences current showRightButtonMenuOnRelease ifFalse:[
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2700
                (rowNr notNil and:[colNr notNil and:[self isRowSelectable:rowNr]]) ifTrue:[
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2701
                    self selectRowAt:rowNr colAt:colNr atPoint:clickPoint openEditor:false
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2702
                ].
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2703
                openMenu := true.
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2704
            ].
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2705
        ].
5895
7eb99c8f6368 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5890
diff changeset
  2706
        openMenu ifTrue:[ 
7eb99c8f6368 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5890
diff changeset
  2707
            |menu|
7eb99c8f6368 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5890
diff changeset
  2708
3922
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2709
            menu := self findMenuForSelection.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2710
            menu notNil ifTrue:[
3922
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2711
                self startUpMenu:menu.
4664
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2712
            ] ifFalse:[
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2713
                super buttonPress:button x:x y:y.
3922
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2714
            ].
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2715
            ^ self
4664
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2716
        ].
a537a996fb22 class: DSVColumnView
ca
parents: 4653
diff changeset
  2717
    ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2718
2804
8204b926377d oops - firstRow could be nil
Claus Gittinger <cg@exept.de>
parents: 2802
diff changeset
  2719
    (rowNr isNil or:[colNr isNil]) ifTrue:[
2722
18c5bd340b1b close editor when clicking outside
ca
parents: 2714
diff changeset
  2720
        self deselect.
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2721
        super buttonPress:button x:x y:y.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2722
        ^ self
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2723
    ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2724
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  2725
    (self isRowSelectable:rowNr) ifFalse:[^ self ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  2726
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2727
    sensor     := self sensor.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2728
    clickPoint := x @ y.
2813
74cfefd3a0a4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2812
diff changeset
  2729
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2730
    sensor shiftDown ifTrue:[
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2731
        self buttonShiftPressAt:clickPoint rowNr:rowNr colNr:colNr.
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2732
        ^ self
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2733
    ].
2802
fa5806bd210a select behavior changed:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
  2734
    sensor ctrlDown ifTrue:[
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2735
        self buttonControlPressAt:clickPoint rowNr:rowNr colNr:colNr.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2736
        ^ self
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2737
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2738
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2739
    multipleSelectOk ifFalse:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2740
        self canDrag ifFalse:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2741
            self selectRowAt:rowNr colAt:colNr atPoint:clickPoint openEditor:true.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2742
            ^ self
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2743
        ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2744
        self selectRowAt:rowNr colAt:colNr atPoint:clickPoint openEditor:false.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2745
3923
d5c71ade2f43 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3922
diff changeset
  2746
        ((button == 2) and:[UserPreferences current selectOnRightClick]) ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2747
            self selectRowAt:rowNr colAt:colNr atPoint:clickPoint openEditor:true
3922
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2748
        ] ifFalse:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2749
            buttonReleaseAction :=
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2750
                [
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2751
                    buttonReleaseAction := nil.
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2752
                    self selectRowAt:rowNr colAt:colNr atPoint:clickPoint openEditor:true.
3922
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2753
                ].
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2754
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2755
            buttonMotionAction :=
3922
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2756
                [:aPoint|
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2757
                    (self canStartDragAt:aPoint clickedAt:clickPoint) ifTrue:[
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2758
                        self startDragAt:aPoint
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2759
                    ]
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2760
                ].
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2761
        ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2762
        ^ self
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2763
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2764
3923
d5c71ade2f43 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3922
diff changeset
  2765
    ((button == 2) and:[UserPreferences current selectOnRightClick]) ifFalse:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2766
        buttonReleaseAction :=
4055
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2767
            [
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2768
                buttonReleaseAction := nil.
4055
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2769
                self selectRowAt:rowNr colAt:colNr atPoint:clickPoint openEditor:true.
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2770
            ].
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2771
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2772
        "/ normally, we select on button release; however, any editor is shown immediately
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2773
        ((column := self columnDescriptorAt:colNr) notNil
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2774
          and:[ (columnEditorType := column description editorType) notNil
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2775
          and:[ columnEditorType ~~ #None ]]
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2776
        ) ifTrue:[
4055
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2777
            buttonReleaseAction value.
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2778
            buttonReleaseAction := nil.
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2779
            (editView notNil and:[editView isDialogBox]) ifTrue:[
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2780
                editView := nil.
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2781
            ].    
4055
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2782
            editView notNil ifTrue:[
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2783
                ^ self.
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2784
            ]
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2785
        ]
3922
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2786
    ].
fd141174f607 changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3908
diff changeset
  2787
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2788
    clickedIntoSelection := self isInSelection:rowNr.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2789
    clickedIntoSelection ifTrue:[
3908
a8586db23418 comment/format in: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3897
diff changeset
  2790
        |selColIdx|
a8586db23418 comment/format in: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3897
diff changeset
  2791
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2792
        selColIdx := self selectedColIndex.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2793
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2794
        (selColIdx ~~ 0 and:[selColIdx ~~ colNr]) ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2795
            clickedIntoSelection := (selectedRowIndex size > 1)
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2796
        ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2797
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2798
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2799
    clickedIntoSelection ifFalse:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2800
        self selectRowAt:rowNr colAt:colNr atPoint:clickPoint openEditor:false.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2801
    ] ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2802
        self canDrag ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2803
            buttonMotionAction :=
4055
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2804
                [:aPoint|
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2805
                    (self canStartDragAt:aPoint clickedAt:clickPoint) ifTrue:[
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2806
                        self startDragAt:aPoint
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2807
                    ]
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  2808
                ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2809
            ^ self
2802
fa5806bd210a select behavior changed:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
  2810
        ]
fa5806bd210a select behavior changed:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
  2811
    ].
2788
8f45f2da80fa selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2812
8f45f2da80fa selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2813
    buttonMotionAction := [:p|
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2814
        (self bounds containsPoint:p) ifTrue:[
3908
a8586db23418 comment/format in: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3897
diff changeset
  2815
            |rowUnderPoint|
a8586db23418 comment/format in: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3897
diff changeset
  2816
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2817
            rowUnderPoint := self yVisibleToRowNr:(p y).
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2818
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2819
            rowUnderPoint notNil ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2820
                buttonReleaseAction notNil ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2821
                    rowUnderPoint == rowNr ifFalse:[
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2822
                        buttonReleaseAction := nil
2907
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  2823
                    ].
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  2824
                ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2825
                buttonReleaseAction isNil ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2826
                    self selectRowFrom:rowNr to:rowUnderPoint.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2827
                ]
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2828
            ]
2907
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  2829
        ].
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  2830
    ].
3908
a8586db23418 comment/format in: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 3897
diff changeset
  2831
4056
36eb0b1137db changed: #buttonPress:x:y:
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  2832
    "Modified: / 12-07-2011 / 14:54:45 / cg"
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  2833
    "Modified: / 23-04-2019 / 19:53:40 / Claus Gittinger"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2834
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2835
643
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  2836
buttonRelease:button x:x y:y
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  2837
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2838
    buttonMotionAction := nil.
1749
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  2839
    self stopAutoScroll.
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  2840
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2841
    buttonReleaseAction notNil ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2842
        buttonReleaseAction value.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  2843
        buttonReleaseAction := nil.
643
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  2844
    ].
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  2845
    super buttonRelease:button x:x y:y
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  2846
!
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  2847
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2848
buttonShiftPressAt:clickPoint rowNr:aRowNr colNr:aColNr
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2849
    |colIdx numSelRows|
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2850
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2851
    buttonReleaseAction := buttonMotionAction := nil.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2852
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2853
    colIdx := aColNr.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2854
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2855
    (multipleSelectOk and:[(numSelRows := selectedRowIndex size) > 0]) ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2856
        (numSelRows == 1 and:[self isInSelection:aRowNr]) ifFalse:[ |min max|
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2857
            min := max := aRowNr.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2858
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2859
            selectedRowIndex do:[:anIndex|
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2860
                min := min min:anIndex.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2861
                max := max max:anIndex.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2862
            ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2863
            self selectRowFrom:min to:max.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2864
            ^ self
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2865
        ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2866
        self selectedColIndex ~~ 0 ifTrue:[     "/ toggle column selection
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2867
            colIdx := 0
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2868
        ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2869
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2870
    self selectRowAt:aRowNr colAt:colIdx atPoint:clickPoint openEditor:false.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2871
!
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  2872
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2873
characterPress:aChar x:x y:y
4176
915f6fa47e09 class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
  2874
    "search row in column at x/y starting its printable label with character."
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2875
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2876
    |colNr rowNr lsize found column|
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2877
2445
df54aa1128b3 charcter search: first column which contains a string is searched for
penk
parents: 2398
diff changeset
  2878
    lsize  := list size.
df54aa1128b3 charcter search: first column which contains a string is searched for
penk
parents: 2398
diff changeset
  2879
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2880
"/    (rowIfAbsentBlock notNil
2445
df54aa1128b3 charcter search: first column which contains a string is searched for
penk
parents: 2398
diff changeset
  2881
"/     or:[x isNil
df54aa1128b3 charcter search: first column which contains a string is searched for
penk
parents: 2398
diff changeset
  2882
"/     or:[(colNr := self xVisibleToColNr:x) isNil]]) ifTrue:[
df54aa1128b3 charcter search: first column which contains a string is searched for
penk
parents: 2398
diff changeset
  2883
"/        ^ self
df54aa1128b3 charcter search: first column which contains a string is searched for
penk
parents: 2398
diff changeset
  2884
"/    ].
df54aa1128b3 charcter search: first column which contains a string is searched for
penk
parents: 2398
diff changeset
  2885
    colNr := self findFirstColumnWithStringFrom:1 to:lsize.
2535
4df3f0a09b83 fixed: characterPressed: ... on non editable column
tm
parents: 2524
diff changeset
  2886
    colNr isNil ifTrue:[ ^ self ].
4df3f0a09b83 fixed: characterPressed: ... on non editable column
tm
parents: 2524
diff changeset
  2887
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2888
    rowNr  := self lastIndexSelected.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2889
    column := self columnDescriptorAt:colNr.
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2890
    found  := 0.
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2891
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2892
    lsize > rowNr ifTrue:[
2445
df54aa1128b3 charcter search: first column which contains a string is searched for
penk
parents: 2398
diff changeset
  2893
        "/ search to end
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2894
        found := column findRowNrStartingWithChar:aChar start:(rowNr + 1) stop:lsize.
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2895
    ].
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2896
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2897
    (found == 0 and:[rowNr > 1]) ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2898
     "/ search from begin
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2899
        found := column findRowNrStartingWithChar:aChar start:1 stop:(rowNr - 1)
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2900
    ].
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2901
    found ~~ 0 ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2902
        self selectColIndex:colNr rowIndex:found.
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2903
    ].
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2904
896
aa07612a7c04 care for redirected messages in characterPress:
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2905
    "Modified: / 21.5.1998 / 03:30:22 / cg"
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2906
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  2907
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2908
contentsChanged
4257
0740dae4df00 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4255
diff changeset
  2909
    "size of contents changed - move origin up if possible"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2910
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2911
    |y|
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2912
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2913
    shown ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2914
        self recomputeHeightOfContents.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2915
        y := self maxViewOriginY.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2916
        viewOrigin y > y ifTrue:[
1948
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  2917
            scrollWhenUpdating ~~ false ifTrue:[
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  2918
                self scrollTo:(viewOrigin x @ y)
9ed8131d94bb viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents: 1947
diff changeset
  2919
            ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2920
        ] ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2921
            self updateEditViewOrigin.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2922
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2923
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2924
    super contentsChanged
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2925
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2926
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2927
cursorKey:aKey rawKey:rawKey
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2928
    |hasSelectables step start minSelRowNr maxSelRowNr selColNr selRowNr listSize|
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2929
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2930
    hasSelectables := self hasSelectables.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2931
    listSize := list size.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2932
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2933
    (hasSelectables or:[selectRowOnDefault]) ifFalse:[ ^ self ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2934
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2935
    minSelRowNr := self minIndexSelected.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2936
    maxSelRowNr := self maxIndexSelected.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2937
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  2938
    selColNr := hasSelectables ifFalse:[0] ifTrue:[self selectedColIndex].
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2939
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2940
    aKey == #CursorUp ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2941
        selRowNr := minSelRowNr > 1 ifTrue:[minSelRowNr - 1] ifFalse:[listSize].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2942
        step := -1.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2943
    ] ifFalse:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2944
        aKey == #CursorDown ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2945
            selRowNr := maxSelRowNr < listSize ifTrue:[maxSelRowNr + 1] ifFalse:[1].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2946
            step := 1.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2947
        ] ifFalse:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2948
            ("aKey == #BeginOfLine or:[" rawKey == #Home "]") ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2949
                selRowNr := 1.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2950
                step := 1.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2951
            ] ifFalse:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2952
                (rawKey == #End) ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2953
                    selRowNr := listSize.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2954
                    step := -1.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2955
                ]
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2956
            ]
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2957
        ]
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2958
    ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2959
    start := selRowNr.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2960
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2961
    [ self isRowSelectable:selRowNr ] whileFalse:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2962
        selRowNr := selRowNr + step.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2963
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2964
        selRowNr == 0 ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2965
            selRowNr := listSize.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2966
        ] ifFalse:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2967
            selRowNr > listSize ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2968
                selRowNr := 1.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2969
            ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2970
        ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2971
        selRowNr == start ifTrue:[^ self ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2972
    ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2973
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2974
    ((aKey == #CursorUp) or:[aKey == #CursorDown]) ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2975
        (multipleSelectOk and:[self sensor shiftDown]) ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2976
            self addRowToSelection:selRowNr.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2977
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2978
            aKey == #CursorDown ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2979
                self makeLineVisible:((selRowNr+1) min:listSize)
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2980
            ] ifFalse:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2981
                self makeLineVisible:((selRowNr-1) max:1)
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2982
            ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2983
            ^ self
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2984
        ]
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2985
    ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2986
    self selectColIndex:selColNr rowIndex:selRowNr
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2987
!
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  2988
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  2989
doubleClicked
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2990
    "handle a double click"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  2991
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2992
    |col sel idx|
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2993
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2994
    self hasSelection ifTrue:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2995
        idx := self firstIndexSelected.
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2996
        col := self selectedColumn.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2997
        (col notNil and:[ (sel := col doubleClickedSelector) notNil ]) ifTrue:[
2074
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2044
diff changeset
  2998
            col doubleClickOn:idx
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  2999
        ] ifFalse:[
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  3000
            doubleClickActionBlock notNil ifTrue:[
4772
11b5f36c5943 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4686
diff changeset
  3001
                doubleClickActionBlock valueWithOptionalArgument:idx
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  3002
            ]
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  3003
        ]
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  3004
    ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3005
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3006
667
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3007
findMenuForSelection
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3008
    "find the middle button menu for the current selection; returns the menu or nil"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3009
667
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3010
    |col row menu|
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3011
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3012
    self numberOfSelections == 1 ifTrue:[
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3013
        row := self at:(self firstIndexSelected).
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3014
        col := self selectedColumn.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3015
        col notNil ifTrue:[
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3016
            menu := col menuForRow:row orAdaptor:columnAdaptor.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3017
            menu notNil ifTrue:[ ^ menu ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3018
        ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3019
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3020
        col := columnDescriptors
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3021
                        detect:[:c | c rendererType == #rowSelector ]
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3022
                        ifNone:[ nil ].
667
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3023
        col notNil ifTrue:[
1223
176702811314 kludge: when asking for an itemMenu, pass application to
tm
parents: 1215
diff changeset
  3024
            ^ col menuForRow:row inApplication:(self application)
667
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3025
        ]
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3026
    ].
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3027
    ^ nil
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3028
!
caa3c553d3d1 accessing of the middle-button assigned to a cell
ca
parents: 656
diff changeset
  3029
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3030
keyPress:aKey x:x y:y
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3031
    "a key was pressed - handle page-keys here"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3032
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3033
    <resource: #keyboard (#PreviousPage #NextPage #HalfPageUp #HalfPageDown
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3034
                          #BeginOfText #EndOfText #ScrollUp #ScrollDown
1947
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  3035
                          #CursorUp #CursorDown #CursorRight #CursorLeft #SelectAll)>
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3036
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3037
    |maxColNr firstSelRowNr selRowNr selColNr
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  3038
     key column isTab listSize hasSelectables rawKey|
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3039
1805
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  3040
    self isEnabled ifFalse:[^ self].
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  3041
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
  3042
    (listSize := list size) == 0 ifTrue:[
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
  3043
        ^ super keyPress:aKey x:x y:y
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
  3044
    ].
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3045
    aKey isCharacter ifTrue:[
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3046
        ^ self characterPress:aKey x:x y:y
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3047
    ].
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3048
1947
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  3049
    (aKey == #SelectAll) ifTrue:[
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  3050
        multipleSelectOk ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3051
            self selectAllRows.
1947
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  3052
        ].
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  3053
        ^ self
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  3054
    ].
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  3055
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3056
    aKey == #PreviousPage ifTrue:[^ self pageUp].
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3057
    aKey == #NextPage     ifTrue:[^ self pageDown].
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3058
    aKey == #HalfPageUp   ifTrue:[^ self halfPageUp].
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3059
    aKey == #HalfPageDown ifTrue:[^ self halfPageDown].
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3060
    aKey == #BeginOfText  ifTrue:[^ self scrollToTop].
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3061
    aKey == #EndOfText    ifTrue:[^ self scrollToBottom].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3062
    aKey == #ScrollUp     ifTrue:[^ self scrollUp].
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3063
    aKey == #ScrollDown   ifTrue:[^ self scrollDown].
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3064
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3065
    aKey == #Return ifTrue:[
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3066
        editView notNil ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3067
            (self selectedRowIndex size == 1
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3068
            and:[self selectedRowIndex first == listSize]) ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3069
                self selectRowIndex:nil.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3070
            ] ifFalse:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3071
                self cursorKey:#CursorDown rawKey:#CursorDown.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3072
            ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3073
            ^ self
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3074
        ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3075
        self numberOfSelections == 1 ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3076
            self doubleClicked
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3077
        ].
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  3078
        ^ self
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3079
    ].
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3080
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3081
    hasSelectables := self hasSelectables.
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  3082
5873
c8cf9d94aed1 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5809
diff changeset
  3083
    rawKey := (WindowGroup lastEvent) rawKey.
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  3084
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3085
    (aKey == #CursorUp
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3086
    or:[aKey == #CursorDown
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3087
    or:[rawKey == #Home
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3088
    or:[rawKey == #End]]])
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3089
    ifTrue:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3090
        self cursorKey:aKey rawKey:rawKey.
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3091
        ^ self
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3092
    ].
1668
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
  3093
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
  3094
    hasSelectables ifFalse:[
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
  3095
        ^ super keyPress:aKey x:x y:y
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
  3096
    ].
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
  3097
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3098
    "/ CURSOR LEFT/RIGHT or TABING
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  3099
    (aKey == #CursorLeft or:[aKey == #CursorRight]) ifTrue:[
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  3100
        isTab := false.
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  3101
        key   := aKey.
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  3102
    ] ifFalse:[
1668
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
  3103
        tabIntern ifFalse:[
1665
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3104
            ^ super keyPress:aKey x:x y:y
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3105
        ].
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3106
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3107
        (aKey includesString:'Tab') ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3108
            key := (aKey = #BackTab or:[self sensor shiftDown or:[aKey includesString:'Left']])
2482
13acaaf02528 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2470
diff changeset
  3109
                        ifTrue:[#CursorLeft]
13acaaf02528 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2470
diff changeset
  3110
                        ifFalse:[#CursorRight]
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
  3111
        ] ifFalse:[
1665
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3112
            (aKey == #FocusPrevious or:[aKey == #FocusNext]) ifFalse:[
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
  3113
                ^ super keyPress:aKey x:x y:y
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
  3114
            ].
1665
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3115
            key := aKey == #FocusPrevious ifTrue:[#CursorLeft] ifFalse:[#CursorRight].
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3116
        ].
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3117
        isTab := true.
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3118
    ].
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3119
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3120
    maxColNr := self numberOfColumns.
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  3121
    selColNr := self selectedColIndex.
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  3122
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  3123
    firstSelRowNr := self firstIndexSelected.
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  3124
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3125
    key == #CursorLeft ifTrue:[
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  3126
        selRowNr := firstSelRowNr.
1665
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3127
        selRowNr == 0 ifTrue:[selRowNr := listSize].
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3128
        selColNr == 0 ifTrue:[selColNr := maxColNr + 1].
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3129
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3130
        [true] whileTrue:[
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3131
            (selColNr := selColNr - 1) == 0 ifTrue:[
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3132
                [   selRowNr := selRowNr - 1.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3133
                    selRowNr == 0 ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3134
                        isTab ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3135
                            tabAtStartAction notNil ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3136
                                tabAtStartAction value
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3137
                            ] ifFalse:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3138
                                self deselect.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3139
                                self windowGroup focusPreviousFrom:self
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3140
                            ]
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3141
                        ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3142
                        ^ self
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
  3143
                    ].
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3144
                    (self isRowSelectable:selRowNr)
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3145
                ] whileFalse.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3146
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3147
                selColNr := maxColNr
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3148
            ].
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3149
            column := self columnDescriptorAt:selColNr.
1416
505ef8832a06 focus next/previous
Claus Gittinger <cg@exept.de>
parents: 1408
diff changeset
  3150
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3151
            (column rendererType ~~ #rowSelector and:[column canSelect:selRowNr]) ifTrue:[
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3152
                ^ self selectColIndex:selColNr rowIndex:selRowNr.
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3153
            ]
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3154
        ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3155
    ].
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3156
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  3157
    selRowNr := firstSelRowNr.
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3158
    selRowNr == 0 ifTrue:[selRowNr := 1].
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3159
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3160
    [true] whileTrue:[
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3161
        (selColNr := selColNr + 1) > maxColNr ifTrue:[
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3162
            [   selRowNr := selRowNr + 1.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3163
                selRowNr > listSize ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3164
                    isTab ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3165
                        tabAtEndAction notNil ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3166
                            tabAtEndAction value
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3167
                        ] ifFalse:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3168
                            self deselect.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3169
                            self windowGroup focusNextFrom:self
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3170
                        ]
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3171
                    ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3172
                    ^ self
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3173
                ].
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3174
                (self isRowSelectable:selRowNr)
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3175
            ] whileFalse.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3176
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3177
            selColNr := 1
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3178
        ].
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3179
        column := self columnDescriptorAt:selColNr.
1776
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3180
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3181
        (column rendererType ~~ #rowSelector and:[column canSelect:selRowNr]) ifTrue:[
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3182
            ^ self selectColIndex:selColNr rowIndex:selRowNr
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3183
        ]
e28ffcdd52a7 bugfix in cursor up/down
ca
parents: 1754
diff changeset
  3184
    ].
5873
c8cf9d94aed1 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5809
diff changeset
  3185
c8cf9d94aed1 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5809
diff changeset
  3186
    "Modified: / 09-08-2018 / 09:27:46 / Claus Gittinger"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3187
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3188
5670
9aea34629aea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5666
diff changeset
  3189
keyboardZoom:largerBoolean
5279
d30e2f0b2356 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5252
diff changeset
  3190
    "CTRL+/- zoom action"
d30e2f0b2356 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5252
diff changeset
  3191
5670
9aea34629aea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5666
diff changeset
  3192
    self fontLargerOrSmaller:largerBoolean
5279
d30e2f0b2356 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5252
diff changeset
  3193
!
d30e2f0b2356 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5252
diff changeset
  3194
5563
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3195
mouseWheelZoom:amount
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3196
    "CTRL-wheel action"
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3197
    |oldSize newSize font|
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3198
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3199
    font := gc font.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3200
    font sizeUnit == #px ifTrue:[ ^ self].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3201
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3202
    oldSize := font size.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3203
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3204
    amount > 0 ifTrue:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3205
        oldSize < 5 ifTrue:[ ^ self].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3206
        newSize := oldSize - 1.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3207
    ] ifFalse:[
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3208
        oldSize > 99 ifTrue:[^ self].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3209
        newSize := oldSize + 1.
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3210
    ].
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3211
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3212
    self font:(font asSize:newSize).
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3213
!
9dae00116509 #BUGFIX by ca
ca
parents: 5517
diff changeset
  3214
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3215
originChanged:delta
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3216
    "this one is sent, after the origin of my contents has changed -
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3217
     tell dependents (i.e. scrollers) about this"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3218
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3219
    super originChanged:delta.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3220
    self updateEditViewOrigin.
2276
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3221
!
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3222
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3223
sizeChanged:how
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3224
    "size changed - move origin up if possible
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3225
     change the layout of the labelView dependent on my layout"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3226
4163
3d9fbb60d952 class: DSVColumnView
ca
parents: 4161
diff changeset
  3227
    |selectionWasVisible lastExtent|
3d9fbb60d952 class: DSVColumnView
ca
parents: 4161
diff changeset
  3228
3d9fbb60d952 class: DSVColumnView
ca
parents: 4161
diff changeset
  3229
    lastExtent := previousExtent notNil ifTrue:[previousExtent] ifFalse:[self extent].
3d9fbb60d952 class: DSVColumnView
ca
parents: 4161
diff changeset
  3230
    selectionWasVisible := self isSelectionVisibleIn:lastExtent.
2276
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3231
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3232
    previousExtent := self extent.
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3233
    super sizeChanged:how.
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3234
4163
3d9fbb60d952 class: DSVColumnView
ca
parents: 4161
diff changeset
  3235
    previousExtent := self extent.
3d9fbb60d952 class: DSVColumnView
ca
parents: 4161
diff changeset
  3236
2276
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3237
    "/ no - must compute even if not visible.
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3238
    "/ (could be invisible in a notebook ...)
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3239
    realized ifTrue:[                   "used to be: shown"
2276
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3240
"/        labelView isVisible ifTrue:[
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3241
"/            lyt := labelView layout.
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3242
"/            lyt  leftOffset:(layout leftOffset).
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3243
"/            lyt rightOffset:(layout rightOffset).
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3244
"/            labelView layout:lyt.
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3245
"/        ].
4163
3d9fbb60d952 class: DSVColumnView
ca
parents: 4161
diff changeset
  3246
        previousExtent x ~= lastExtent x ifTrue: [
4123
a80521cc987c changed: #sizeChanged:
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  3247
            self fitColumns.
a80521cc987c changed: #sizeChanged:
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  3248
        ].
2276
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3249
        selectionWasVisible ifTrue:[
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3250
            self makeSelectionVisible.
4020
3bf856409692 changed: #sizeChanged:
ca
parents: 3994
diff changeset
  3251
        ].
3bf856409692 changed: #sizeChanged:
ca
parents: 3994
diff changeset
  3252
        self updateEditViewOrigin.
2276
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  3253
    ].
4059
b8d390e67d16 changed: #sizeChanged:
Claus Gittinger <cg@exept.de>
parents: 4056
diff changeset
  3254
4123
a80521cc987c changed: #sizeChanged:
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  3255
    "Modified: / 04-05-2012 / 14:34:24 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3256
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3257
1665
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3258
!DSVColumnView methodsFor:'focus handling'!
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3259
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3260
canTab
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3261
    super canTab ifTrue:[
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3262
        ^ editView isNil
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3263
    ].
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3264
    ^ false
2101
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3265
!
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3266
3138
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3267
showFocus:explicit
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3268
    self invalidateSelection.
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3269
    super showFocus:explicit
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3270
!
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3271
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3272
showNoFocus:explicit
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3273
    self invalidateSelection.
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3274
    super showNoFocus:explicit
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3275
!
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3276
2101
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3277
wantsFocusWithPointerEnter
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3278
    "views which like to take the keyboard focus
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3279
     when the pointer enters can do so by redefining this
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3280
     to return true"
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3281
3924
72044fd3296a changed: #wantsFocusWithPointerEnter
Claus Gittinger <cg@exept.de>
parents: 3923
diff changeset
  3282
    editView notNil ifTrue:[^ false].
2237
1da5501b1248 bug fix in focus handling
ca
parents: 2226
diff changeset
  3283
2958
99f7bfe9e9a2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3284
    (UserPreferences current focusFollowsMouse ~~ false
2101
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3285
    and:[(styleSheet at:#'selection.requestFocusOnPointerEnter' default:true)
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3286
    ]) ifTrue:[
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3287
        list size > 0 ifTrue:[
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3288
            ^ true
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3289
        ]
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3290
    ].
56dce43c4f46 *** empty log message ***
penk
parents: 2074
diff changeset
  3291
    ^ false
3924
72044fd3296a changed: #wantsFocusWithPointerEnter
Claus Gittinger <cg@exept.de>
parents: 3923
diff changeset
  3292
72044fd3296a changed: #wantsFocusWithPointerEnter
Claus Gittinger <cg@exept.de>
parents: 3923
diff changeset
  3293
    "Modified: / 08-08-2010 / 14:41:00 / cg"
1665
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3294
! !
51c444bfe5ae default behavour tabing; not yet configurable (next step)
ca
parents: 1661
diff changeset
  3295
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3296
!DSVColumnView methodsFor:'gc operations'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3297
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3298
imageOnMyDevice:anImage
4606
1cc343187f71 Sending of Image>>#clearMaskedPixels moved to Image >> #asFormOnDevice:
Stefan Vogel <sv@exept.de>
parents: 4589
diff changeset
  3299
    "associate image to device and returns the new image."
1cc343187f71 Sending of Image>>#clearMaskedPixels moved to Image >> #asFormOnDevice:
Stefan Vogel <sv@exept.de>
parents: 4589
diff changeset
  3300
1cc343187f71 Sending of Image>>#clearMaskedPixels moved to Image >> #asFormOnDevice:
Stefan Vogel <sv@exept.de>
parents: 4589
diff changeset
  3301
    anImage isNil ifTrue:[^ nil].
4991
ddee68d07788 device access
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
  3302
    ^ anImage onDevice:device.
1100
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  3303
!
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  3304
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3305
registerImage:anImage key:aKey
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3306
    "any row can register an image with a unique identifier a key symbol"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3307
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3308
    |img|
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3309
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3310
    (img := registererImages at:aKey ifAbsent:nil) notNil ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3311
        ^ img
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3312
    ].
2488
74c81c1e30d7 imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  3313
    img := self imageOnMyDevice:anImage.
567
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
  3314
    registererImages at:aKey put:img.
01083cbb4bae checkin from browser
ca
parents: 563
diff changeset
  3315
    ^ img
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3316
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3317
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3318
registeredImageAt:aKey
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3319
    "any row can register an image with a unique identifier"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3320
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3321
    ^ registererImages at:aKey ifAbsent:nil
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3322
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3323
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3324
releaseAllRegisteredImages
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3325
    "release all registered images"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3326
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3327
    registererImages := IdentityDictionary new.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3328
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3329
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3330
!DSVColumnView methodsFor:'help'!
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3331
5680
48cf8714352b #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5670
diff changeset
  3332
helpTextAt:aPoint
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3333
    "return the helpText for aPoint (i.e. when mouse-pointer is moved over an item)."
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3334
3248
c9e48b873e6e do not provide col-helptext if beyond the last row
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  3335
    |rowNr colNr col|
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3336
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3337
    columnDescriptors isEmpty ifTrue:[^ nil].
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3338
3248
c9e48b873e6e do not provide col-helptext if beyond the last row
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  3339
    rowNr := self yVisibleToRowNr:aPoint y.
c9e48b873e6e do not provide col-helptext if beyond the last row
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  3340
    rowNr isNil ifTrue:[^ nil ].
c9e48b873e6e do not provide col-helptext if beyond the last row
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  3341
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3342
    colNr := self xVisibleToColNr:aPoint x.
3217
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  3343
    colNr notNil ifTrue:[
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3344
        col := columnDescriptors at:colNr.
3458
5f9a85c6279a Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 3449
diff changeset
  3345
        ^ col activeHelpTextForRow:rowNr.
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3346
    ].
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3347
    ^ nil
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3348
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3349
    "Created: / 26-03-2007 / 14:42:54 / cg"
3248
c9e48b873e6e do not provide col-helptext if beyond the last row
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  3350
    "Modified: / 16-10-2007 / 17:52:24 / cg"
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3351
! !
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3352
2500
1477b0a5a918 method category rename
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
  3353
!DSVColumnView methodsFor:'initialization & release'!
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3354
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3355
create
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3356
    |graphicsDevice|
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3357
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3358
    super create.
4991
ddee68d07788 device access
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
  3359
    graphicsDevice := device.
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3360
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3361
    fgColor     := fgColor     onDevice:graphicsDevice.
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3362
    bgColor     := bgColor     onDevice:graphicsDevice.
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3363
    selectionForegroundColor := selectionForegroundColor onDevice:graphicsDevice.
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3364
    selectionBackgroundColor := selectionBackgroundColor onDevice:graphicsDevice.
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3365
    selectionFrameColor notNil ifTrue:[selectionFrameColor := selectionFrameColor onDevice:graphicsDevice].
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3366
    selectionForegroundColorNoFocus := selectionForegroundColorNoFocus onDevice:graphicsDevice.
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3367
    selectionBackgroundColorNoFocus := selectionBackgroundColorNoFocus onDevice:graphicsDevice.
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3368
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3369
    buttonShadowColor := buttonShadowColor onDevice:graphicsDevice.
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3370
    buttonLightColor  := buttonLightColor onDevice:graphicsDevice.
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3371
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3372
    buttonHalfShadowColor notNil ifTrue:[
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3373
        buttonHalfShadowColor := buttonHalfShadowColor onDevice:graphicsDevice
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3374
    ].
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3375
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3376
    buttonHalfLightColor notNil ifTrue:[
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3377
        buttonHalfLightColor := buttonHalfLightColor onDevice:graphicsDevice
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3378
    ].
2488
74c81c1e30d7 imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  3379
    rowSelectorForm         := self imageOnMyDevice:rowSelectorForm.
74c81c1e30d7 imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  3380
    checkToggleActiveImage  := self imageOnMyDevice:checkToggleActiveImage.
74c81c1e30d7 imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  3381
    checkTogglePassiveImage := self imageOnMyDevice:checkTogglePassiveImage.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3382
    checkToggleForm         := self imageOnMyDevice:checkToggleForm.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3383
    radioButtonActiveImage  := self imageOnMyDevice:radioButtonActiveImage.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3384
    radioButtonPassiveImage := self imageOnMyDevice:radioButtonPassiveImage.
2488
74c81c1e30d7 imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  3385
    comboButtonForm         := self imageOnMyDevice:comboButtonForm.
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  3386
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  3387
    "Modified: / 20-01-2011 / 08:43:51 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3388
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3389
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3390
initStyle
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3391
    "setup colors, etc."
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3392
1100
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  3393
    |button widget|
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3394
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3395
    super initStyle.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3396
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3397
    DefaultForegroundColor isNil ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3398
        self class updateStyleCache
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3399
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3400
    fgColor     := DefaultForegroundColor.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3401
    bgColor     := DefaultBackgroundColor.
4875
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
  3402
    labelFgColor := DefaultLabelForegroundColor.
e47db739d7d1 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 4794
diff changeset
  3403
    labelBgColor := DefaultLabelBackgroundColor.
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  3404
    selectionForegroundColor := DefaultHilightForegroundColor.
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  3405
    selectionBackgroundColor := DefaultHilightBackgroundColor.
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  3406
    selectionFrameColor      := DefaultHilightFrameColor.
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3407
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3408
    shadowColor isNil ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3409
        shadowColor := Color grayPercent:40.
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3410
    ].
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3411
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3412
    lightColor isNil ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3413
        lightColor := Color grayPercent:75
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3414
    ].
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3415
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3416
    buttonLightColor    := ButtonLightColor  ? lightColor.
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3417
    buttonShadowColor   := ButtonShadowColor ? shadowColor.
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3418
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3419
    (ButtonEdgeStyle == #soft) ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3420
        buttonHalfShadowColor := ButtonHalfShadowColor.
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3421
        buttonHalfLightColor  := ButtonHalfLightColor.
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3422
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3423
        buttonHalfShadowColor isNil ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3424
            buttonHalfShadowColor := buttonShadowColor lightened
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3425
        ]
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  3426
    ].
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3427
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3428
    buttonHalfShadowColor isNil ifTrue:[
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3429
        buttonHalfShadowColor := Color gray
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3430
    ].
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3431
3138
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3432
    selectionForegroundColorNoFocus isNil ifTrue:[
4653
e760275fb093 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4644
diff changeset
  3433
        selectionForegroundColorNoFocus := DefaultHilightForegroundColorNoFocus.
e760275fb093 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4644
diff changeset
  3434
        selectionForegroundColorNoFocus isNil ifTrue:[
e760275fb093 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4644
diff changeset
  3435
            selectionForegroundColorNoFocus := selectionForegroundColor slightlyLightened.
e760275fb093 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4644
diff changeset
  3436
        ]
3138
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3437
    ].
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3438
    selectionBackgroundColorNoFocus isNil ifTrue:[
4644
a1734dfe9bfe class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4613
diff changeset
  3439
        selectionBackgroundColorNoFocus := DefaultHilightBackgroundColorNoFocus.
a1734dfe9bfe class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4613
diff changeset
  3440
        selectionBackgroundColorNoFocus isNil ifTrue:[
a1734dfe9bfe class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4613
diff changeset
  3441
            selectionBackgroundColor notNil ifTrue:[
4653
e760275fb093 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4644
diff changeset
  3442
                selectionBackgroundColorNoFocus := selectionBackgroundColor slightlyLightened.
4644
a1734dfe9bfe class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4613
diff changeset
  3443
                "/ selectionBackgroundColorNoFocus := Color brightness:(selectionBackgroundColor "lightened" brightness).   "/ asGray.
a1734dfe9bfe class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4613
diff changeset
  3444
            ].
4101
675d38e2ad1e changed: #initStyle
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
  3445
        ].
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  3446
    ].
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  3447
    selectionFrameColorNoFocus isNil ifTrue:[
4101
675d38e2ad1e changed: #initStyle
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
  3448
        selectionFrameColor notNil ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3449
            selectionFrameColorNoFocus := selectionFrameColor lightened.
4101
675d38e2ad1e changed: #initStyle
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
  3450
            "/ selectionFrameColorNoFocus := Color brightness:(selectionFrameColor "lightened" brightness).   "/ asGray
675d38e2ad1e changed: #initStyle
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
  3451
        ]
3138
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3452
    ].
bf718db445b5 highlight selection dependent on has focus
ca
parents: 3130
diff changeset
  3453
2711
6cbf18e03573 category
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  3454
    rowSelectorForm         := self class rowSelectorImage.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3455
1100
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  3456
    checkToggleActiveImage  := CheckToggleActiveImage.
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  3457
    checkTogglePassiveImage := CheckTogglePassiveImage.
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3458
    
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3459
    CheckToggleDisabledActiveImage isNil ifTrue:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3460
        CheckToggleDisabledActiveImage := CheckToggle disabledActiveImage
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3461
    ].    
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3462
    CheckToggleDisabledPassiveImage isNil ifTrue:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3463
        CheckToggleDisabledPassiveImage := CheckToggle disabledPassiveImage
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3464
    ].    
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3465
    checkToggleDisabledActiveImage  := CheckToggleDisabledActiveImage.
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3466
    checkToggleDisabledPassiveImage := CheckToggleDisabledPassiveImage.
1100
376515452be4 support of all styles; windows and next
ca
parents: 1089
diff changeset
  3467
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3468
    CheckToggleForm isNil ifTrue:[
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3469
        widget            := CheckToggle new.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3470
        CheckToggleForm   := widget label.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3471
        CheckToggleLevel  := widget offLevel.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3472
        CheckToggleExtent := widget preferredExtent.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3473
    ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3474
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3475
    checkToggleForm   := CheckToggleForm.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3476
    checkToggleLevel  := CheckToggleLevel.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3477
    checkToggleExtent := CheckToggleExtent.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3478
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3479
    radioButtonActiveImage  := RadioButtonActiveImage.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3480
    radioButtonPassiveImage := RadioButtonPassiveImage.
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3481
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3482
    RadioButtonDisabledActiveImage isNil ifTrue:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3483
        RadioButtonDisabledActiveImage := RadioButton disabledActiveForm.
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3484
    ].    
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3485
    RadioButtonDisabledPassiveImage isNil ifTrue:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3486
        RadioButtonDisabledPassiveImage := RadioButton disabledPassiveForm.
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3487
    ].    
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3488
    radioButtonDisabledActiveImage  := RadioButtonDisabledActiveImage.
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3489
    radioButtonDisabledPassiveImage := RadioButtonDisabledPassiveImage.
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3490
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3491
    ComboButtonForm isNil ifTrue:[
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3492
        widget            := ComboListView new.
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3493
        button            := widget menuButton.
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3494
        ComboButtonForm   := button label.
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3495
        ComboButtonLevel  := button offLevel.
3428
436f115aefe8 added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3496
        ComboButtonExtent := (button preferredWidth) @ (widget preferredHeight).
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3497
    ].
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3498
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3499
    comboButtonForm   := ComboButtonForm.
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3500
    ComboButtonDisabledForm isNil ifTrue:[
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3501
        ComboButtonDisabledForm := ComboView disabledForm
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3502
    ].    
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3503
    comboButtonDisabledForm   := ComboButtonDisabledForm.
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3504
    comboButtonLevel  := ComboButtonLevel.
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  3505
    comboButtonExtent := ComboButtonExtent.
3989
5c6706e4e0d1 preps for highlight-frame color
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
  3506
4101
675d38e2ad1e changed: #initStyle
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
  3507
    "Modified: / 20-01-2012 / 15:48:13 / cg"
5890
99d778b7d1a3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  3508
    "Modified: / 17-08-2018 / 17:33:56 / Claus Gittinger"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3509
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3510
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3511
initialize
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3512
    "set default attributes"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3513
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3514
    |fontOnDevice|
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3515
5603
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  3516
    verticalSpacing    := verticalSpacing ? self class verticalSpacing.
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  3517
    horizontalSpacing  := horizontalSpacing ? self class horizontalSpacing.
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  3518
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3519
    super initialize.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3520
    self lineWidth:0.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3521
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  3522
    separatorSize      := 1.                            "/ separators mode 2D
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  3523
    verticalSpacing    := self class verticalSpacing.
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  3524
    horizontalSpacing  := self class horizontalSpacing.
1668
085f5ee84f9b tabing internal
ca
parents: 1665
diff changeset
  3525
    tabIntern          := true.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3526
    useIndex           := true.
5664
8eb2ee9eb548 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5639
diff changeset
  3527
    ignoreReselect     := true.
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  3528
    viewOrigin         := 0@0.
5204
fccb63f32188 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5195
diff changeset
  3529
    fontOnDevice       := gc deviceFont.
4521
727d661f5e8e class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4496
diff changeset
  3530
    rowFontAscent      := fontOnDevice ascent.
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  3531
    rowHeight          := verticalSpacing + (fontOnDevice height) + verticalSpacing + separatorSize.
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2580
diff changeset
  3532
    minRowHeight       := rowHeight.
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  3533
    multipleSelectOk   := false.                        "/ multiselect disabled
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  3534
    selectedRowIndex   := 0.                            "/ no selection
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3535
    self selectedColIndex:0.
1778
51bbd960baf9 change registeredIcons from IdentityDictionary to Dictionary
ca
parents: 1776
diff changeset
  3536
    registererImages   := Dictionary new.
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  3537
    columnDescriptors  := #().
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  3538
    beDependentOfRows  := false.
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  3539
    colorMap           := Dictionary new.
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  3540
    catchChangeEvents  := false.
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  3541
    selectRowOnDefault := true.
1749
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  3542
    autoScroll         := true.
3130
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
  3543
    autoScrollToColumn := true.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3544
    scrollRowWise      := false.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3545
    sortListInPlace    := false.    "/ when false (default for backward compatibility):
4613
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  3546
                                    "/ if sorting, create a copy
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  3547
                                    "/ of the list, which is wrong when useIndex is on,
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  3548
                                    "/ as the application will get the index in the sorted
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  3549
                                    "/ list, which is probably different from tha apps list mode.
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  3550
                                    "/ When true (should be default, but that might break many
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  3551
                                    "/ users), the passed in list is sorted in place (i.e. possibly
73e2facef522 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  3552
                                    "/ sorting the application's list).
5194
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  3553
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  3554
    updateListHolderWhenSorting := false.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3555
                                    "/ when false (default for backward compatibility):
5194
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  3556
                                    "/ if sorting, do not write back the sorted list into the listHolder
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  3557
                                    "/ When true (should be default, but that might break many
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  3558
                                    "/ users), the sorted list is written back into the listHolder,
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  3559
                                    "/ but only if sortListInPlace is false.
b28b44a4a21e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5100
diff changeset
  3560
3223
b9d1b2cec92d Bug 623: active help during button motion
ca
parents: 3219
diff changeset
  3561
    "/ need for active help
b9d1b2cec92d Bug 623: active help during button motion
ca
parents: 3219
diff changeset
  3562
    self enableMotionEvents.
b9d1b2cec92d Bug 623: active help during button motion
ca
parents: 3219
diff changeset
  3563
5603
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  3564
    "Modified: / 13-09-2017 / 16:08:34 / cg"
705
d9ebfd72d506 set selection if exists after mapping
tz
parents: 667
diff changeset
  3565
!
d9ebfd72d506 set selection if exists after mapping
tz
parents: 667
diff changeset
  3566
2807
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3567
mapped
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3568
    "set selection (if any) after mapping"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3569
2807
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3570
    |idx|
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3571
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3572
    super mapped.
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3573
    needFitColumns == true ifTrue:[
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3574
        self fitColumns
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3575
    ].
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3576
    (idx := self firstIndexSelected) ~~ 0 ifTrue:[
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3577
        self scrollToRowAt:idx colAt:0.
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3578
    ].
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3579
!
0e03635f5ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3580
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3581
realize
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3582
    "recompute contents and fit columns to view"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3583
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3584
    |selection|
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3585
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3586
    self bitGravity:#NorthWest.
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3587
    self recomputeHeightOfContents.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3588
    selection := 0.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3589
    model notNil ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3590
        (model respondsTo:#selectionIndex) ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3591
            selection := model selectionIndex
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3592
        ] ifFalse:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3593
            model == listHolder ifFalse:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3594
                selection := model value
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3595
            ]
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3596
        ]
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3597
    ].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3598
    self selectRowIndex:selection.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3599
    super realize.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3600
    self fitColumns.
2011
128778a6a31d dont scroll to top on mapped
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  3601
!
128778a6a31d dont scroll to top on mapped
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  3602
2157
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  3603
release
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3604
    "remove dependencies"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3605
2157
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  3606
    self columnHolder:nil.
4219
5038c1c44e84 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4176
diff changeset
  3607
5038c1c44e84 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4176
diff changeset
  3608
    beDependentOfRows ifTrue:[self makeIndependentOfRows].
5038c1c44e84 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4176
diff changeset
  3609
    listHolder notNil ifTrue:[
5038c1c44e84 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4176
diff changeset
  3610
        listHolder removeDependent:self.
5038c1c44e84 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4176
diff changeset
  3611
    ].
2157
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  3612
    columnAdaptor isValueModel ifTrue:[
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  3613
        columnAdaptor removeDependent:self
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  3614
    ].
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  3615
    super release
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  3616
! !
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  3617
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  3618
!DSVColumnView methodsFor:'obsolete'!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  3619
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  3620
has3Dsepartors
3770
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3621
    <resource: #obsolete>
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3622
    "shouldn't be used any more"
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3623
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3624
    self obsoleteMethodWarning.
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3625
    ^ self has3Dseparators
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3626
!
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3627
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3628
has3Dsepartors:aBool
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3629
    <resource: #obsolete>
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3630
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3631
    "shouldn't be used any more"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3632
3770
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  3633
    self obsoleteMethodWarning.
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  3634
    self has3Dseparators:aBool
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3635
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3636
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3637
!DSVColumnView methodsFor:'private'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3638
1951
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3639
anyColumnHasBackground
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3640
    columnDescriptors isNil ifTrue:[^ false].
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3641
    columnDescriptors do:[:eachCol |
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3642
        |bg|
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3643
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3644
        bg := eachCol backgroundColor.
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3645
        (bg notNil and:[bg isImageOrForm]) ifTrue:[^ true].
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3646
        eachCol bgSelector notNil ifTrue:[^ true].
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3647
    ].
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3648
    ^ false.
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3649
!
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3650
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3651
anyColumnHasPotentialNonConstantBackground
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3652
    columnDescriptors isNil ifTrue:[^ false].
2933
ab7be1db710d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  3653
    ^ columnDescriptors contains:[:someCol | someCol hasPotentialNonConstantBackground].
ab7be1db710d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  3654
"/    columnDescriptors do:[:eachCol | eachCol hasPotentialNonConstantBackground ifTrue:[^ true]].
ab7be1db710d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  3655
"/    ^ false.
1951
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3656
!
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3657
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3658
destroyEditView
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3659
    "destroy the edit view; release KeyboardForwarder"
2730
77bab35466a3 *** empty log message ***
ca
parents: 2728
diff changeset
  3660
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  3661
    editValue notNil ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  3662
        editValue removeDependent:self.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  3663
        editValue := nil
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  3664
    ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  3665
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  3666
    editView notNil ifTrue:[ |winGroup focusView|
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  3667
        self hasFocus ifTrue:[focusView := self].
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3668
        editView isDialogBox ifTrue:[
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3669
            focusView := self
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3670
        ] ifFalse:[    
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3671
            editView withAllSubViewsDo:[:aView |
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3672
                aView hasFocus ifTrue:[focusView := self].
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3673
                aView delegate:nil
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3674
            ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  3675
        ].
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3676
        editView destroy.
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3677
        editView := nil.
2730
77bab35466a3 *** empty log message ***
ca
parents: 2728
diff changeset
  3678
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  3679
        winGroup := self windowGroup.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  3680
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  3681
        winGroup notNil ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  3682
            winGroup focusView:focusView.
2730
77bab35466a3 *** empty log message ***
ca
parents: 2728
diff changeset
  3683
        ]
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3684
    ].
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3685
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  3686
    "Modified: / 23-04-2019 / 19:13:41 / Claus Gittinger"
1111
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3687
!
4fd0430173fa support #Tab
ca
parents: 1109
diff changeset
  3688
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3689
detectViewAt:aPoint in:aView
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3690
    "returns the view at a point"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3691
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3692
    aView isNil ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3693
        ^ nil
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3694
    ].
2019
0d2757149700 extracted common code to detectViewAt:aPoint.
Claus Gittinger <cg@exept.de>
parents: 2011
diff changeset
  3695
    ^ aView detectViewAt:aPoint.
637
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  3696
!
e56ec99923ae VW compatible
ca
parents: 622
diff changeset
  3697
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3698
fitColumns
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3699
    "fit columns to view; "
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3700
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3701
    |selectedColumn columnsWithRelativeWidth
4415
474bed6d8e60 class: DSVColumnView
ca
parents: 4359
diff changeset
  3702
     overallMinWidth restWidth anyChange oldOrgX newOrgX oldWidth|
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3703
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3704
    realized ifFalse:[
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3705
        needFitColumns := true.
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3706
        ^ self
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3707
    ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3708
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  3709
    cachedPreferredExtent isNil ifTrue:[
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3710
        self preferredExtent.
2956
c4319600989e *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 2933
diff changeset
  3711
    ] ifFalse:[
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  3712
        oldWidth := cachedPreferredExtent x.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  3713
    ].
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3714
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3715
    columnDescriptors isEmpty ifTrue:[
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3716
        ^ self
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3717
    ].
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3718
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3719
    overallMinWidth := 0.
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3720
    anyChange := false.
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3721
    columnsWithRelativeWidth := OrderedCollection new.
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3722
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3723
    columnDescriptors do:[:aCol|
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3724
        aCol canResize ifTrue:[
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3725
            anyChange := true.
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3726
            aCol invalidate.
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3727
        ].
4415
474bed6d8e60 class: DSVColumnView
ca
parents: 4359
diff changeset
  3728
        aCol hasRelativeWidth ifTrue:[columnsWithRelativeWidth add:aCol].
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3729
        overallMinWidth := overallMinWidth + aCol minWidth.
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3730
    ].
4415
474bed6d8e60 class: DSVColumnView
ca
parents: 4359
diff changeset
  3731
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3732
    cachedPreferredExtent := width @(self preferredHeight).
4425
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3733
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3734
    columnsWithRelativeWidth notEmpty ifTrue:[
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3735
        restWidth := self innerWidth - overallMinWidth.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3736
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3737
        restWidth > 0 ifTrue:[
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3738
            |sumOfAnnouncedRelativeWidths sumWeach|
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3739
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3740
            "/ distribute restwidth among remaining columns according to
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3741
            "/ their announced relative width's
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3742
            sumOfAnnouncedRelativeWidths := columnsWithRelativeWidth sum:[:each | each description width].
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3743
            sumWeach := 0.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3744
            columnsWithRelativeWidth do:[:each |
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3745
                |eachRel wEach|
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3746
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3747
                eachRel := each description width / sumOfAnnouncedRelativeWidths.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3748
                each == columnsWithRelativeWidth last ifTrue:[
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3749
                    wEach := restWidth - sumWeach.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3750
                ] ifFalse:[
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3751
                    wEach := (eachRel * restWidth) truncated.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3752
                    sumWeach := sumWeach + wEach.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3753
                ].
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3754
                each setWidth:wEach.
4415
474bed6d8e60 class: DSVColumnView
ca
parents: 4359
diff changeset
  3755
            ].
4425
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3756
        ]
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3757
    ] ifFalse:[
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3758
        anyChange ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3759
            | resizableColumns numberOfResizable additionalOffsetX |
4425
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3760
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3761
            overallMinWidth  := 0.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3762
            resizableColumns := OrderedCollection new.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3763
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3764
            columnDescriptors do:[: eachColumn |
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3765
                eachColumn canResize ifTrue:[ resizableColumns add: eachColumn ].
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3766
                eachColumn width: nil. "force a recomputation of width"
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3767
                overallMinWidth := overallMinWidth + eachColumn width.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3768
            ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3769
            numberOfResizable := resizableColumns size.
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3770
            numberOfResizable > 0 ifTrue:[
4425
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3771
                restWidth := self innerWidth - overallMinWidth.
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3772
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3773
                restWidth > numberOfResizable ifTrue:[
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3774
                    additionalOffsetX := restWidth // numberOfResizable.
4425
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3775
                    resizableColumns do:[:aCol| aCol growWidth:additionalOffsetX ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3776
                    restWidth := restWidth - (additionalOffsetX * numberOfResizable).
4425
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3777
                ].
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3778
                restWidth > 0 ifTrue:[ resizableColumns last growWidth:restWidth ].
c013e9757f1a class: DSVColumnView
ab
parents: 4415
diff changeset
  3779
            ].
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3780
        ].
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  3781
    ].
1492
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  3782
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  3783
    shown ifTrue:[
4116
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  3784
        "have to invalidate unconditionally even if nothing has been changed here:
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  3785
         #fitColumns is called from #changeWidthOfColumn:deltaX:
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  3786
         after a manual resize"
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  3787
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  3788
        self      invalidate.
d79570ee3773 changed:
Stefan Vogel <sv@exept.de>
parents: 4101
diff changeset
  3789
        labelView invalidate.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3790
1498
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3791
        (oldOrgX := viewOrigin x) ~~ 0 ifTrue:[
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3792
            |prefWidth|
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3793
1498
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3794
            "/ UPDATE VIEW-ORIGIN X
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3795
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3796
            prefWidth   := self preferredWidth.
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3797
            newOrgX := (prefWidth - self innerWidth) max:0.
1498
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3798
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3799
            newOrgX < oldOrgX ifTrue:[
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3800
                self originWillChange.
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3801
                viewOrigin := newOrgX @ (viewOrigin y).
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3802
                self originChanged:((newOrgX - oldOrgX) @ 0).
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3803
            ]
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3804
        ].
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3805
1930
31274c3264d6 do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
  3806
        "/ cg: do not scroll to selection when a column-size is changed
2319
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3807
1930
31274c3264d6 do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
  3808
"/        self hasSelection ifTrue:[
31274c3264d6 do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
  3809
"/            editView notNil ifTrue:[
31274c3264d6 do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
  3810
"/                editView width:(self selectedColumn width - (2 * separatorSize)).
31274c3264d6 do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
  3811
"/            ].
31274c3264d6 do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
  3812
"/            self scrollToSelection.
31274c3264d6 do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
  3813
"/        ].
2319
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3814
4095
1a4c11fc0865 added: #invalidateDeviceRectangle:repairNow:
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  3815
        "/ ca: but resize the editView (if there is any currently visible)
2319
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3816
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3817
        editView notNil ifTrue:[
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3818
            selectedColumn := self selectedColumn.
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3819
            selectedColumn notNil ifTrue:[
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3820
                editView width:(selectedColumn width - (2 * separatorSize)).
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3821
            ]
b75af47412ff bug fix; if columns extent changed, update extent of editView
ca
parents: 2318
diff changeset
  3822
        ].
3428
436f115aefe8 added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3823
        oldWidth ~= self preferredWidth ifTrue:[
2956
c4319600989e *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 2933
diff changeset
  3824
            self contentsChanged.
c4319600989e *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 2933
diff changeset
  3825
        ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3826
    ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3827
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3828
    "Modified (format): / 15-03-2018 / 11:40:25 / mawalch"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3829
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3830
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3831
hasSelectables
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3832
    columnDescriptors do:[:aCol|
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3833
        (aCol rendererType == #rowSelector) ifFalse:[
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3834
            (aCol description canSelect) ifTrue:[^ true].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3835
        ]
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3836
    ].
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3837
    ^ false.
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3838
!
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  3839
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3840
maxViewOriginY
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3841
    "returns the maximum possible y of the view origin"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3842
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3843
    |y|
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3844
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3845
    y := self heightOfContents - self innerHeight.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3846
    ^ y max:0
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3847
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3848
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3849
updateEditViewOrigin
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3850
    "update origin of the editView"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3851
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3852
    |x y|
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3853
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3854
    editView notNil ifTrue:[
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  3855
        y := self yVisibleOfRowNr:(self firstIndexSelected).
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  3856
        x := self xVisibleOfColNr:self selectedColIndex.
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  3857
        editView origin:(x @ y + separatorSize).
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3858
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3859
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3860
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3861
xVisibleOfColNr:aColNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3862
    "returns visible x assigned to a column number"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3863
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3864
    |x
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3865
     end "{ Class:SmallInteger }"|
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3866
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3867
    x := margin - viewOrigin x.
1498
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3868
    aColNr > 1 ifTrue:[
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  3869
        end := aColNr - 1.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3870
        columnDescriptors
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3871
            from:1
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3872
            to:end
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3873
            do:[:aCol | x := x + aCol width ]
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  3874
    ].
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3875
    ^ x
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3876
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3877
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3878
xVisibleToColNr:x
3217
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  3879
    "returns the column number for a physical x position.
5079
1ef6c9d3cdf3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5057
diff changeset
  3880
     Returns nil if x is beyond the last column."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3881
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3882
    |x0|
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3883
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3884
    x0 := x + viewOrigin x - margin.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3885
    columnDescriptors keysAndValuesDo:[:index :aCol |
1951
670b575a31a4 if any col has potential non-constant background,
ps
parents: 1949
diff changeset
  3886
        x0 := x0 - aCol width.
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3887
        x0 <= 0 ifTrue:[ ^ index ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3888
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3889
    ^ nil.
3215
edb9fb9e4931 activeHelpText
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
  3890
3217
e74188fce7c2 xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
  3891
    "Modified: / 26-03-2007 / 15:22:01 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3892
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3893
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3894
yVisibleOfRowNr:aRowNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3895
    "returns visible y assigned to the row number"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3896
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3897
    ^ (aRowNr - 1) * rowHeight + margin - viewOrigin y
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3898
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3899
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3900
yVisibleToRowNr:y
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3901
    "returns the row number assigned to a physical y or nil"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3902
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  3903
    |rowNr|
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  3904
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  3905
    rowNr := (y + viewOrigin y - margin) // rowHeight + 1.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  3906
    (rowNr between:1 and:(list size)) ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  3907
        ^ rowNr
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  3908
    ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  3909
    ^ nil
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3910
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3911
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3912
!DSVColumnView methodsFor:'queries'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3913
2728
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  3914
firstLineShown
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  3915
    "for protocol-compat. with listviews"
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  3916
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  3917
    ^ self indexOfFirstRowShown
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  3918
!
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  3919
1149
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  3920
hasOpenEditor
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  3921
    ^ editView notNil
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  3922
!
c212f122c8b3 allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  3923
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  3924
indexOfFirstRowShown
2797
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3925
    "returns the index of the first shown row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3926
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  3927
    |idx|
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  3928
1498
3b4dc3326705 checkin from browser
tm
parents: 1497
diff changeset
  3929
    idx := (viewOrigin y // rowHeight) + 1.
2797
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3930
    ^ (idx max:1)
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3931
!
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3932
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3933
indexOfLastRowShown
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3934
    "returns the index of the last shown row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3935
2797
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3936
    |idx|
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3937
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3938
    idx := (viewOrigin y + height - 1 // rowHeight) + 1.
9f171595edcc indexOfLastVisibleItem
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
  3939
    ^ (idx min:list size)
563
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  3940
!
826871ce82c9 bug fix:
ca
parents: 561
diff changeset
  3941
1805
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  3942
isEnabled
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  3943
    ^ enableChannel value ~~ false
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  3944
!
66792febb315 add enableChannel
tm
parents: 1778
diff changeset
  3945
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3946
isRowSelectable:aRowNumber
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3947
    "returne true if a row number is selectable"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3948
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3949
    (aRowNumber notNil and:[ aRowNumber ~~ 0 ]) ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3950
        selectConditionBlock isNil ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3951
            ^ true
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3952
        ].
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3953
        ^ (selectConditionBlock value:aRowNumber)
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3954
    ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3955
    ^ false
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3956
!
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  3957
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3958
numberOfColumns
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3959
    "returns number of columns"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3960
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3961
    ^ columnDescriptors size
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3962
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3963
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3964
numberOfRows
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3965
    "returns number of rows"
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3966
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  3967
    ^ list size
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3968
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3969
    "Modified (comment): / 15-03-2018 / 12:23:01 / mawalch"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3970
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3971
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3972
rowHeight
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3973
    "get the height of the highest row in pixels"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3974
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3975
    ^ rowHeight
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3976
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3977
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3978
separatorSize
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3979
    "returns vertical/horizontal size of a separator dependent on the
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3980
     3D effect."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3981
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  3982
    ^ separatorSize
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3983
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3984
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3985
size
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3986
    "returns number of rows"
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3987
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3988
    ^ list size
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3989
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  3990
    "Modified (comment): / 15-03-2018 / 12:24:18 / mawalch"
4486
3407ac48b630 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4459
diff changeset
  3991
!
3407ac48b630 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4459
diff changeset
  3992
3407ac48b630 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4459
diff changeset
  3993
yVisibleToLineNr:yVisible
3407ac48b630 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4459
diff changeset
  3994
    ^ self yVisibleToRowNr:yVisible.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3995
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3996
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3997
!DSVColumnView methodsFor:'recomputation'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  3998
5952
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  3999
computePreferredExtent
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4000
    "return my preferred extent"
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4001
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4002
    |numRows prefWidth prefHeight|
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4003
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4004
    cachedPreferredExtent notNil ifTrue:[
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4005
        ^ cachedPreferredExtent
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4006
    ].
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4007
    self computeRowHeight.
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4008
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4009
    prefWidth := (columnDescriptors size - 1) max:0.  "/ for the separators
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4010
    columnDescriptors do:[:aCol |
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4011
        prefWidth := prefWidth + (aCol minWidth max:5).
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4012
    ].
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4013
    numRows := list size.
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4014
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4015
    "/ no need for a separator after the last row.
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4016
    prefHeight := separatorSize + ((numRows * rowHeight) "- separatorSize") "+ separatorSize".
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4017
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4018
    cachedPreferredExtent := prefWidth @ prefHeight.
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4019
    ^ cachedPreferredExtent
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4020
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4021
    "Created: / 09-11-2018 / 19:50:03 / Claus Gittinger"
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4022
!
059e5ddd60f3 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5902
diff changeset
  4023
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4024
computeRowHeight
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4025
    |minHeight|
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4026
5603
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  4027
    minHeight := self font height.
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4028
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4029
    columnDescriptors do:[:aCol |
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4030
        minHeight := (aCol heightOfHighestRow) max:minHeight.
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4031
    ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4032
5603
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  4033
    "/ to fix a double bug which compensated for not computing things correctly
5730
dcaa2eb5a14b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  4034
    "/ (verticalSpacing was always computed as 2 into the height, even if changed later,
5603
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  4035
    "/  it was stil in the max-of-col-heights, because minHeight was never reset, but always
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  4036
    "/  carried on in the minRowHeight)
974a4c6a7656 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5602
diff changeset
  4037
    minHeight := 2 + minHeight + 2.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4038
5602
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4039
    rowHeight := (verticalSpacing + minHeight + verticalSpacing + separatorSize).
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4040
    minRowHeight := rowHeight.
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4041
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4042
    "Created: / 13-09-2017 / 15:32:28 / cg"
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4043
!
3ac5c652c19e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5563
diff changeset
  4044
647
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4045
hasPreferredExtent
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4046
    "returns true if preferred extent is accumulated"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4047
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4048
    ^ cachedPreferredExtent notNil
647
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4049
!
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4050
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4051
preferredExtentChanged
3519
9102be1f145c fix typo in comment
Stefan Vogel <sv@exept.de>
parents: 3518
diff changeset
  4052
    "called if the preferred extent changed"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4053
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4054
    |x "{ Class:SmallInteger }"
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4055
     y "{ Class:SmallInteger }"|
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4056
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4057
    y := viewOrigin y.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4058
    x := viewOrigin x.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4059
    (y ~~ 0 or:[ x ~~ 0 ]) ifTrue:[
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4060
        self originWillChange.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4061
        viewOrigin := 0 @ 0.
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4062
        cachedPreferredExtent := nil.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4063
        self originChanged:(x negated @ y negated).
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4064
    ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4065
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4066
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4067
recomputeHeightOfContents
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4068
    "recompute height of contents( scrolling )"
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4069
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4070
    cachedPreferredExtent := nil.
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4071
"/    cachedPreferredExtent notNil ifTrue:[
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4072
"/        cachedPreferredExtent y:(rowHeight * list size)
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4073
"/    ] ifFalse:[
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4074
"/        self preferredExtent
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4075
"/    ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4076
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4077
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4078
!DSVColumnView methodsFor:'scroller interface'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4079
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4080
innerHeight
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4081
    "returns the inner height of the contents shown"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4082
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4083
    ^ height - margin - margin
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4084
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4085
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4086
verticalScrollStep
3500
d2adfa92fa6d comment
Claus Gittinger <cg@exept.de>
parents: 3494
diff changeset
  4087
    "return the amount to scroll when stepping up/down (also used for mouseWheel)."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4088
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4089
    ^ rowHeight
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4090
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4091
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4092
viewOrigin
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4093
    "return the viewOrigin;
5252
06aa7602b274 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5214
diff changeset
  4094
     that's the coordinate of the contents which is shown topLeft in the view."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4095
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4096
    ^ viewOrigin
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4097
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4098
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4099
widthOfContents
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4100
    "return the width of the contents in pixels"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4101
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4102
    cachedPreferredExtent isNil ifTrue:[
647
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4103
        self preferredExtent
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4104
    ].
3488
d30da03147fe preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3478
diff changeset
  4105
    ^ cachedPreferredExtent x
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4106
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4107
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4108
xOriginOfContents
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4109
    "return the horizontal origin of the contents in pixels"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4110
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4111
    ^ viewOrigin x
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4112
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4113
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4114
yOriginOfContents
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4115
    "return the vertical origin of the contents in pixels"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4116
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4117
    ^ viewOrigin y
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4118
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4119
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4120
!DSVColumnView methodsFor:'scrolling'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4121
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4122
scrollTo:anOrigin redraw:doRedraw
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4123
    "change origin to have newOrigin be visible at the top-left."
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4124
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4125
    |newOrg dltOrg wg
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4126
     h       "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4127
     w       "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4128
     x       "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4129
     x0      "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4130
     x1      "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4131
     y       "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4132
     y0      "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4133
     y1      "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4134
     dX      "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4135
     dY      "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4136
     innerHG "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4137
     innerWT "{ Class:SmallInteger }"
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4138
     lMargin
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4139
    |
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4140
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4141
    shown ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4142
        ^ self
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4143
    ].
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  4144
1448
b389b8c76479 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  4145
    (wg := self windowGroup) notNil ifTrue:[
b389b8c76479 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  4146
        wg processRealExposeEventsFor:self.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4147
    ].
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  4148
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4149
    innerWT := self innerWidth.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4150
    innerHG := self innerHeight.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4151
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4152
    h := viewOrigin y.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4153
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4154
    (y := anOrigin y) > h ifTrue:[              "/ end of contents
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4155
        y > (dY := self maxViewOriginY) ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4156
            y := dY max:h
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4157
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4158
    ] ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4159
        y := y max:0.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4160
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4161
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4162
    (x := anOrigin x) > 0 ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4163
        x := x min:(self widthOfContents - innerWT).
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4164
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4165
    x      := x max:0.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4166
    newOrg := (x @ y).
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4167
    dltOrg := newOrg - viewOrigin.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4168
    dX     := dltOrg x.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4169
    dY     := dltOrg y.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4170
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4171
    (dX == 0 and:[dY == 0]) ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4172
        ^ self
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4173
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4174
    self originWillChange.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4175
    viewOrigin := newOrg.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4176
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4177
    doRedraw ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4178
        ^ self originChanged:dltOrg
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4179
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4180
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4181
    dY ~~ 0 ifTrue:[                            "/ SCROLL VERTICAL
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4182
        dY := dY abs.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4183
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4184
        (dX ~~ 0 or:[innerHG - dY < 20]) ifTrue:[
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  4185
            self invalidate.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4186
        ] ifFalse:[                             "/ COPY VERTICAL
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4187
            y0 := y1 := margin + dY.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4188
            h  := innerHG - dY.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4189
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4190
            dltOrg y < 0 ifTrue:[y0 := margin. y := y0]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4191
                        ifFalse:[y1 := margin. y := y1 + h].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4192
1460
2fe0ac4bc4d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
  4193
            self copyFrom:self x:margin y:y0 toX:margin y:y1 width:innerWT height:h async:false.
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  4194
            self invalidateX:margin y:y width:innerWT height:(innerHG - h).
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4195
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4196
    ] ifFalse:[                                 "/ SCROLL HORIZONTAL
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4197
        dX := dX abs.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4198
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4199
        innerWT - dX < 20 ifTrue:[
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  4200
            labelView invalidate.
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  4201
            self invalidate.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4202
        ] ifFalse:[                             "/ COPY HORIZONTAL
643
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  4203
            x0 := x1 := dX + margin.
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4204
            w  := width - dX.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4205
            lMargin := labelView margin.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4206
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4207
            dltOrg x < 0 ifTrue:[
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4208
                " ->"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4209
                x0 := x := margin.
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4210
                self copyFrom:self x:margin y:margin toX:margin+dX y:margin width:innerWT-dX height:innerHG async:false.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4211
                self invalidateX:margin y:margin width:dX height:innerHG.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4212
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4213
                labelView notNil ifTrue:[
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4214
                    labelView copyFrom:labelView x:lMargin y:lMargin toX:lMargin+dX y:lMargin width:labelView innerWidth-dX height:labelView innerHeight async:false.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4215
                    labelView invalidateX:lMargin y:lMargin width:dX height:labelView innerHeight.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4216
                ].
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4217
            ] ifFalse:[
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4218
                x1 := margin. x := w.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4219
                self copyFrom:self x:margin+dX y:margin toX:margin y:margin width:innerWT-dX height:innerHG async:false.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4220
                self invalidateX:width-margin-dX y:margin width:dX height:innerHG.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4221
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4222
                labelView notNil ifTrue:[
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4223
                    labelView copyFrom:labelView x:lMargin+dX y:lMargin toX:lMargin y:lMargin width:labelView innerWidth-dX height:labelView innerHeight async:false.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4224
                    labelView invalidateX:labelView width-lMargin-dX y:lMargin width:dX height:labelView innerHeight.
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4225
                ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  4226
            ].
2146
4ae1ec9f5307 level fixes;
penk
parents: 2125
diff changeset
  4227
            labelView repairDamage.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4228
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4229
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4230
    self originChanged:dltOrg.
1123
ea32a2e3d44d care for sensor becoming nil while handling exposeEvents
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  4231
2458
0411397ef0a2 readraw after scroll: process expose events.
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  4232
    wg notNil ifTrue:[
0411397ef0a2 readraw after scroll: process expose events.
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  4233
        wg processRealExposeEventsFor:self.
0411397ef0a2 readraw after scroll: process expose events.
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  4234
    ].
0411397ef0a2 readraw after scroll: process expose events.
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  4235
1123
ea32a2e3d44d care for sensor becoming nil while handling exposeEvents
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  4236
    "Modified: / 7.9.1998 / 16:39:49 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4237
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4238
2728
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  4239
scrollToLine:aLineNr
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  4240
    "for compat. with listViews"
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  4241
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  4242
    self scrollToRowAt:aLineNr colAt:1.
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  4243
!
a53382733524 +scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents: 2722
diff changeset
  4244
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4245
scrollToRowAt:aRowNr colAt:aColNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4246
    "make row at a row number in column at a column number visible"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4247
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4248
    |x  "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4249
     y  "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4250
     l  "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4251
     dY "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4252
     dX "{ Class:SmallInteger }"
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4253
    |
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4254
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4255
    (    (aRowNr between:1 and:(list size))
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4256
     and:[aColNr between:0 and:(columnDescriptors size)]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4257
    ) ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4258
        ^ self
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4259
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4260
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4261
    dY := dX := 0.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4262
    y  := self yVisibleOfRowNr:aRowNr.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4263
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4264
    y < margin ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4265
        dY := margin - y.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4266
    ] ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4267
        y := y + rowHeight.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4268
        l := height - margin.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4269
        y > l ifTrue:[dY := l - y]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4270
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4271
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4272
    aColNr == 0 ifTrue:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4273
        dY == 0 ifTrue:[^ self].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4274
        dX := 0.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4275
    ] ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4276
        x  := self xVisibleOfColNr:aColNr.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4277
1163
f46f69609c53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1149
diff changeset
  4278
        x <= margin ifTrue:[
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4279
            dX := margin - x
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4280
        ] ifFalse:[
1497
d9b55a308c9e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
  4281
            x := x + (columnDescriptors at:aColNr) width.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4282
            l := width - margin.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4283
            x > l ifTrue:[dX := l - x]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4284
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4285
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4286
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4287
    (dX == 0 and:[dY == 0]) ifFalse:[
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4288
        self scrollTo:(viewOrigin - (dX @ dY)).
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4289
    ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4290
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4291
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4292
scrollToSelection
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4293
    "make selection visible"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4294
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4295
    |rowNr|
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4296
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4297
    (rowNr := self firstIndexSelected) ~~ 0 ifTrue:[
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4298
        self scrollToRowAt:rowNr colAt:self selectedColIndex
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4299
    ]
1506
4935ddbc8f6e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  4300
!
4935ddbc8f6e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  4301
4935ddbc8f6e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  4302
scrollVerticalTo:aPixelOffset
4935ddbc8f6e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  4303
    "change origin to make aPixelOffset be the top line"
4935ddbc8f6e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  4304
4935ddbc8f6e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  4305
    |orgX orgY|
4935ddbc8f6e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  4306
4935ddbc8f6e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  4307
    orgX := viewOrigin x.
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4308
    scrollRowWise ifTrue:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4309
        orgY := (aPixelOffset + rowHeight - 1) // rowHeight * rowHeight.
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4310
    ] ifFalse:[
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4311
        orgY := aPixelOffset.
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4312
    ].
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4313
    ^ self scrollTo:(orgX @ orgY).
1749
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4314
!
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4315
2670
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4316
startAutoScroll:aSelectorOrBlock distance:aDistance
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4317
    "setup for auto-scroll (when button-press-moving below/above view);
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4318
     - timeDelta for scroll is computed from distance"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4319
2670
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4320
    |timeDelta scrollBlock|
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4321
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4322
    autoScroll ifFalse:[
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4323
        self stopAutoScroll.
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4324
        ^ self
1749
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4325
    ].
2670
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4326
1749
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4327
    autoScrollBlock notNil ifTrue:[
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4328
        Processor removeTimedBlock:autoScrollBlock.
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4329
    ] ifFalse:[
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4330
        self compressMotionEvents:false.
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4331
    ].
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4332
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4333
    timeDelta := 0.5 / (aDistance abs).
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4334
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4335
    scrollBlock :=
2670
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4336
        [
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4337
            aSelectorOrBlock isSymbol ifTrue:[
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4338
                self perform:aSelectorOrBlock.
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4339
            ] ifFalse:[
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4340
                aSelectorOrBlock value
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4341
            ].
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4342
            autoScrollBlock notNil ifTrue:[
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4343
                Processor addTimedBlock:autoScrollBlock afterSeconds:timeDelta.
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4344
            ]
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4345
        ].
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4346
27dacfff1d6d autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
  4347
    autoScrollBlock := [self sensor pushUserEvent:#value for:scrollBlock].
1749
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4348
    Processor addTimedBlock:autoScrollBlock afterSeconds:timeDelta.
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4349
!
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4350
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4351
stopAutoScroll
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4352
    "stop any autoScroll"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4353
1749
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4354
    autoScrollBlock notNil ifTrue:[
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4355
        Processor removeTimedBlock:autoScrollBlock.
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4356
        autoScrollBlock := nil.
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4357
        self compressMotionEvents:true.
e78e17ead1ce support of auto scrolling
ca
parents: 1722
diff changeset
  4358
    ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4359
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4360
3382
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4361
!DSVColumnView methodsFor:'searching'!
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4362
5347
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4363
findFirstColumnWithStringFrom:start to:stop
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4364
    start to:stop do:[:eachNr|
5347
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4365
        |row lbl|
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4366
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4367
        row := self at:eachNr.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4368
        columnDescriptors keysAndValuesDo:[:colNr :col |
5347
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4369
            lbl := col shownValueForRow:row rowNr:eachNr.
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4370
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4371
            lbl isNonByteCollection ifTrue:[
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4372
                lbl := lbl isEmpty ifTrue:[nil] ifFalse:[lbl first].
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4373
            ].
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4374
            (lbl respondsTo:#string) ifTrue:[
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4375
                lbl := lbl string.
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4376
            ].
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4377
            (lbl size ~~ 0 and:[(lbl at:1) isCharacter]) ifTrue:[
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4378
                ^ colNr
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4379
            ]
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4380
        ]
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4381
    ].
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4382
    ^ nil
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4383
!
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4384
3382
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4385
findFirstRowWithString: aString from:start to:stop by: step ignoreCase:ignoreCase
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4386
    "Return the rowNr from the first row that matches aString.
5347
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4387
     The search is performed between the start and stop row numbers and incrementing by a step"
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4388
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4389
    |stringToMatch|
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4390
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4391
    aString isEmptyOrNil ifTrue:[
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4392
        ^ self
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4393
    ].
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4394
    stringToMatch := '*', aString, '*'.
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4395
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4396
    start to:stop by:step do:[:rowNr|
5347
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4397
        |row lbl|
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4398
3382
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4399
        row := self at:rowNr.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4400
        columnDescriptors keysAndValuesDo:[:colNr :col |
3382
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4401
            lbl := col shownValueForRow:row rowNr:rowNr.
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4402
5347
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4403
            lbl isNonByteCollection ifTrue:[
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4404
                lbl := lbl isEmpty ifTrue:[nil] ifFalse:[lbl first].
3382
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4405
            ].
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4406
            (lbl respondsTo:#string) ifTrue:[
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4407
                lbl := lbl string.
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4408
            ].
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4409
            lbl isNumber ifTrue:[
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4410
                lbl := lbl printString.
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4411
            ].
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4412
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4413
            (lbl size ~~ 0
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4414
                and:[(lbl at:1) isCharacter
5347
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4415
                and:[stringToMatch match:lbl caseSensitive:ignoreCase not
4359
bb6d48846f0d class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4333
diff changeset
  4416
            ]]) ifTrue:[
3382
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4417
                ^ rowNr
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4418
            ]
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4419
        ]
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4420
    ].
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4421
    ^ nil
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4422
!
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4423
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4424
findFirstRowWithString: aString from:start to:stop ignoreCase:ignoreCase
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4425
    "Return the rowNr from the first row that matches aString.
5347
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4426
     The search is performed between the start and stop row numbers"
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4427
e0b26e38ee0f #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5310
diff changeset
  4428
    ^ self findFirstRowWithString:aString from:start to:stop by:1 ignoreCase:ignoreCase
3382
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4429
! !
a812cae515a5 add #findFirstRowWithString:from:to:ignoreCase:
fm
parents: 3302
diff changeset
  4430
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4431
!DSVColumnView methodsFor:'selection'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4432
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4433
addRowToSelection:aRowNr
2370
8d1fadf4e4f6 #addRowToSelection: omit redraws
ca
parents: 2363
diff changeset
  4434
    "add a row to the selection
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4435
     if a column is selected, the column will be closed"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4436
2370
8d1fadf4e4f6 #addRowToSelection: omit redraws
ca
parents: 2363
diff changeset
  4437
    |newSelection|
8d1fadf4e4f6 #addRowToSelection: omit redraws
ca
parents: 2363
diff changeset
  4438
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  4439
    (self isRowSelectable:aRowNr) ifFalse:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  4440
        ^ self
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  4441
    ].
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4442
    self numberOfSelections == 0 ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4443
        self selectColIndex:0 rowIndex:aRowNr.
2370
8d1fadf4e4f6 #addRowToSelection: omit redraws
ca
parents: 2363
diff changeset
  4444
        ^ self
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4445
    ].
2907
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  4446
    (self isInSelection:aRowNr) ifTrue:[
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  4447
        ^ self
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  4448
    ].
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4449
    multipleSelectOk ifFalse:[
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4450
        self selectColIndex:0 rowIndex:aRowNr.
2370
8d1fadf4e4f6 #addRowToSelection: omit redraws
ca
parents: 2363
diff changeset
  4451
        ^ self
8d1fadf4e4f6 #addRowToSelection: omit redraws
ca
parents: 2363
diff changeset
  4452
    ].
2371
2bc91b1b59a5 bugfix when adding to selection
ca
parents: 2370
diff changeset
  4453
    newSelection := selectedRowIndex copyWith:aRowNr.
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4454
    self selectedColIndex ~~ 0 ifTrue:[
2370
8d1fadf4e4f6 #addRowToSelection: omit redraws
ca
parents: 2363
diff changeset
  4455
        self selectColIndex:0 rowIndex:newSelection.
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4456
    ] ifFalse:[
2907
c4a8cac87053 ctrl-select fixed
Claus Gittinger <cg@exept.de>
parents: 2886
diff changeset
  4457
        selectedRowIndex := newSelection.
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4458
        self invalidateRowAt:aRowNr.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4459
        self selectionChanged.
2370
8d1fadf4e4f6 #addRowToSelection: omit redraws
ca
parents: 2363
diff changeset
  4460
    ].
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4461
!
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4462
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4463
deselect
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4464
    self selectColIndex:0 rowIndex:0
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4465
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4466
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4467
firstIndexSelected
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4468
    "returns index of first row selected or 0"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4469
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4470
    multipleSelectOk ifFalse:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4471
        ^ selectedRowIndex
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4472
    ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4473
    selectedRowIndex size ~~ 0 ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4474
        ^ selectedRowIndex at:1
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4475
    ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4476
    ^ 0
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4477
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4478
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  4479
forceAcceptInEditor
2722
18c5bd340b1b close editor when clicking outside
ca
parents: 2714
diff changeset
  4480
    editView notNil ifTrue:[
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4481
        editView isDialogBox ifFalse:[
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4482
            editView
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4483
                allSubViewsDo:[:aSubView |
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4484
                    (aSubView respondsTo:#accept) ifTrue:[
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4485
                        aSubView accept
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4486
                    ].
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4487
                ]
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4488
        ]
2722
18c5bd340b1b close editor when clicking outside
ca
parents: 2714
diff changeset
  4489
    ]
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4490
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4491
    "Modified: / 23-04-2019 / 19:17:04 / Claus Gittinger"
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  4492
!
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  4493
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  4494
hasRowSelection
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  4495
    "returns true if a selection exists, and its a complete row
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4496
     (as opposed to either no selection, or a columnSelection)"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4497
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4498
    ^ self hasSelection and:[ self selectedColIndex == 0 ]
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  4499
!
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2146
diff changeset
  4500
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4501
hasSelection
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4502
    "returns true if a selection exists"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4503
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4504
    ^ self numberOfSelections ~~ 0
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4505
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4506
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4507
isInSelection:aRowNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4508
    "returns true, if row, aRowNr is in the selection"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4509
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4510
    aRowNr ~~ 0 ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4511
        multipleSelectOk ifFalse:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4512
            ^ aRowNr == selectedRowIndex
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4513
        ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4514
        selectedRowIndex size ~~ 0 ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4515
            ^ selectedRowIndex includes:aRowNr
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4516
        ]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4517
    ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4518
    ^ false
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4519
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4520
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4521
isRowSelected:aRowNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4522
    "returns true, if row is in the selection"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4523
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4524
    self selectedColIndex == 0 ifTrue:[
647
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4525
        ^ self isInSelection:aRowNr
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4526
    ].
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4527
    ^ false
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4528
!
ee98a1976972 support of different styles
ca
parents: 645
diff changeset
  4529
2263
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4530
isRowVisible:aRowNr
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4531
    |y h|
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4532
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4533
    h := rowHeight.
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4534
    y := self yVisibleOfRowNr:aRowNr.
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4535
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4536
    y < margin ifTrue:[
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4537
        (h := h + y) <= margin ifTrue:[
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4538
            ^ false
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4539
        ].
2263
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4540
    ] ifFalse:[
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4541
        y >= (height-margin) ifTrue:[^ false].
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4542
    ].
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4543
    ^ true
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4544
!
e7648d72264f + #isRowVisible
penk
parents: 2247
diff changeset
  4545
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4546
isSelected:aRowNr inColumn:aColNr
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  4547
    "returns true if cell in a row; a row number, in a column, a column
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4548
     number is selected."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4549
1042
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
  4550
    multipleSelectOk ifFalse:[
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
  4551
        aRowNr ~~ selectedRowIndex ifTrue:[
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
  4552
            ^ false
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
  4553
        ]
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
  4554
    ] ifTrue:[
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4555
        (selectedRowIndex size ~~ 0 and:[ selectedRowIndex includes:aRowNr ]) ifFalse:[
1042
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
  4556
            ^ false
b2b27ac9a550 change rowSelector icon;
ca
parents: 1034
diff changeset
  4557
        ]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4558
    ].
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4559
    ^ (self selectedColIndex == 0 or:[ self selectedColIndex == aColNr ])
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4560
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4561
2276
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4562
isSelectionVisibleIn:anExtentPoint
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4563
    self selectionIndicesDo:[:selRowNr |
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4564
        |y|
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4565
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4566
        y := self yVisibleOfRowNr:selRowNr.
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4567
        (y between:margin and:(anExtentPoint y - margin)) ifTrue:[^ true].
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4568
    ].
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4569
    ^ false.
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4570
!
19de72502874 dont make selection visible after resize, if it was not visible before
ca
parents: 2263
diff changeset
  4571
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4572
lastIndexSelected
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4573
    "returns index of last selected row or 0"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4574
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4575
    multipleSelectOk ifFalse:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4576
        ^ selectedRowIndex
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4577
    ].
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4578
    selectedRowIndex size ~~ 0 ifTrue:[
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4579
        ^ selectedRowIndex last
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4580
    ].
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4581
    ^ 0
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4582
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4583
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4584
makeLineVisible:aLine
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4585
    "scroll to make aLine visible"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4586
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4587
    |colNr|
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4588
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4589
    aLine == 0 ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4590
        ^ self
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4591
    ].
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4592
    (self isRowVisible:aLine) ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4593
        ^ self
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4594
    ].
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4595
    (self selectedColIndex notNil and:[ self selectedColIndex ~~ 0 ]) ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4596
        colNr := self selectedColIndex
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4597
    ] ifFalse:[ colNr := 1 ].
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4598
    self scrollToRowAt:aLine colAt:colNr
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4599
!
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4600
2246
5d59b5e2e00c makeSelectionVisible after #sizeChanged:
ca
parents: 2237
diff changeset
  4601
makeSelectionVisible
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4602
    "scroll to make the selection line visible"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4603
2246
5d59b5e2e00c makeSelectionVisible after #sizeChanged:
ca
parents: 2237
diff changeset
  4604
    |rowNr colNr|
5d59b5e2e00c makeSelectionVisible after #sizeChanged:
ca
parents: 2237
diff changeset
  4605
5d59b5e2e00c makeSelectionVisible after #sizeChanged:
ca
parents: 2237
diff changeset
  4606
    rowNr := self firstIndexSelected.
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4607
    rowNr == 0 ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4608
        ^ self
2246
5d59b5e2e00c makeSelectionVisible after #sizeChanged:
ca
parents: 2237
diff changeset
  4609
    ].
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4610
    (self selectedColIndex notNil and:[ self selectedColIndex ~~ 0 ]) ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4611
        colNr := self selectedColIndex
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4612
    ] ifFalse:[ colNr := 1 ].
2246
5d59b5e2e00c makeSelectionVisible after #sizeChanged:
ca
parents: 2237
diff changeset
  4613
    self scrollToRowAt:rowNr colAt:colNr
5d59b5e2e00c makeSelectionVisible after #sizeChanged:
ca
parents: 2237
diff changeset
  4614
!
5d59b5e2e00c makeSelectionVisible after #sizeChanged:
ca
parents: 2237
diff changeset
  4615
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4616
maxIndexSelected
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4617
    "return the largest index selected or 0"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4618
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4619
    multipleSelectOk ifFalse:[
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4620
        ^ selectedRowIndex
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4621
    ].
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4622
    selectedRowIndex size ~~ 0 ifTrue:[
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4623
        ^ selectedRowIndex max
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4624
    ].
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4625
    ^ 0
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4626
!
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4627
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4628
minIndexSelected
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4629
    "return the smallest index selected or 0"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4630
2363
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4631
    multipleSelectOk ifFalse:[
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4632
        ^ selectedRowIndex
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4633
    ].
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4634
    selectedRowIndex size ~~ 0 ifTrue:[
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4635
        ^ selectedRowIndex min
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4636
    ].
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4637
    ^ 0
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4638
!
72cda227e48d shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4639
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4640
numberOfSelections
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4641
    "return the number of selected rows"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4642
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4643
    multipleSelectOk ifFalse:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4644
        ^ selectedRowIndex ~~ 0 ifTrue:[1] ifFalse:[0]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4645
    ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4646
    ^ selectedRowIndex size
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4647
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4648
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4649
openEditorOnSelection
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4650
     |colIdx column rowIdx editorAndModel winGroup
3770
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  4651
      editor filter keyBrdFwd selColor|
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4652
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4653
    (shown and:[editView isNil]) ifFalse:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4654
        ^ self
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4655
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4656
    winGroup := self windowGroup.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4657
    winGroup isNil ifTrue:[^ self ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4658
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4659
    colIdx := self selectedColIndex ? 0.
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4660
    column := self columnDescriptorAt:colIdx.
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4661
    column isNil ifTrue:[^ self].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4662
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4663
    rowIdx := self selectedRowIndex ? 0.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4664
    rowIdx == 0 ifTrue:[^ self ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4665
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4666
    rowIdx isSequenceable ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4667
        rowIdx := rowIdx at:1 ifAbsent:[ ^ self ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4668
    ].
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4669
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4670
    editorAndModel := column editorForRowAt:rowIdx.
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4671
    editorAndModel isNil ifTrue:[^ self].
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4672
    
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4673
    editor := editorAndModel editor.
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4674
    editor isDialogBox ifTrue:[
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4675
        editor open.
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4676
        editor accepted ifTrue:[
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4677
            "/ editorAndModel acceptAction value:nil.
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4678
        ].
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4679
        editView := editor.
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4680
        didEditWithDialog := true.
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4681
        ^ self
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4682
    ].    
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4683
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4684
    autoScrollToColumn == true ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4685
        self scrollToRowAt:rowIdx colAt:colIdx.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4686
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4687
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4688
    editView := SimpleView
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4689
                extent:((column width - (2 * separatorSize))
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4690
                        @ (rowHeight - (2 * separatorSize)))
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4691
                in:self.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4692
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4693
    self updateEditViewOrigin.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4694
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4695
    (column containsText or:[ column showSelectionHighLighted not ]) ifTrue:[
3149
66df7168e377 bug fix
ca
parents: 3141
diff changeset
  4696
        selColor := (column backgroundColorAt:rowIdx)
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4697
    ] ifFalse:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4698
        selColor := selectionBackgroundColor
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4699
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4700
    editView viewBackground:selectionBackgroundColor.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4701
3770
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  4702
    editView add:editor.
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4703
    editorAndModel editorNeedsCursorKeys ifTrue:[
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4704
        editorAndModel editorNeedsReturnKey ifTrue:[
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4705
            "/ only steal TAB from the editor
4176
915f6fa47e09 class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
  4706
            filter := [:aKey | #( #Tab #NonInsertingTab #BackTab ) includes:aKey ]
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4707
        ] ifFalse:[
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4708
            "/ steal TAB and RETURN from the editor
4176
915f6fa47e09 class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
  4709
            filter := [:aKey | #( #Tab #NonInsertingTab #BackTab #Return ) includes:aKey ]
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4710
        ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4711
    ] ifFalse:[
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4712
        editorAndModel editorNeedsReturnKey ifTrue:[
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4713
            "/ only steal TAB and Curosr Keys from the editor
4176
915f6fa47e09 class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
  4714
            filter := [:aKey | #( #Tab #NonInsertingTab #BackTab #CursorUp #CursorDown ) includes:aKey ]
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4715
        ] ifFalse:[
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4716
            "/ steal TAB, RETURN and Curosr Keys from the editor
4176
915f6fa47e09 class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
  4717
            filter := [:aKey | #( #Tab #NonInsertingTab #BackTab #CursorUp #CursorDown #Return ) includes:aKey ]
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4718
        ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4719
    ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4720
    keyBrdFwd := KeyboardForwarder
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4721
                toView:self
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4722
                condition:nil
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4723
                filter:filter.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4724
    editView
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4725
        withAllSubViewsDo:[:aView |
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4726
            aView delegate:keyBrdFwd.
4496
229bdd6b4754 class: DSVColumnView
Stefan Vogel <sv@exept.de>
parents: 4489
diff changeset
  4727
            aView font:self font.
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4728
        ].
3141
095e746ebc1d bug fix
ca
parents: 3140
diff changeset
  4729
3855
41653ef27914 changed: #openEditorOnSelection
Claus Gittinger <cg@exept.de>
parents: 3779
diff changeset
  4730
    (editValue := editorAndModel model) notNil ifTrue:[
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4731
        editValue addDependent:self.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4732
    ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4733
    editView realize.
3770
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  4734
    editor canTab:true.
3962
0b5f7e526d0f changed:
Claus Gittinger <cg@exept.de>
parents: 3961
diff changeset
  4735
3770
e24ada279c5e changed:
Claus Gittinger <cg@exept.de>
parents: 3757
diff changeset
  4736
    winGroup focusView:editor.
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4737
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4738
    self processAllExposeEvents.
3960
20b0047e59c6 +PreselectAllWhenOpeningEditor
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
  4739
3962
0b5f7e526d0f changed:
Claus Gittinger <cg@exept.de>
parents: 3961
diff changeset
  4740
    "Modified: / 02-11-2010 / 22:04:01 / cg"
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4741
    "Modified: / 23-04-2019 / 18:47:46 / Claus Gittinger"
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4742
!
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4743
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4744
processAllExposeEvents
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4745
    |sensor|
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4746
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4747
    sensor := self sensor.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4748
    [
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4749
        sensor hasExposeEventFor:nil
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4750
    ] whileTrue:[
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4751
        self windowGroup processExposeEvents
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4752
    ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4753
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4754
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4755
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4756
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4757
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4758
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4759
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4760
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4761
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4762
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4763
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4764
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4765
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4766
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4767
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4768
!
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4769
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4770
removeRowFromSelection:aRowNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4771
    "remove a row from the selection"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4772
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4773
    (self isInSelection:aRowNr) ifFalse:[^ self].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4774
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4775
    self numberOfSelections == 1 ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4776
        self deselect.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4777
    ] ifFalse:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4778
        selectedRowIndex := selectedRowIndex copyWithout:aRowNr.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4779
        self invalidateRowAt:aRowNr.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4780
        self selectionChanged.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4781
    ].
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4782
!
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4783
1947
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  4784
selectAllRows
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4785
    "select all"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4786
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  4787
    multipleSelectOk ifFalse:[^ self].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  4788
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  4789
    selectedRowIndex := (1 to:list size) select:[:idx| self isRowSelectable:idx ].
1947
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  4790
    self selectionChanged.
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  4791
    self invalidate.
1947
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  4792
!
1e11b36633b2 added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  4793
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4794
selectColIndex:aColNr rowIndex:aRowNr
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4795
    "change selection with notification"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4796
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4797
    self selectColIndex:aColNr rowIndex:aRowNr openEditor:true.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4798
!
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4799
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4800
selectColIndex:aColNr rowIndex:aRowNr openEditor:openEditor
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4801
    "change selection with notification"
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4802
5666
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  4803
    |oldCol oldRow|
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  4804
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  4805
    oldCol := self selectedColIndex.
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  4806
    oldRow := self selectedRowIndex.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4807
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4808
    self setSelectColIndex:aColNr rowIndex:aRowNr openEditor:openEditor.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4809
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4810
    (oldCol ~~ self selectedColIndex
5666
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  4811
    or:[oldRow ~= self selectedRowIndex
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  4812
    or:[ignoreReselect == false]]) ifTrue:[
3302
6725ecddd8e3 pass colNr down to selectionChanged
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  4813
        self selectionChanged:aColNr
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4814
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4815
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4816
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4817
selectRow:something
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4818
    "select a row"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4819
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4820
    ^ self selectedRowIndex:something
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4821
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4822
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4823
selectRowAt:rowNr colAt:colNr atPoint:aPoint
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4824
    self selectRowAt:rowNr colAt:colNr atPoint:aPoint openEditor:true.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4825
!
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4826
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4827
selectRowAt:rowNr colAt:colNr atPoint:aPoint openEditor:openEditor
4459
0fd01d06e0b4 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  4828
    |view p shouldClick editorType|
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4829
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4830
    view := editView.
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4831
    didEditWithDialog := false.
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4832
    self selectColIndex:colNr rowIndex:rowNr openEditor:openEditor.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4833
    openEditor ifFalse:[ ^ self ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4834
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4835
    didEditWithDialog ifTrue:[didEditWithDialog := false. ^ self].
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4836
    
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4837
    editView isNil ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4838
        "/ might be a reselection
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4839
        self openEditorOnSelection.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4840
        editView isNil ifTrue:[^ self].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4841
    ] ifFalse:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4842
        editView == view ifTrue:[^ self].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4843
    ].
5517
9acf3fa7e7a8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5447
diff changeset
  4844
    view := self detectViewAt:aPoint ignoreInvisible:false.
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  4845
4459
0fd01d06e0b4 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  4846
    shouldClick := true.
0fd01d06e0b4 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  4847
    "/ when PreselectAllWhenOpeningEditor is true, we should not click into
5902
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4848
    "/ the editor, as this could clear the selection.
4459
0fd01d06e0b4 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  4849
    "/ however, for non-text editors, it is a good idea to do so...
0fd01d06e0b4 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  4850
    PreselectAllWhenOpeningEditor == true ifTrue:[
0fd01d06e0b4 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  4851
        shouldClick := false.
5990
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4852
    ].
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4853
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4854
    editorType := self selectedColumn editorType.
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4855
    editorType == #ComboList ifTrue:[ 
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4856
        shouldClick := true 
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4857
    ] ifFalse:[
5902
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4858
        editorType == #ComboBox ifTrue:[ 
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4859
            "/ only click if clicked onto menu-pull button
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4860
            (view ~~ self and:[view notNil]) ifTrue:[
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4861
                |screenPoint comboSubView|
5990
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4862
5902
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4863
                screenPoint := device translatePoint:aPoint fromView:self toView:nil.
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4864
                comboSubView := device viewFromPoint:screenPoint.
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4865
                (comboSubView notNil and:[comboSubView isKindOf:Button]) ifTrue:[
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4866
                    shouldClick := true 
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4867
                ].    
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4868
            ].    
5990
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4869
        ] ifFalse:[
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4870
            editorType == #CheckToggle ifTrue:[ 
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4871
                shouldClick := true 
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4872
            ] ifFalse:[
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4873
                editorType == #RadioButton ifTrue:[ 
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4874
                    shouldClick := true 
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4875
                ] ifFalse:[
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4876
                    "/ TODO: more heuristics here...
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4877
                    "/ editorType == #RadioButton ifTrue:[ ].
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4878
                    (view isKindOf:ComboBoxButton) ifTrue:[
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4879
                        shouldClick := true 
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4880
                    ].
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4881
                ].
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4882
            ]
5902
1ad98b113571 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5896
diff changeset
  4883
        ].
5990
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4884
    ].
1c1e8ef4220b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5969
diff changeset
  4885
    
4459
0fd01d06e0b4 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  4886
    shouldClick ifTrue:[
2125
67e0f2c9ad4d event types are private to WindowEvent;
ca
parents: 2101
diff changeset
  4887
        "/ simulate clicking into the editor
4459
0fd01d06e0b4 class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  4888
        self breakPoint:#ca.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4889
        (view ~~ self and:[view notNil]) ifTrue:[
4991
ddee68d07788 device access
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
  4890
            p := device translatePoint:aPoint fromView:self toView:view.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4891
            self sensor
3960
20b0047e59c6 +PreselectAllWhenOpeningEditor
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
  4892
                    pushEvent:(WindowEvent   buttonPress:1 x:p x y:p y view:view);
20b0047e59c6 +PreselectAllWhenOpeningEditor
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
  4893
                    pushEvent:(WindowEvent buttonRelease:1 x:p x y:p y view:view).
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4894
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4895
"/        "/ a very special hack for radioButtons:
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4896
"/        "/ if the button is now on, all other cells must be turned off !!
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4897
"/        self selectedColumn editorType == #RadioButton ifTrue:[
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4898
"/            1 tolist size do:[:eachRowNr |
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4899
"/                eachRowNr ~~ rowNr ifTrue:[
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4900
"/                    self at:eachRowNr put:false
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4901
"/                ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4902
"/            ].
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4903
"/        ].
3960
20b0047e59c6 +PreselectAllWhenOpeningEditor
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
  4904
        ].
20b0047e59c6 +PreselectAllWhenOpeningEditor
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
  4905
    ].
20b0047e59c6 +PreselectAllWhenOpeningEditor
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
  4906
4073
14b8653c124f changed: #selectRowAt:colAt:atPoint:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  4907
    "Modified: / 07-09-2011 / 16:08:45 / cg"
5517
9acf3fa7e7a8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 5447
diff changeset
  4908
    "Modified: / 15-03-2017 / 21:09:54 / stefan"
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  4909
    "Modified: / 23-04-2019 / 19:17:11 / Claus Gittinger"
809
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4910
!
0206d997fe99 support styleSheet and set preferred extent for drawing
ca
parents: 765
diff changeset
  4911
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4912
selectRowFrom:start to:stop
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  4913
    |step oldSelection newSelection|
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4914
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4915
    start == stop ifTrue:[
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4916
        self selectColIndex:0 rowIndex:start.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4917
        ^ self
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4918
    ].
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  4919
    step := (start <= stop) ifTrue:1 ifFalse:-1.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4920
    newSelection := (start to:stop by:step)
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4921
                select:[:idx | self isRowSelectable:idx ].
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4922
    self selectedColIndex ~~ 0 ifTrue:[
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  4923
        self selectColIndex:0 rowIndex:newSelection.
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4924
        ^ self
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4925
    ].
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  4926
    oldSelection := selectedRowIndex ? #().
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  4927
    selectedRowIndex := newSelection.
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4928
    newSelection
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4929
        select:[:i | (oldSelection includes:i) not ]
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4930
        thenDo:[:i | self invalidateRowAt:i ].
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4931
    oldSelection
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4932
        select:[:i | (newSelection includes:i) not ]
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4933
        thenDo:[:i | self invalidateRowAt:i ].
2398
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4934
    self selectionChanged.
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4935
!
bea17c9648e4 *** empty log message ***
ca
parents: 2371
diff changeset
  4936
5969
fa2bd856b54d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5952
diff changeset
  4937
selectRowIndex:anInteger
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4938
    "set selection of rows"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4939
5969
fa2bd856b54d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5952
diff changeset
  4940
    self selectColIndex:self selectedColIndex rowIndex:anInteger
fa2bd856b54d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5952
diff changeset
  4941
fa2bd856b54d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5952
diff changeset
  4942
    "Modified (format): / 21-11-2018 / 20:08:26 / Claus Gittinger"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4943
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4944
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4945
selectedColIndex
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4946
    "returns selected column number or 0"
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4947
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4948
    ^ self selectedColIndexHolder value
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4949
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4950
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4951
selectedColumn
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4952
    "returns selected column or nil"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4953
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  4954
    ^ columnDescriptors at:self selectedColIndex ifAbsent:nil.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4955
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4956
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4957
selectedRow
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4958
    "returns the selected row (or collection if multiple selection) or nil"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4959
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4960
    multipleSelectOk ifFalse:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4961
        ^ self at:selectedRowIndex ifAbsent:nil
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4962
    ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4963
    selectedRowIndex size ~~ 0 ifTrue:[
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4964
        ^ selectedRowIndex collect:[:i | self at:i ]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4965
    ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4966
    ^ nil
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4967
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4968
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4969
selectedRow:something
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4970
    "select something"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4971
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  4972
    self selectedRowIndex:something
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4973
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4974
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4975
selectedRowIndex
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4976
    "returns selected row number or 0"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4977
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4978
    ^ selectedRowIndex
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4979
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4980
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4981
selectedRowIndex:rowOrCollectionOfRows
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  4982
    "set the row selection (single or multiple rows);
2816
7e36fce15001 return-key handling;
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
  4983
     does NOT change the selected column."
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4984
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  4985
    self selectColIndex:(self selectedColIndex) rowIndex:rowOrCollectionOfRows
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4986
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4987
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  4988
selectionChanged
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4989
    "selection has changed"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4990
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  4991
    self selectionChanged:nil
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  4992
!
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  4993
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  4994
selectionChanged:colNrOrNil
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  4995
    "selection has changed"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  4996
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  4997
    |val|
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  4998
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  4999
    model notNil ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  5000
        val := self selectedRowIndex copy.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  5001
        (model respondsTo:#selectionIndex:) ifTrue:[
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  5002
            model selectionIndex:val
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  5003
        ] ifFalse:[
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5004
            |newVal|
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5005
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5006
            newVal := (useIndex ifTrue:[val] ifFalse:[self selectedRow]).
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5007
            "/ must check here: valueHolder compares using identity to identify
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5008
            "/ changes. This would lead to an endless recursion....
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5009
            model value ~= newVal ifTrue:[
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5010
                model value:newVal
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  5011
            ]
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  5012
        ]
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  5013
    ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5014
    actionBlock notNil ifTrue:[
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5015
        colNrOrNil isNil ifTrue:[
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5016
            actionBlock valueWithOptionalArgument:(self selectedRowIndex)
3302
6725ecddd8e3 pass colNr down to selectionChanged
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  5017
        ] ifFalse:[
5708
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5018
            actionBlock valueWithOptionalArgument:(self selectedRowIndex) and:colNrOrNil
d477077d4990 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5680
diff changeset
  5019
        ].
3302
6725ecddd8e3 pass colNr down to selectionChanged
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  5020
    ]
6725ecddd8e3 pass colNr down to selectionChanged
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  5021
!
6725ecddd8e3 pass colNr down to selectionChanged
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  5022
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  5023
selectionIndicesDo:aOneArgBlock
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5024
    "evaluate block on each row selected; the argument to the row
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  5025
     is the index of the selected row"
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  5026
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5027
    multipleSelectOk ifFalse:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5028
        selectedRowIndex ~~ 0 ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5029
            aOneArgBlock value:selectedRowIndex
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5030
        ]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5031
    ] ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5032
        selectedRowIndex size ~~ 0 ifTrue:[
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  5033
            selectedRowIndex do:aOneArgBlock
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5034
        ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5035
    ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5036
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5037
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  5038
setSelectColIndex:colNrArg rowIndex:rowNrArg
2714
f0d55d0e204d categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  5039
    "change selection without notification"
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5040
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5041
    self setSelectColIndex:colNrArg rowIndex:rowNrArg openEditor:true
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5042
!
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5043
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5044
setSelectColIndex:colNrArg rowIndex:rowNrArg openEditor:openEditor
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5045
    "change selection without notification"
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5046
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  5047
    |rowNr colNr newCol oldCol oldRow sglSelRow oldSz winGroup|
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5048
5709
06971867c02d #BUGFIX by sr
sr
parents: 5708
diff changeset
  5049
    rowNr := self validateSelection:rowNrArg.
06971867c02d #BUGFIX by sr
sr
parents: 5708
diff changeset
  5050
    rowNr isNil ifTrue:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  5051
        rowNr := multipleSelectOk ifTrue:[#()] ifFalse:[0].
5709
06971867c02d #BUGFIX by sr
sr
parents: 5708
diff changeset
  5052
    ].
06971867c02d #BUGFIX by sr
sr
parents: 5708
diff changeset
  5053
2470
64aae46d9d4e code cleanup
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  5054
    colNr := colNrArg.
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5055
    rowNr == 0 ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5056
        colNr := 0.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5057
    ] ifFalse:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5058
        multipleSelectOk ifTrue:[
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5059
            (rowNr size == 1) ifFalse:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5060
                colNr := 0
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5061
            ]
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5062
        ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5063
    ].
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5064
    (colNr := colNr ? 0) ~~ 0 ifTrue:[
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  5065
        newCol := self columnDescriptorAt:colNr.
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5066
        newCol rendererType == #rowSelector ifTrue:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5067
            colNr := 0.
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5068
            newCol := nil
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5069
        ] ifFalse:[
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5070
            multipleSelectOk ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5071
                sglSelRow := rowNr at:1
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5072
            ] ifFalse:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5073
                sglSelRow := rowNr
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5074
            ].
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5075
            (newCol canSelect:sglSelRow) ifFalse:[
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5076
                newCol := nil.
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5077
                colNr := 0.
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  5078
                selectRowOnDefault ifFalse:[
3449
2ba8e55953aa some comments changed into reasonable english
Claus Gittinger <cg@exept.de>
parents: 3428
diff changeset
  5079
                    rowNr := multipleSelectOk ifTrue:[nil] ifFalse:[0]
1112
81f2a7f0afdc draw routines for interactors
ca
parents: 1111
diff changeset
  5080
                ]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5081
            ]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5082
        ]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5083
    ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5084
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5085
    (rowNr = selectedRowIndex and:[ colNr == self selectedColIndex ]) ifTrue:[
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  5086
        (editView notNil and:[editView isDialogBox]) ifTrue:[
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  5087
            editView := nil
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  5088
        ].
643
bfd44867347f adding: bug fix
ca
parents: 642
diff changeset
  5089
        ^ self
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5090
    ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5091
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5092
    "/ release old selection
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5093
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5094
    oldSz := self numberOfSelections.
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5095
    oldCol := self selectedColIndex.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5096
    oldRow := selectedRowIndex.
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  5097
    oldSz == 1 ifTrue:[
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5098
        multipleSelectOk ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5099
            oldRow := oldRow at:1
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5100
        ].
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5101
        self updateColumnFromEditValueAndDestroyEditView.
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  5102
    ].
5666
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  5103
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  5104
    (rowNr ~= selectedRowIndex
88930c01d31b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5664
diff changeset
  5105
    or:[ignoreReselect == false]) ifTrue:[
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5106
        selectedRowIndex := rowNr.
3302
6725ecddd8e3 pass colNr down to selectionChanged
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  5107
        self selectionChanged:colNr.
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5108
    ].
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5109
    self selectedColIndex:colNr.
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5110
    shown ifFalse:[ ^ self ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5111
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5112
    winGroup := self windowGroup.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5113
    winGroup isNil ifTrue:[^ self ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5114
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5115
    oldSz > 1 ifTrue:[
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5116
        "/ redraw old selection
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  5117
        oldRow do:[:aRowNr |
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5118
            "/ unselected if visible
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  5119
            self invalidateRowAt:aRowNr colAt:0
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  5120
        ]
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  5121
    ] ifFalse:[
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  5122
        oldSz == 1 ifTrue:[
1408
1cda0a4fb566 use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
  5123
            self invalidateRowAt:oldRow colAt:oldCol
618
6a79bf9b4cd3 support list with undefined rows
ca
parents: 612
diff changeset
  5124
        ]
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5125
    ].
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5126
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5127
    "/ show new selection
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5128
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5129
    newCol notNil ifTrue:[
3140
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5130
        openEditor ifTrue:[
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5131
            self openEditorOnSelection.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5132
            editView notNil ifTrue:[^ self].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5133
        ].
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5134
        self invalidateRowAt:sglSelRow colAt:colNr.
6f2bc099fb35 new selectionHandling - buttonPress
ca
parents: 3138
diff changeset
  5135
3130
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
  5136
        autoScrollToColumn == true ifTrue:[
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
  5137
            self scrollToRowAt:sglSelRow colAt:colNr.
30ac624dd866 added a hook to allow for autoScrollToColumn to be disabled.
Claus Gittinger <cg@exept.de>
parents: 3091
diff changeset
  5138
        ].
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  5139
    ] ifFalse:[
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5140
        self selectionIndicesDo:[:i | self invalidateRowAt:i colAt:0 ].
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  5141
        self scrollToRowAt:(self firstIndexSelected) colAt:0
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  5142
    ].
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  5143
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  5144
    self processAllExposeEvents.
612
af7786327bd4 add columnHolder
ca
parents: 610
diff changeset
  5145
4055
4373923243d3 comment/format in: #setSelectColIndex:rowIndex:openEditor:
Claus Gittinger <cg@exept.de>
parents: 4020
diff changeset
  5146
    "Modified: / 12-07-2011 / 14:22:42 / cg"
6043
8d87fa82b05d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
  5147
    "Modified: / 23-04-2019 / 19:30:50 / Claus Gittinger"
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5148
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5149
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5150
updateColumnFromEditValueAndDestroyEditView
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5151
    |edValue selCol selRow|
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5152
2960
1bb470bcdb64 colIndex as a holder;
fm
parents: 2958
diff changeset
  5153
    selCol := self selectedColIndex.
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5154
    selRow := selectedRowIndex.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5155
    editValue notNil ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5156
        editValue removeDependent:self
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5157
    ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5158
    editView notNil ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5159
        self forceAcceptInEditor
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5160
    ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5161
    editValue notNil ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5162
        edValue := editValue value.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5163
        edValue isSequenceable ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5164
            edValue size == 0 ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5165
                edValue := nil
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5166
            ] ifFalse:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5167
                edValue isString ifFalse:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5168
                    edValue := edValue select:[:el | el notNil ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5169
                    edValue size == 0 ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5170
                        edValue := nil
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5171
                    ]
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5172
                ]
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5173
            ]
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5174
        ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5175
        selRow isNumber ifFalse:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5176
            "/ ??? should we do ???:
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5177
            "/ selRow do:[:eachRow |
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5178
            "/     (self columnAt:selCol) at:eachRow put:edValue.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5179
            "/ ]
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5180
            selRow := selRow first
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5181
        ].
3504
7a480e6164ea refactored;
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  5182
        (self columnDescriptorAt:selCol) at:selRow put:edValue.
2695
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5183
        modifiedChannel notNil ifTrue:[
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5184
            modifiedChannel value:true
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5185
        ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5186
        editValue := nil
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5187
    ].
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5188
    self destroyEditView.
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5189
!
02d2039ec6a6 WO's changes
werner
parents: 2670
diff changeset
  5190
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5191
validateSelection:aSelection
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5192
    |newSel|
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5193
2733
7b5a0d80c4a8 Change by cg.
martin
parents: 2732
diff changeset
  5194
    (list size == 0 or:[aSelection isNil or:[aSelection == 0]]) ifTrue:[
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5195
        ^ multipleSelectOk ifFalse:[0] ifTrue:[nil]
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5196
    ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5197
2733
7b5a0d80c4a8 Change by cg.
martin
parents: 2732
diff changeset
  5198
    newSel := aSelection.
7b5a0d80c4a8 Change by cg.
martin
parents: 2732
diff changeset
  5199
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5200
    multipleSelectOk ifFalse:[
2732
0d3258f88f58 *** empty log message ***
martin
parents: 2730
diff changeset
  5201
        newSel isInteger ifFalse:[
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5202
            newSel := self identityIndexOfRow:aSelection.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5203
        ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5204
        ^ (self isRowSelectable:newSel) ifTrue:[newSel] ifFalse:[0].
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5205
    ].
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5206
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5207
    "multiple selection
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5208
    "
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5209
    aSelection size ~~ 0 ifTrue:[
2732
0d3258f88f58 *** empty log message ***
martin
parents: 2730
diff changeset
  5210
        aSelection first isInteger ifTrue:[
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5211
            newSel := aSelection select:[:idx| self isRowSelectable:idx ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5212
        ] ifFalse:[
5723
3019347d6f76 #REFACTORING by mawalch
mawalch
parents: 5719
diff changeset
  5213
            newSel := aSelection
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5214
                            collect:[:el| self identityIndexOfRow:el ]
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5215
                            thenSelect:[:idx| self isRowSelectable:idx ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5216
        ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5217
        newSel notEmpty ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5218
            ^ newSel
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5219
        ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5220
    ] ifFalse:[
2733
7b5a0d80c4a8 Change by cg.
martin
parents: 2732
diff changeset
  5221
        newSel isInteger ifFalse:[
7b5a0d80c4a8 Change by cg.
martin
parents: 2732
diff changeset
  5222
            newSel := self identityIndexOfRow:aSelection.
7b5a0d80c4a8 Change by cg.
martin
parents: 2732
diff changeset
  5223
        ].
7b5a0d80c4a8 Change by cg.
martin
parents: 2732
diff changeset
  5224
        (self isRowSelectable:newSel) ifTrue:[
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5225
            ^ Array with:newSel
2733
7b5a0d80c4a8 Change by cg.
martin
parents: 2732
diff changeset
  5226
        ]
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 596
diff changeset
  5227
    ].
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2593
diff changeset
  5228
    ^ nil
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5229
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5230
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5231
!DSVColumnView class methodsFor:'documentation'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5232
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5233
version
4794
73a3ffcaf58c class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  5234
    ^ '$Header$'
3757
05d3a8228fdd changed: #at:
Claus Gittinger <cg@exept.de>
parents: 3742
diff changeset
  5235
!
05d3a8228fdd changed: #at:
Claus Gittinger <cg@exept.de>
parents: 3742
diff changeset
  5236
05d3a8228fdd changed: #at:
Claus Gittinger <cg@exept.de>
parents: 3742
diff changeset
  5237
version_CVS
4794
73a3ffcaf58c class: DSVColumnView
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  5238
    ^ '$Header$'
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  5239
! !
4161
4722a6575ff0 class: DSVColumnView
ca
parents: 4123
diff changeset
  5240