Darwinbots Forum
Code center => Suggestions => Topic started by: Panda on January 13, 2010, 12:54:03 PM
-
With the notify icon, when you minimise the program to the taskbar, it opens the program when you move the mouse over it, this gets a little annoying after a while. Is the any chance you can change it to double click.
Damn just done it again!!! :@
-
Yeah, it's a pain. When I added "ninja mode" (that icon that triggers it is a ninja btw) I couldn't figure out how to do a right click menu. Or even have it pop up after a click. Something odd to do with how VB6 works.
If I have some time in the next few weeks I'll take a look at it. It's been bugging me too.
-
I can do the right click but only in Microsoft Visual Studio 2010, are the files intercompatible or is it just backwards compatiblity or is it neither?
EDIT> I love that ninja
-
VB6 doesn't support that stuff natively, so I have to do raw calls to the Win API, which are always error prone. If you've ever done C++ WinAPI coding you could take a look at how the VB6 code is doing it and see if you can tweak it to work correctly. The VB code is here (https://svn2.hosted-projects.com/Numsgil/DarwinbotsVB/trunk/). Not sure which file to look in though.
-
I have a version of VB6 somewhere, I'll have to dig it out. I'll get back to you later.
-
If you can't find a version there's a download of VB6 on the web site I can point you to. But it's pretty gimped.
-
I have found it, it is just whether or not the CD will work.
-
Any idea which one it is? or... will I have to find it myself?
EDIT>Will you want a right click menu or shall I just create it so you can click on it?
-
If you can figure out a right click menu than great. If not, them single click is fine. Let me know if you get it working and tested, and I'll give you write access to the repository.
-
What will people rather for now, single or double click to get darwinbots to appear from stealth mode?
EDIT: That means it is working and atm it is doubleclick but I can change it to any one you want.
-
Just found out that it doesnt work when you build it into an .exe but works fine during debug.
-
That's weird. I don't have any brilliant ideas unfortunately.
-
Just found out that it doesnt work when you build it into an .exe but works fine during debug.
Sounds like threading issues, although even that sounds dubious (is graphics and logic handled in separate threads?). Sometimes all is needed is a tiny time offset and things that refused to work for inexplicable circumstances magically do. The debug scenario is usually a big clue when going step-by-step.
-
I have worked out why it is
Private Sub OwnerForm_MouseMove(button As Integer, Shift As Integer, X As Single, Y As Single)
Static rec As Boolean, MSG As Long
MSG = X / Screen.TwipsPerPixelX
Debug.Print ("WM_LBUTTONUP:" & WM_LBUTTONUP)
Debug.Print ("MSG:" & MSG)
Debug.Print ("X:" & X)
Debug.Print ("Screen.TwipsPerPixelX:" & Screen.TwipsPerPixelX)
If rec = False Then
rec = True
Select Case MSG
Case WM_LBUTTONDBLCLK:
'RaiseEvent MouseDown(1)
Case WM_LBUTTONUP:
RaiseEvent MouseDown(1)
Case WM_RBUTTONDBLCLK:
'RaiseEvent MouseDown(1)
Case WM_RBUTTONUP:
'RaiseEvent MouseDown(1)
End Select
rec = False
End If
The "X" changes at different points to different numbers, I am not sure if it changes to the same every single time.
EDIT: Dunno how to fix it though. Bacillus, you where saying something about the threading. I have no idea about the treads. The "X" changes when you start a new simulation both inside and outside the debug and the numbers created are different to eachother everysingle time inside the debug, outside the debug they are the same as eachother, but different from inside the debug.
-
I'm not sure I understand the connection between mouse events and screen resolution though, and this language (VB?) is uncharted territory for me...
-
That is to detect whether the mouse is in the right place or not.
-
On further inspection, it looks like the rec block might be a good idea to put around the whole method (I assume that this is what prevents the code being exectued multiple times in the same timeframe. Could hint at threading issues...)
What are the triggers of this method? It looks like it triggers on the mouse moving, when it should be on the mouse being clicked.
-
That is just the name of the sub, that doesn't effect the triggers, it was what it was called originly
-
Okay, I'm still in the dark about the role MSG plays. Is it there for debug purposes or does it play another role?
-
MSG is the part where the information about the mouse is stored, then that is checked against the different constants about the different states of the mouse.
-
I see. That leaves button unreferenced, and the name would imply that it carries some information regarding the button clicked...
-
It is still something to do with the "X" value changing incorectly.
-
What is the range of expected and actual values?
-
From MSG: I am expecting 514 which is what I get without the simulation running, but when the simulation is running I get 428.
From X: I am expecting 7680 which, again, is what I get without the simulation running but, again, I get the different result of 6432.602.
Outside VB6, running it normally, I dont know what the results are, I just know that they change
-
A pure guess, but could it be that the 'actual' simulation size somehow changes the perceived values?
-
I was thinking that, I might check that now.
-
Could you post the X-calculation code, or is that black-boxed?
-
We have a winner, it does it according to the size of the feild, now I need to find a way around this
-
Is there a way to reference the window/desktop size instead of the sim? It could also be an accidental reference...
-
Thats exactly what I am thinking, I need to find a way then to reference the desktop or find out a way to... I have no idea.
-
At least we have found the problem, I will tackle it tomorrow, got 6 hours sleep last night, maybe a bit less, and I have been up for 19 hours now and I have been half of the day. Maybe Numsgil will have an idea of what we can do now we have identified the problem. Bye.
-
Glad you figured it out. I don't mind windows programming so much, but getting it to work from VB6 is a huge pain. So I feel for you
-
Have you got any ideas that I can do for it then numsgil?
-
Im just going to test for the value of MSG when it is clicking for every single sim size, thats all I can think of at the moment.
-
I have done it, will somebody just quickly test it on their computer, prefer numsgil or bacillus
-
I am now developing a right click menu for it, it only opens up DarwinBots does anybody want it to do anything else
EDIT: Would anybody like stop and play on the right click menu?
EDIT2: I do not have the time at the moment to sort a rightclick menu out, I will get it done, I have got a basic one working, for the time being but it is not enough to put into DarwinBots.
-
Sure, we can test it. Upload the exe and I'll give it a try.
-
Here it is, hope it works
-
Hooray, it works!
But now I can't delete the stuff it put in my downloads folder.
"Write a wise saying and your name will live forever."
- Anonymous
-
Mnnnnn, is that my fault, anyway, if I have acidently edited any other part of the program I am only uploading the "TrayIcon.cls"(I think thats what it is called) to the SVN thingy so...
-
Seems to work just fine on my machine. PM me an email address and I'll set you up with privileges to submit changes to the SVN.
-
will this be 2.44.05?
-
Probably. I don't have any other fixes in the pipeline.
-
I think that is the end of this one, any chance of moving this to "Dead end and solved suggestions" might not be the right name that, not sure
-
I'll wait to move it till we release I think. But yeah.