Repository navigation
Conversation
c665f47 to
3c14084
Compare
There was a problem hiding this comment.
can these examples be implemented with the PlotController instead? #111
There was a problem hiding this comment.
@VisualMelon I am not sure how to do this. My first impression is to use the extension method IController.BindMouseDown with a parameter of type DelegateViewCommand but I do not know how code-gen handles this, and, more important to me, I do not know what IController method to use instead of the model's MouseUp event.
Thank you.
There was a problem hiding this comment.
I'm not sure, I've never used them myself. However, take a look at ManipulatorBase: you should be able to bind a MouseDownGesture, and implement the started/delta/completed events to handle the entire interaction.
There was a problem hiding this comment.
@VisualMelon I posted my unsuccessful attempt on this in a gist. The relevant lines with comments are here. I think I will try more tomorrow. (I think that I must also find how to use the OxyMouseDownGesture class). It would be great if you could help me more. Thank you for all the help.
There was a problem hiding this comment.
Manipulators are, I believe, a transient thing. Lots of examples in PlotCommands.cs (e.g. PanAt. I'd expect the code to be more like this:
plot.PlotView.ActualController.BindMouseDown(OxyMouseButton.Left, OxyModifierKeys.None, new DelegateViewCommand<OxyMouseDownEventArgs>((v, c, e) =>
{
plot.PlotView.ActualController.AddMouseManipulator(plot.PlotView, new CustomMouseManipulator(v, rnd), e);
}));
However, this can never work, because we just created the model, so it can't have a plotview or controller, so my gut feeling is that answer to @objorke question is that it is not possible. I think I'm going to have to try to get my head around #111...
| /// <param name="updateData">The update Data.</param> | ||
| public void InvalidatePlot(bool updateData = true) | ||
| { | ||
| if (this.ActualWidth <= 0 || this.ActualHeight <= 0) |
There was a problem hiding this comment.
I think this should be reverted
| /// </returns> | ||
| protected override HitTestResult HitTestOverride(HitTestArguments args) | ||
| { | ||
| if (!this.PlotModel.PlotArea.Contains(args.Point)) |
There was a problem hiding this comment.
move this into calling method?
There was a problem hiding this comment.
@VisualMelon Please, can you tell me how can I access the (PlotModel.)PlotArea from the calling method of the code above, UIElement.HitTest? Should there be a new UIElement.PlotModel property? Thank you.
There was a problem hiding this comment.
I'm not sure. UIElement.PlotModel would couple UIElement to PlotModel unnecessarily. I'm not sure if objorke means that the decision to test agains the PlotArea should be handled higher up (though currently it cannot, because Model and not PlotModel do the work), or if the idea is just to reduce redundancy.
I am not totally convinced that the elements should be filtered at this layer, and I wonder if Model.HitTest should give more control to the inheriting class. That's all assuming the change is desirable, which I don't think is entirely clear with annotations.
|
Can we remove https://github.com/oxyplot/oxyplot/blob/develop/Source/OxyPlot/Rendering/RenderContext/IRenderContext.cs#L187 with these changes? |
| /// Shows the tooltip. | ||
| /// </summary> | ||
| /// <param name="str">The string to show as tooltip.</param> | ||
| void ShowToolTip(string str); |
There was a problem hiding this comment.
Wouldn´t it be simpler if this was in https://github.com/oxyplot/oxyplot/blob/develop/Source/OxyPlot/Graphics/IView.cs instead?
There was a problem hiding this comment.
@objorke I do not have a strong opinion on this. I think that:
- there are some configuration variables in
IToolTipViewthat would polluteIViewimplementations - loosely coupled objects are good on the long term
Thank you.
It is done in a new commit: 192c643. Thank you. |
|
@VisualMelon A few unimportant questions, only if you have time for them:
Thank you. |
|
|
I'm wondering if we can just drop the ToolTip string property all together and only provide the formatter function and string. I do not think you would lose any functionality, you can also use the format string to show a static message (or formatter function for that matter). Be careful if you want to pass more arguments to the formatter function since, if you do it like the tracker (possible custom # arguments per element), it will become the responsibility of the element to generate the tooltip. Hence you might need to add (and thanks for adding the formatter function!) (whatever we decide upon we should do the same for the tracker to be consistent in API imo, so probably add a formatter function there as well. But this can be done later on and in another issue.) |
+ improved a bit the code style + removed a piece of unused commented code
+ left the toggle to on (the new tooltip system) and a few comments + removed a few lines of XAML
renamed a variable + improved some comments
removed a call in OxyPlot.Wpf to Dispatcher.BeginInvoke after testing without it
… based + improved a bit the code style
removed a few useless comments + dispose the ToolTip in OxyPlot.Wpf when the PlotView is disposed
improved XML comments in the two CustomToolTip classes
solved some bugs about tooltip timing logic
…F and WinForms versions
CanvasRenderContext.currentToolTip
3c1d82e to
cb70700
Compare
|
@VisualMelon In your opinion is it good to start working on a global tooltip functionality? What I want to say is a new property |

this is a preview for #1081