************************************************** *-- Class: sizeable (c:\temp\test.vcx) *-- ParentClass: shape *-- BaseClass: shape * DEFINE CLASS sizeable AS shape Height = 116 Width = 107 threshhold = 3 Name = "sizeable" inresize = .F. ldraglb = .F. ldragbb = .F. ldragtb = .F. ldragrb = .F. PROCEDURE MouseUp LPARAMETERS nButton, nShift, nXCoord, nYCoord this.inResize = .f. ENDPROC PROCEDURE MouseDown LPARAMETERS nButton, nShift, nXCoord, nYCoord this.lDragLB = between(nXCoord,this.left-this.ThreshHold,this.left+this.ThreshHold) this.lDragTB = between(nYCoord,; this.top - this.ThreshHold, this.top+this.ThreshHold) this.lDragRB = between(nXCoord,; this.left+this.width-this.ThreshHold,this.left+this.width+this.ThreshHold) this.lDragBB = between(nYCoord, ; this.top+this.height-this.ThreshHold, this.top+this.height+this.ThreshHold) this.inResize = this.lDragLB or this.lDragTB or this.lDragRB or this.lDragBB ENDPROC PROCEDURE MouseMove LPARAMETERS nButton, nShift, nXCoord, nYCoord if this.inResize if this.lDragLB if nXCoord < this.left this.width = this.width + abs(this.left - nXCoord) else this.width = max(this.width - abs(this.left - nXCoord),0) endif this.left = nXCoord endif if this.lDragTB if nYCoord < this.top this.height = this.height + abs(this.top - nYCoord) else this.height = max(this.height - abs(this.top - nYCoord),0) endif this.top = nYCoord endif if this.lDragRB if nXCoord < this.left + this.width this.width = max(this.width - abs(this.left + this.width - nXCoord),0) else this.width = this.width + abs(this.left + this.width - nXCoord) endif endif if this.lDragBB if nYCoord < this.top + this.height this.height = max(this.height - abs(this.top + this.height - nYCoord),0) else this.height = this.height + abs(this.top + this.height - nYCoord) endif endif else this.lDragLB = between(nXCoord,this.left-this.ThreshHold,this.left+this.ThreshHold) this.lDragTB = between(nYCoord,; this.top - this.ThreshHold, this.top+this.ThreshHold) this.lDragRB = between(nXCoord,; this.left+this.width-this.ThreshHold,this.left+this.width+this.ThreshHold) this.lDragBB = between(nYCoord, ; this.top+this.height-this.ThreshHold, this.top+this.height+this.ThreshHold) do case case this.lDragLB and this.lDragTB ; or this.lDragRB and this.lDragBB this.mousepointer = 8 case this.lDragLB and this.lDragBB ; or this.lDragRB and this.lDragTB this.mousepointer = 6 case this.lDragRB or this.lDragLB this.mousepointer = 9 case this.lDragTB or this.lDragBB this.mousepointer = 7 otherwise this.mousepointer = 0 endcase endif ENDPROC ENDDEFINE * *-- EndDefine: sizeable **************************************************Cetin