Category : BASIC Source Code
Archive   : MOVTXT.ZIP
Filename : MOVTXT.FRM

 
Output of file : MOVTXT.FRM contained in archive : MOVTXT.ZIP
#Ì$ PYForm1
&'ÿDragDrop Demonstration ProgramÀGÍÅ´B#ÿÿÿÿ$Form1ÿ,Picture4ÿð'Ÿb.Picture4ÿ3Picture1ÿÀÀÀ¼hÈw B.Picture1ÿ(Text1ÿph¿w Text1!Text1ÿ3Picture2ÿÀÀÀ¼8Èw B.Picture2ÿ(Text2ÿp8Ÿw Text2!Text2ÿ3Picture3ÿÀÀÀ¼Èw B.Picture3ÿ(Text3ÿp_
w Text3!Text3ÿ7 Command1ÿThis Button Does NothingðpO gÿt
Label1ÿNUse The Grey Box At The Left Of The Text Control To DragDrop The Text Control.ÿÿX
÷ïÿ*ü
QĈÖYZ.’•Á×d0è¤Irò̈́­šh·1úˆ@
Form_Clicku€MouseXúPicture1_Click@Picture1_MouseDown²€Button|€ShiftÀX߀Y²€MouseYI€Picture1Widthv€Text1ð@
Form_DragDrop€Source°TagÕ€
TextOffsetLeft›Top‹ Text2_Change#Text2_DragOverkState MousePointer@@Text2_DragDropp@DropItŠ€WhichOne€Actionñ Text1_ChangeÂPicture1_DragOverOPicture2_ClickPicture2_DragOverì@Picture1_DragDrop,@Picture2_DragDropÛ@Picture2_MouseDown<€Picture2R€Text2ÝPicture2_MouseUp‰@Text1_DragDropyText1_DragOver€Picture3€Text3€True€False¥Visible Label1_Click  SaveWidth
Form_DragOver'Form_DragDrop1TextC€OverlappCancel€DestCheckItªHeight DestRightDestBot€Form1c€Picture4YasaX1Y1´Picture4_Clickš@Picture4_DragDrop€XLeft€XRight€YLeftedgeÆofCheck1Check2Picture3_Click@Picture3_DragDrop@Picture3_MouseDown Text3_Change@Text3_DragDropF€Command1Command1_ClickY@Command1_DragDrop@Label1_DragDrop€Label1@ Form_LoadCurrentXCurrentY v
9=v#
DRAGDROP DEMONSTRATION PROGRAMOv$
Keith Funk (CIS ID 72240, 2020)v
 Rev. 1.0 July, 1991v

-vv; This program demonstrates a way to use a Picture Controllv8 to initiate what appears to be the dragging of a Textv5 Control. Some such method is required because Textrv: Controls cannot in themselves be DragDropped since theyv5 don't have a MouseDown Event associated with them..vv: In addition, it shows some code that prevents a controlv1 from being dropped on top of another control. Tvv8 The program works like this. The user press the mousev8 over a picture box (say Picture1). Picture1_MouseDownv; saves the current cursor location then expands the widthhv8 of the picture so that it encompasses the text box tov7 its right (the one the user wants to drag). When he ev; begins dragging, it *looks* like he is actually draggingv3 the text box. MouseDown also initiates dragging.dvv: Every control -and- the form can react to a Drop Event.v: If a control detects a DragDrop, it converts the cursorv: X/Y co-ords (which are relative to the top, left of thev9 control) so that they are relative to the top, left offv5 the form and then Calls the Form's DragDrop Event..vv: The form's DragDrop Event calls the Overlap function tov9 to check if any part of the dragged control covers anyyv8 part of another control. It then Calls the Sub DropItv7 and either tells it to cancel the drag because of annv< overlap or to move the picture control and its associatedv; text control to the new location if there is no overlap..vv; There is one exception to a control not being allowed toov7 overlap another control. The user is allowed to draggv8 a control and drop it on top of itself. This lets himv3 make small adjustments to the controls position.svv< Sub DropIt resets the picture control's width back to itsv7 original width and then either exits if the drag is mv9 cancelled or uses the Move command to move the picturerv( box and text box to the new location.vv: A note about the Const TextOffset. The picture controlsv6 used for dragging where created with a width of 200v7 twips. Their associated text controls were placed soov6 that they overlap the picture controls by 20 twips.v7 Thus, the offset is 180 twips. This was done so thattv: only a single vertical line separates the two controls.vv7 The large picture control, the label control and theev8 command button are included simply to demonstrate thev+ code that prevents overlapping controls..v
9=äù yä v6==> Location of Mouse Pointer at start of drag drop.v0
 Values are relative to the top, left cornerv3
 of the control on which the mouse was pressed.oü" 
hü2 
·v1==> Distance between the left edge of a picturedv0
 control and the left edge of its associatedv
 text control.å´  ÿÿÿÿÿÿÿÿIPicture1_MouseDown0tX&„š€¤€­€²€v.==> Save the current location of the cursor. ­ h ² ·v1==> Expand the picture control to encompass itssv,
 associated text control, so it looks tov3
 the user like he is dragging the text control.o ÁÍ ÖÍ£ ÁÍv==> Initiate dragging. Áeä(x9 ÿÿÿÿÿÿÿÿ
Text2_DragDrop0XXYð€­€²€ ð ­ £ ² £#ß9 ÿÿÿÿÿÿÿÿDropIt0"v
9-v:This routine is called by Form1_DragDrop. It shrinks thev4picture control back to its original width. If thev<requested Action is "OK" then it Moves the picture controlv6and its associated text control to the new loaction.v7If the Action is "Cancel", the Move is not performed..v
9-vX&ku€­€²€€ uúVš í  Picture1&0 'ÁÍ 'ÖÍ÷ 'ÁÍ0 í
èCancelñIú@v%==> Put the top, left corner of theh@v*
 control in the same position relative@v-
 to the cursor as it was before the move.s@ Áe ­ h÷ ² ·÷òò*x@ Öe Á £ Áòò*x08 í Picture2&0 Í #Í÷ Í0 í
DCancelñIÆ@ e ­ h÷ ² ·÷òò*x@ #e  £ òò*x08 í ÔPicture3&0 dÍ pÍ÷ dÍ0 í
CancelñI’@ de ­ h÷ ² ·÷òò*x@ pe d £ dòò*x08:9 ÿÿÿÿÿÿÿÿ$Picture1_DragDrop0XX×ð€­€²€ ð ­ Á£ ² Á£#ß9 ÿÿÿÿÿÿÿÿPicture2_DragDrop0XXìð€­€²€ ð ­ £ ² £#ß9 ÿÿÿÿÿÿÿÿPicture2_MouseDown0|X&š€¤€­€²€ ­ h ² · Í #Í£ Í eä(x9 ÿÿÿÿÿÿÿÿText1_DragDrop0XX@ð€­€²€ ð ­ Á£ ² Á£#ß9 ÿÿÿÿÿÿÿÿ
Form_DragDrop0¦v
9-v:The DragDrop Procs for *all* controls call this routine.v6Before doing so, these Procs convert their Mouse X/Yv4co-ords so that they are relative to the top, leftvcorner of the *form*.avv:This routine calls the Overlap function for each controlv8on the form to see if the control being moved overlapsv7the control. If it does, the DragDrop is cancelled. AAv<special case is the text controls that can be DragDropped.v$They can be dropped on themselves.vv;This routine then calls the routine DropIt which performssv the Move..v
9-vXßð€­€²€í°OK  ð Á ­ ²ÝEèí
\Cancel  ð  ­ ²ÝEí
Cancel  ð d ­ ²ÝEHí
<Cancel  ð 0 ­ ²ÝExí
lCancel  ð  ­ ²ÝEªí
žCancel  ð Y ­ ²ÝEÚí
ÎCancel v3==> Don't check for overlap if the Source controlhv/
 is the picture control associated with thetv/
 destination text control. That is, let theev'
 user DragDrop a control on itself.  ðúí ÂPicture1ñ ð Ö ­ ²Ý¤Eþí
žCancel  ðúí Picture2ñ ð # ­ ²Ý¤ELí
@Cancel  ðúí ^Picture3ñ ð p ­ ²Ý¤Eší
ŽCancel  ð ­ ² #k9 ÿÿÿÿÿÿÿÿ%Overlap 0Dv
9-v8This function checks if any part of the Source controlv:(the one being DragDropped) overlaps any part of anotherv6control. If it does, then the function returns True.vOtherwise it returns False..v
9-@&ÝÁð€ò€­€²€  Ýv.==> Allow a picture to be dropped on itself. ðú òú¦E‚=Vv3==> Top left and top right of the Source control.- ­ h÷ v v ðÍ£ v4==> Check if the top edge of source intersects thev
 left edge of dest.e ² ·÷ ‰v => top left of Source.A v3
- Check if the top,left corner of the source isuv
 inside the dest.hAªv3
- Check if the bottom edge of source intersectsev
 the left edge of dest.o ² ·÷ 𣠉A v3
- Check if the bottom,left corner of the sourcetv
 is inside the dest.Aª=Vv3==> This routine determine if two lines interest.e²  v òâî  òÞî¤Ix ‰ òÞî ‰ ò ò£îâî¤It0 y Ý0=V 88Uv;==> This routine checks if a point is inside a rectangle.ÿÿª v òÞî v ò òÍ£îâî¤IN ‰ òÞî ‰ ò ò£îâî¤IJ0 y Ý0=V 88U9 ðÿÿÿÿÿÿ9Picture4_DragDrop0RXað€­€²€ ð ­ ²í
<Cancel#k9 ÿÿÿÿÿÿÿÿPicture3_DragDrop0XXÆð€­€²€ ð ­ d£ ² d£#ß9 ÿÿÿÿÿÿÿÿPicture3_MouseDown0|X&Ûš€¤€­€²€ ­ h ² · dÍ pÍ£ dÍ deä(x9 ÿÿÿÿÿÿÿÿText3_DragDrop0XXð€­€²€ ð ­ d£ ² d£#ß9 ÿÿÿÿÿÿÿÿCommand1_DragDrop0XX1ð€­€²€ ð ­ £ ² £#ß9 ÿÿÿÿÿÿÿÿLabel1_DragDrop0’XFð€­€²€v4==> X + Label1.Left and Y + Label1.Top are used tov4
 convert the cursor location from being relativev/
 to the control's top, left corner to being v4
 relative to the form's top, left corner becausev5
 that's the X/Y that the Move command (see DropItDv
 Sub) requires.  ð ­ Y£ ² Y£#ß9 ÿÿÿÿÿÿÿÿ  Form_Load0ÄXcv3==> Let the user know what the square at the top, v
 right of the form is. 'eòxåd 0på¼ 0| 0efí¬Picture Control"u9 ÿÿÿÿÿÿÿÿý

  3 Responses to “Category : BASIC Source Code
Archive   : MOVTXT.ZIP
Filename : MOVTXT.FRM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/