mirror of https://github.com/odrling/Aegisub
parent
42248eabad
commit
b5e7bbc5ad
|
@ -76,7 +76,7 @@ namespace {
|
||||||
void update_from_textbox(wxCommandEvent&);
|
void update_from_textbox(wxCommandEvent&);
|
||||||
|
|
||||||
bool check_exists(int pos, int x, int y, int* lrud, double* orig, unsigned char tolerance);
|
bool check_exists(int pos, int x, int y, int* lrud, double* orig, unsigned char tolerance);
|
||||||
void process(wxCommandEvent&);
|
void process(wxEvent&);
|
||||||
public:
|
public:
|
||||||
DialogAlignToVideo(agi::Context* context);
|
DialogAlignToVideo(agi::Context* context);
|
||||||
~DialogAlignToVideo();
|
~DialogAlignToVideo();
|
||||||
|
@ -137,6 +137,7 @@ namespace {
|
||||||
CenterOnParent();
|
CenterOnParent();
|
||||||
|
|
||||||
Bind(wxEVT_BUTTON, &DialogAlignToVideo::process, this, wxID_OK);
|
Bind(wxEVT_BUTTON, &DialogAlignToVideo::process, this, wxID_OK);
|
||||||
|
Bind(wxEVT_LEFT_DCLICK, &DialogAlignToVideo::process, this, preview_frame->GetId());
|
||||||
SetIcon(GETICON(button_align_16));
|
SetIcon(GETICON(button_align_16));
|
||||||
if (maximized)
|
if (maximized)
|
||||||
wxDialog::Maximize(true);
|
wxDialog::Maximize(true);
|
||||||
|
@ -255,7 +256,7 @@ namespace {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogAlignToVideo::process(wxCommandEvent & evt)
|
void DialogAlignToVideo::process(wxEvent &)
|
||||||
{
|
{
|
||||||
auto n_frames = provider->GetFrameCount();
|
auto n_frames = provider->GetFrameCount();
|
||||||
auto w = provider->GetWidth();
|
auto w = provider->GetWidth();
|
||||||
|
@ -265,19 +266,16 @@ namespace {
|
||||||
if (!selected_x->GetValue().ToLong(&lx) || !selected_y->GetValue().ToLong(&ly) || !selected_tolerance->GetValue().ToLong(<))
|
if (!selected_x->GetValue().ToLong(&lx) || !selected_y->GetValue().ToLong(&ly) || !selected_tolerance->GetValue().ToLong(<))
|
||||||
{
|
{
|
||||||
wxMessageBox(_("Bad x or y position or tolerance value!"));
|
wxMessageBox(_("Bad x or y position or tolerance value!"));
|
||||||
evt.Skip();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lx < 0 || ly < 0 || lx >= w || ly >= h)
|
if (lx < 0 || ly < 0 || lx >= w || ly >= h)
|
||||||
{
|
{
|
||||||
wxMessageBox(wxString::Format(_("Bad x or y position! Require: 0 <= x < %i, 0 <= y < %i"), w, h));
|
wxMessageBox(wxString::Format(_("Bad x or y position! Require: 0 <= x < %i, 0 <= y < %i"), w, h));
|
||||||
evt.Skip();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lt < 0 || lt > 255)
|
if (lt < 0 || lt > 255)
|
||||||
{
|
{
|
||||||
wxMessageBox(_("Bad tolerance value! Require: 0 <= torlerance <= 255"));
|
wxMessageBox(_("Bad tolerance value! Require: 0 <= torlerance <= 255"));
|
||||||
evt.Skip();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int x = int(lx), y = int(ly);
|
int x = int(lx), y = int(ly);
|
||||||
|
|
|
@ -124,4 +124,9 @@ void ImagePositionPicker::OnMouseEvent(wxMouseEvent& evt)
|
||||||
if (x >= 0 && x < w && y >= 0 && y < h)
|
if (x >= 0 && x < w && y >= 0 && y < h)
|
||||||
update(x, y, image.GetRed(x, y), image.GetGreen(x, y), image.GetBlue(x, y));
|
update(x, y, image.GetRed(x, y), image.GetGreen(x, y), image.GetBlue(x, y));
|
||||||
}
|
}
|
||||||
|
else if (evt.LeftDClick()) {
|
||||||
|
// Propagate the double click event to submit
|
||||||
|
evt.ResumePropagation(wxEVENT_PROPAGATE_MAX);
|
||||||
|
evt.Skip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue