#pragma once
#include <wx/wx.h>
#include <wx/popupwin.h>
#include "model/TrackPiece.h"
#include "canvas/Renderer.h"
#include "canvas/CanvasState.h"

class PiecePreviewPopup : public wxPopupWindow {
public:
    PiecePreviewPopup(wxWindow* parent);
    void ShowForPiece(const MC::TrackPiece* piece, const wxPoint& screenPos);
    void Hide();

private:
    void OnPaint(wxPaintEvent&);
    const MC::TrackPiece* m_piece = nullptr;
    MC::Renderer m_renderer;
    static const int W = 80;
    static const int H = 55;
    wxDECLARE_EVENT_TABLE();
};
