VariablePanelController.st
changeset 2005 9b1ff373a8ad
parent 1871 a6b15bdfcc92
child 2159 2864c0de7f33
equal deleted inserted replaced
2004:0f035d5deb50 2005:9b1ff373a8ad
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 Controller subclass:#VariablePanelController
    13 Controller subclass:#VariablePanelController
    14 	instanceVariableNames:'movedHandle prevPos startPos clickPos'
    14 	instanceVariableNames:'movedHandle prevPos startPos clickPos'
    15 	classVariableNames:'OpaqueResize'
    15 	classVariableNames:''
    16 	poolDictionaries:''
    16 	poolDictionaries:''
    17 	category:'Interface-Support-Controllers'
    17 	category:'Interface-Support-Controllers'
    18 !
    18 !
    19 
    19 
    20 !VariablePanelController class methodsFor:'documentation'!
    20 !VariablePanelController class methodsFor:'documentation'!
    53      If off (the default), the resizing takes place at the end of
    53      If off (the default), the resizing takes place at the end of
    54      the handle move operation (when the mouse button is released).
    54      the handle move operation (when the mouse button is released).
    55      If on, the resizing is syncronous with the move.
    55      If on, the resizing is syncronous with the move.
    56      On slow machines, it may make sense to leave it off."
    56      On slow machines, it may make sense to leave it off."
    57 
    57 
    58     ^ OpaqueResize
    58     self obsoleteMethodWarning.
    59 
    59     ^ UserPreferences current opaqueVariablePanelResizing
    60     "Created: / 19.11.1998 / 12:35:26 / cg"
       
    61 !
    60 !
    62 
    61 
    63 opaqueResize:aBoolean
    62 opaqueResize:aBoolean
    64     "set/clear opaque-resizing.
    63     "set/clear opaque-resizing.
    65      If off (the default), the resizing takes place at the end of
    64      If off (the default), the resizing takes place at the end of
    66      the handle move operation (when the mouse button is released).
    65      the handle move operation (when the mouse button is released).
    67      If on, the resizing is syncronous with the move.
    66      If on, the resizing is syncronous with the move.
    68      On slow machines, it may make sense to leave it off."
    67      On slow machines, it may make sense to leave it off."
    69 
    68 
    70     OpaqueResize := aBoolean.
    69     self obsoleteMethodWarning.
       
    70     ^ UserPreferences current opaqueVariablePanelResizing:aBoolean
    71 
    71 
    72     "
    72     "
    73      self opaqueResize:true
    73      self opaqueResize:true
    74      self opaqueResize:false
    74      self opaqueResize:false
    75     "
    75     "
    82 buttonMotion:state x:bx y:by
    82 buttonMotion:state x:bx y:by
    83     "mouse-button was moved while pressed;
    83     "mouse-button was moved while pressed;
    84      clear prev handleBar and draw handle bar at new position" 
    84      clear prev handleBar and draw handle bar at new position" 
    85 
    85 
    86     |pos limitMin limitMax subViews barHeight
    86     |pos limitMin limitMax subViews barHeight
    87      oldHx oldHy newHx newHy|
    87      oldHx oldHy newHx newHy opaque|
    88 
    88 
    89     movedHandle isNil ifTrue: [^ self].          "should not happen"
    89     movedHandle isNil ifTrue: [^ self].          "should not happen"
    90 
    90 
    91     "speedup - if there is already another movement, 
    91     "speedup - if there is already another movement, 
    92      ignore thisone ... "
    92      ignore thisone ... "
   157         oldHy := prevPos.
   157         oldHy := prevPos.
   158         newHy := pos.
   158         newHy := pos.
   159         oldHx := newHx := 0.
   159         oldHx := newHx := 0.
   160     ].
   160     ].
   161 
   161 
   162     OpaqueResize ~~ true ifTrue:[
   162     opaque := UserPreferences current opaqueVariablePanelResizing.
       
   163     opaque ~~ true ifTrue:[
   163         view invertHandleBarAtX:oldHx y:oldHy. 
   164         view invertHandleBarAtX:oldHx y:oldHy. 
   164         view invertHandleBarAtX:newHx y:newHy.
   165         view invertHandleBarAtX:newHx y:newHy.
   165     ].
   166     ].
   166     prevPos := pos.
   167     prevPos := pos.
   167 
   168 
   168     OpaqueResize == true ifTrue:[
   169     opaque == true ifTrue:[
   169         self doResizeForX:bx y:by.
   170         self doResizeForX:bx y:by.
   170     ]
   171     ]
   171 
   172 
   172     "Modified: / 13.11.1998 / 15:13:47 / cg"
   173     "Modified: / 13.11.1998 / 15:13:47 / cg"
   173 !
   174 !
   210             ].
   211             ].
   211 
   212 
   212             thatsTheHandle ifTrue:[
   213             thatsTheHandle ifTrue:[
   213                 movedHandle := handle.
   214                 movedHandle := handle.
   214 
   215 
   215                 OpaqueResize == true ifTrue:[
   216                 UserPreferences current opaqueVariablePanelResizing == true ifTrue:[
   216                     view grabPointerWithCursor:view cursor.
   217                     view grabPointerWithCursor:view cursor.
   217                 ].
   218                 ] ifFalse:[
   218 
       
   219                 OpaqueResize ~~ true ifTrue:[
       
   220                     view invertHandleBarAtX:hx y:hy.
   219                     view invertHandleBarAtX:hx y:hy.
   221                     (group := view windowGroup) notNil ifTrue:[
   220                     (group := view windowGroup) notNil ifTrue:[
   222                         group showCursor:view cursor
   221                         group showCursor:view cursor
   223                     ].
   222                     ].
   224                 ].
   223                 ].
   244 
   243 
   245     ((button == 1) or:[button == #select]) ifTrue:[
   244     ((button == 1) or:[button == #select]) ifTrue:[
   246         movedHandle isNil ifTrue:[^ self].
   245         movedHandle isNil ifTrue:[^ self].
   247 
   246 
   248         view ungrabPointer.
   247         view ungrabPointer.
   249         OpaqueResize ~~ true ifTrue:[
   248         UserPreferences current opaqueVariablePanelResizing ~~ true ifTrue:[
   250             (group := view windowGroup) notNil ifTrue:[
   249             (group := view windowGroup) notNil ifTrue:[
   251                 group restoreCursors
   250                 group restoreCursors
   252             ]
   251             ]
   253         ].
   252         ].
   254 
   253 
   277     isHorizontal ifTrue:[
   276     isHorizontal ifTrue:[
   278         hX := prevPos. hY := 0. 
   277         hX := prevPos. hY := 0. 
   279     ] ifFalse:[
   278     ] ifFalse:[
   280         hX := 0. hY := prevPos. 
   279         hX := 0. hY := prevPos. 
   281     ].
   280     ].
   282     OpaqueResize ~~ true ifTrue:[
   281     UserPreferences current opaqueVariablePanelResizing ~~ true ifTrue:[
   283         view invertHandleBarAtX:hX y:hY. 
   282         view invertHandleBarAtX:hX y:hY. 
   284     ].
   283     ].
   285 
   284 
   286     "/ any change ?
   285     "/ any change ?
   287     ((isHorizontal and:[bx == clickPos x])
   286     ((isHorizontal and:[bx == clickPos x])
   337 ! !
   336 ! !
   338 
   337 
   339 !VariablePanelController class methodsFor:'documentation'!
   338 !VariablePanelController class methodsFor:'documentation'!
   340 
   339 
   341 version
   340 version
   342     ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.22 1999-04-24 15:47:34 cg Exp $'
   341     ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.23 1999-09-06 12:57:31 cg Exp $'
   343 ! !
   342 ! !