I see that it use the SetToolTip function, which is using the wx's wxToolTip class.
Now, I just set the m_coordTooltip to true, and when I move the mouse, there are a lot of wxTipWindow shown on the screen, and those tip windows do not disappear. So, the first place's tip can not be used.
While, the second place's tip code woks correctly, when I use the mouse left click and release, it does show a tip window, and about several seconds later, the tip window automatically disappeared.
Any ideas?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I uploaded the "bad_tip" window(the code in first place) and "good_tip" (the code in second place) window screen shots as attachments. The good tip screen shot will be uploaded in another post.
Hi ollydbg, if you're interested, I've done lot of changes to the way wxMathPlot shows that window, I've called it TrackBox and I made it so you can bind its appearance to any mouse button. The code is available at github.com/naiche/wxMathPlot.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is this correct?
You first find a best X value, and later to calculate the distance?
I think the best way is to loop all the (x,y) pair in the xy vector, and find the shortest distance.
Some other issue: I see the source file has mixed "TAB" and "4 spaces" as indent. Can you fix them?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Ollydbg, I enabled the issue option on the repo.
I'll look into it when I have the time.
Is the the problem only with FY? Is it working ok with FXYvectors?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
By reading the source code, I think to find the closest point, the current implementation of FX, FY, FXYvectors is wrong, I think the FXY is correct(You have to override the function GetNextXY:
I see currently there are two tooltip related code which are comment out, I just try to enable it, but it does not work quite well.
The first place:
In this function:
void mpWindow::OnMouseMove(wxMouseEvent &event)This code are using the
wxTipWindowclass to show the tip.The second place:
While in another function:
mpWindow::OnMouseLeftRelease (wxMouseEvent &event), it has such code:I see that it use the SetToolTip function, which is using the wx's wxToolTip class.
Now, I just set the
m_coordTooltipto true, and when I move the mouse, there are a lot of wxTipWindow shown on the screen, and those tip windows do not disappear. So, the first place's tip can not be used.While, the second place's tip code woks correctly, when I use the mouse left click and release, it does show a tip window, and about several seconds later, the tip window automatically disappeared.
Any ideas?
Thanks.
I uploaded the "bad_tip" window(the code in first place) and "good_tip" (the code in second place) window screen shots as attachments. The good tip screen shot will be uploaded in another post.
Here is the good tip.
Hi ollydbg, if you're interested, I've done lot of changes to the way wxMathPlot shows that window, I've called it TrackBox and I made it so you can bind its appearance to any mouse button. The code is available at github.com/naiche/wxMathPlot.
Hi, Naiche Barcelos, thanks for the reply.
I will try your github code repo, and I see you made a good contribution to wxMathPlot.
The TrackBox is a feature I'm expecting for many years. I'm grad that you already implemented it.
BTW: I have asked the original question in wx forum, see here:
wxTipWindow vs wxToolTip used inside wxMathPlot class
Someone replied to that question, and he suggest that I should use the native tip window. (The good_tip screen shot)
Hi, Naiche Barcelos. Since you github repo don't have issue option enabled, I have to wrote it here.
In the function
std::pair<mpLayer*, wxRealPoint> mpWindow::GetClosestPoint(double x, double y)There are some code snippet:
Is this correct?
You first find a best X value, and later to calculate the distance?
I think the best way is to loop all the (x,y) pair in the xy vector, and find the shortest distance.
Some other issue: I see the source file has mixed "TAB" and "4 spaces" as indent. Can you fix them?
Thanks.
Hi, Naiche Barcelos, here is another issue of your code, I wrote it in the issue of my fork
See here with a screen shot: Find the nearest point on the FY, the current method is not correct · Issue #2 · asmwarrior/wxMathPlot-TrackBox
BTW: the previous issue is also wrote as:
How to find the nearest point in FXYVector? · Issue #1 · asmwarrior/wxMathPlot-TrackBox
Last edit: ollydbg 2022-10-14
Hi Ollydbg, I enabled the issue option on the repo.
I'll look into it when I have the time.
Is the the problem only with FY? Is it working ok with FXYvectors?
Hi, thanks for the response.
By reading the source code, I think to find the closest point, the current implementation of FX, FY, FXYvectors is wrong, I think the FXY is correct(You have to override the function
GetNextXY:Fixed it for mpFY, later I'll fix the others.
Done, mpFX and mpFXYVector fixed.