Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controls: add "open in new window" to default right-click menu #3730

Closed
swharden opened this issue Apr 25, 2024 · 3 comments
Closed

Controls: add "open in new window" to default right-click menu #3730

swharden opened this issue Apr 25, 2024 · 3 comments

Comments

@swharden
Copy link
Member

image

@swharden
Copy link
Member Author

swharden commented May 6, 2024

FYI, here's how it can be done using the existing API:

using ScottPlot;
using ScottPlot.WinForms;

namespace Sandbox.WinForms;

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        formsPlot1.Plot.Add.Signal(Generate.Sin());
        formsPlot1.Plot.Add.Signal(Generate.Cos());

        formsPlot1.Menu.Add("Open in New Window", OpenInNewWindow);
    }

    void OpenInNewWindow(IPlotControl ctrl)
    {
        FormsPlot fp = new() { Dock = DockStyle.Fill };
        fp.Reset(ctrl.Plot);

        Form form = new();
        form.Controls.Add(fp);
        form.ShowDialog();
    }
}

@heartacker
Copy link
Contributor

avalonia need this too

@swharden
Copy link
Member Author

avalonia need this too

Good point! ❤️

I don't recall whether the avalonia control already has a standalone plot viewer. Are you interested in implementing this and creating a PR? I can merge it in quickly and plan to release a new package by the end of the weekend 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants