mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-08-28 17:01:02 +00:00
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#pragma once
|
|
|
|
// VariantImagePreviewDialog: small modeless popup that shows a single card
|
|
// preview image (bytes decoded as wxImage). Used by Japanese Pokémon Add/Edit
|
|
// when cycling UnnumberedPromo prints. Prev/Next fire custom events so the
|
|
// edit dialog owns the variant ring.
|
|
|
|
#include <wx/button.h>
|
|
#include <wx/dialog.h>
|
|
#include <wx/event.h>
|
|
#include <wx/image.h>
|
|
#include <wx/panel.h>
|
|
#include <wx/stattext.h>
|
|
#include <wx/string.h>
|
|
|
|
#include <string_view>
|
|
|
|
namespace ccm::ui {
|
|
|
|
wxDECLARE_EVENT(EVT_VARIANT_PREVIEW_PREV, wxCommandEvent);
|
|
wxDECLARE_EVENT(EVT_VARIANT_PREVIEW_NEXT, wxCommandEvent);
|
|
|
|
class VariantImagePreviewDialog : public wxDialog {
|
|
public:
|
|
explicit VariantImagePreviewDialog(wxWindow* parent);
|
|
|
|
void setCaption(const wxString& caption);
|
|
void setImageBytes(std::string_view bytes);
|
|
void clearImage();
|
|
void setNavigationEnabled(bool enabled);
|
|
void repositionBesideParent();
|
|
|
|
private:
|
|
class ImageCanvas;
|
|
|
|
void onPrev(wxCommandEvent&);
|
|
void onNext(wxCommandEvent&);
|
|
|
|
ImageCanvas* imageHost_{nullptr};
|
|
wxStaticText* caption_{nullptr};
|
|
wxButton* prevButton_{nullptr};
|
|
wxButton* nextButton_{nullptr};
|
|
};
|
|
|
|
} // namespace ccm::ui
|