Go to Post To ANY Robowrangler students reading this thread: If any of you ask me about the game hint, at any time, you will be assigned 4 hours of shop cleaning duty during week 1. No exceptions. - JVN [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-01-2003, 23:04
Gope Gope is offline
Registered User
#0016 (Bomb Squad)
 
Join Date: Jul 2002
Location: Mountain Home, AR
Posts: 230
Gope is on a distinguished road
Visual Basic - Drag and Drop

I am working on a game mimicking score simulator where you can drag around robots and bins and get scores, but i'm haveing trouble with the drag and drop part.

When I only set the forum to allow movement for one object

Source.Move X, Y

Then things work fine, but when I set the forum to allow movement for two or more objects

Source1.Move X, Y
Source2.Move X, Y

Then when I drag either object Source1 is in the drop positon and Source2 is nowhere to be found.

I'm clueless, and can't find a tutorial or forum with the answer, PLEASE HELP!!!!
__________________
College and its wonders. First year and alot of other FIRSTs.
  #2   Spotlight this post!  
Unread 05-01-2003, 23:56
iscrc2 iscrc2 is offline
Registered User
#0568 (Nerds of the North)
 
Join Date: Jan 2002
Location: Anchorage, Alaska
Posts: 28
iscrc2 is an unknown quantity at this point
on a form not forum right? Are you setting both objects to drag mode=automatic?
  #3   Spotlight this post!  
Unread 06-01-2003, 00:14
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
i am considering making a web based scoring simulator for everyone. Tell me how ur sim goes. Can u post it when ur finished¿
__________________
1139 Alumni
  #4   Spotlight this post!  
Unread 06-01-2003, 00:18
Gope Gope is offline
Registered User
#0016 (Bomb Squad)
 
Join Date: Jul 2002
Location: Mountain Home, AR
Posts: 230
Gope is on a distinguished road
This is my program, except for the positioning junk, it dosent work in vbManual or vbAutomatic.




Private xoffset As Integer
Private yoffset As Integer
Option Explicit

Private Sub ba_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
xoffset = X
yoffset = Y
ba.Drag vbBeginDrag

End Sub

Private Sub bb_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
xoffset = X
yoffset = Y
bb.Drag vbBeginDrag

End Sub

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
bb.Move (X - xoffset), (Y - yoffset)
ba.Move (X - xoffset), (Y - yoffset)

End Sub






ya, if i finish this, i'll pass it out to whoever wants it.
__________________
College and its wonders. First year and alot of other FIRSTs.
  #5   Spotlight this post!  
Unread 06-01-2003, 00:52
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,519
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
What I'd like to see is a version with 4 "players" just like the real game so 4 people can use the program at once. This would be okay with the current game simulator too. Am I making sense?
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004
  #6   Spotlight this post!  
Unread 06-01-2003, 00:53
Gope Gope is offline
Registered User
#0016 (Bomb Squad)
 
Join Date: Jul 2002
Location: Mountain Home, AR
Posts: 230
Gope is on a distinguished road
The final version will have 4 robots...i just put up the code(only has 2 bots now) in hopes that someone would see what i'm doing wrong.
__________________
College and its wonders. First year and alot of other FIRSTs.
  #7   Spotlight this post!  
Unread 06-01-2003, 00:54
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
Heres how to fix

umm ya, just do this

Turn DragMode automatic whatever in the properties window, right then on the place where it lands, use the drag drop event and get the object that was dropped with the parameter.

I would give you a more accurate description of how to do this but I was too lazy to open VB. This should work, if it doesn't then I'll tell you how to fix it, or send you a sample.

DragMode = Automatic
Object receiving event DragDrop, in that event do your stuff
k

Bleah, I dont use MOVE either
I jsut do object.left
object.top =
because if you use X and Y, it does placements based on your desktop I think ya thats it

sry, just a cheap lazy message trying to fix some c++ bug

- Ryan Waliany
__________________
R
  #8   Spotlight this post!  
Unread 06-01-2003, 00:59
Gope Gope is offline
Registered User
#0016 (Bomb Squad)
 
Join Date: Jul 2002
Location: Mountain Home, AR
Posts: 230
Gope is on a distinguished road
I'm not really following you. I'm trying to simply drag an objecct and make it stay where it was droped, I can manage to do it with one objeect, but not with multiple ones.
__________________
College and its wonders. First year and alot of other FIRSTs.
  #9   Spotlight this post!  
Unread 06-01-2003, 01:06
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
Hrmmm

What do you mean one, and not others? Do you have Aim, Icq, MSN, or Yahoo. I could probably explain it better on one of those.
Aim: Ryan Waliany, Icq: 11032544, MSN, ryan@scv.net, yahoo Ryan_waliany
__________________
R
  #10   Spotlight this post!  
Unread 06-01-2003, 01:14
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
Drag Drop

Source code of VB proj which does it...
Attached Files
File Type: zip sample drag.zip (661 Bytes, 48 views)
__________________
R
  #11   Spotlight this post!  
Unread 06-01-2003, 09:38
josh_johnson josh_johnson is offline
Registered User
#1020 (Indiana Prankmonkeys)
 
Join Date: Nov 2002
Location: Muncie, IN
Posts: 58
josh_johnson is an unknown quantity at this point
Send a message via AIM to josh_johnson Send a message via Yahoo to josh_johnson
From what you have said, it appears that your code may be moving both objects when you only click and drag one. The destination would be in the same place with one object completely covering the first.
  #12   Spotlight this post!  
Unread 06-01-2003, 09:42
Gope Gope is offline
Registered User
#0016 (Bomb Squad)
 
Join Date: Jul 2002
Location: Mountain Home, AR
Posts: 230
Gope is on a distinguished road
thanx every1 who helped me, i finaly fixed the problem
__________________
College and its wonders. First year and alot of other FIRSTs.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:58.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi