| 46 | #include <wx/msgdlg.h> |
| 47 | |
| 48 | SubtitlesPreview::SubtitlesPreview(wxWindow *parent, wxSize size, int winStyle, agi::Color col) |
| 49 | : wxWindow(parent, -1, wxDefaultPosition, size, winStyle) |
| 50 | , style(new AssStyle) |
| 51 | , back_color(col) |
| 52 | , sub_file(std::make_unique<AssFile>()) |
| 53 | , line(new AssDialogue) |
| 54 | { |
| 55 | line->Text = "{\\q2}preview"; |
| 56 | |
| 57 | SetStyle(*style); |
| 58 | |
| 59 | sub_file->LoadDefault(); |
| 60 | sub_file->Styles.push_back(*style); |
| 61 | sub_file->Events.push_back(*line); |
| 62 | |
| 63 | SetSizeHints(size.GetWidth(), size.GetHeight(), -1, -1); |
| 64 | wxSizeEvent evt(size); |
| 65 | OnSize(evt); |
| 66 | UpdateBitmap(); |
| 67 | |
| 68 | Bind(wxEVT_PAINT, &SubtitlesPreview::OnPaint, this); |
| 69 | Bind(wxEVT_SIZE, &SubtitlesPreview::OnSize, this); |
| 70 | } |
| 71 | |
| 72 | SubtitlesPreview::~SubtitlesPreview() { |
| 73 | } |
nothing calls this directly
no test coverage detected