************************************************** *-- Class: shpsizeable (d:\test\classes\test.vcx) *-- ParentClass: shape *-- BaseClass: shape * DEFINE CLASS shpsizeable AS shape Height = 116 Width = 107 threshhold = 3 Name = "sizeable" InResize = .F. ldraglb = .F. ldragbb = .F. ldragtb = .F. ldragrb = .F. PROCEDURE MouseMove LPARAMETERS nButton, nShift, nXCoord, nYCoord WITH this IF .inResize IF .ldraglb IF nXCoord < .left .width = .width + abs(.left - nXCoord) ELSE .width = max(.width - abs(.left - nXCoord),0) ENDIF .left = nXCoord ENDIF IF .ldragtb IF nYCoord < .top .height = .height + abs(.top - nYCoord) ELSE .height = max(.height - abs(.top - nYCoord),0) ENDIF .top = nYCoord ENDIF IF .ldragrb IF nXCoord < .left + .width .width = max(.width - abs(.left + .width - nXCoord),0) ELSE .width = .width + abs(.left + .width - nXCoord) ENDIF ENDIF IF .ldragbb IF nYCoord < .top + .height .height = max(.height - abs(.top + .height - nYCoord),0) ELSE .height = .height + abs(.top + .height - nYCoord) ENDIF ENDIF ELSE .ldraglb = between(nXCoord,.left-.threshhold,.left+.threshhold) .ldragtb = between(nYCoord,; .top - .threshhold, .top+.threshhold) .ldragrb = between(nXCoord,; .left+.width-.threshhold,.left+.width+.threshhold) .ldragbb = between(nYCoord, ; .top+.height-.threshhold, .top+.height+.threshhold) DO case CASE .ldraglb and .ldragtb ; or .ldragrb and .ldragbb .mousepointer = 8 CASE .ldraglb and .ldragbb ; or .ldragrb and .ldragtb .mousepointer = 6 CASE .ldragrb or .ldraglb .mousepointer = 9 CASE .ldragtb or .ldragbb .mousepointer = 7 OTHERWISE .mousepointer = 0 ENDCASE ENDIF ENDWITH ENDPROC PROCEDURE MouseDown WITH this LPARAMETERS nButton, nShift, nXCoord, nYCoord .ldraglb = between(nXCoord,.left-.threshhold,.left+.threshhold) .ldragtb = between(nYCoord,; .top - .threshhold, .top+.threshhold) .ldragrb = between(nXCoord,; .left+.width-.threshhold,.left+.width+.threshhold) .ldragbb = between(nYCoord, ; .top+.height-.threshhold, .top+.height+.threshhold) .inResize = .ldraglb or .ldragtb or .ldragrb or .ldragbb ENDWITH ENDPROC PROCEDURE MouseUp LPARAMETERS nButton, nShift, nXCoord, nYCoord this.inResize = .f. ENDPROC ENDDEFINE * *-- EndDefine: shpsizeable **************************************************Cetin