Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Resizing Controls
Message
From
25/06/1999 01:34:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/06/1999 22:30:27
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00232807
Message ID:
00233846
Views:
27
>Hi Everyone,
>
>I'm trying to figure out how to resize an editbox by grabbing and dragging the border of the box with the mouse.
>
>But when I drag the border, it does not move. Very frustrating.
>
>Any help?
>
>Regards,
Hi James,
This is not specifically for an editbox but you could implement it :
**************************************************
*-- 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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform