Use the generated goto_frame.xml.h file in cmd_goto_frame.cpp

This commit is contained in:
David Capello 2015-09-22 17:25:48 -03:00
parent 63aac49f81
commit 52d091810b

View File

@ -19,6 +19,8 @@
#include "doc/sprite.h"
#include "ui/window.h"
#include "goto_frame.xml.h"
namespace app {
using namespace ui;
@ -117,17 +119,15 @@ protected:
frame_t onGetFrame(Editor* editor) override {
if (m_frame == 0) {
base::UniquePtr<Window> window(app::load_widget<Window>("goto_frame.xml", "goto_frame"));
Widget* frame = app::find_widget<Widget>(window, "frame");
Widget* ok = app::find_widget<Widget>(window, "ok");
app::gen::GotoFrame window;
frame->setTextf("%d", editor->frame()+1);
window.frame()->setTextf("%d", editor->frame()+1);
window->openWindowInForeground();
if (window->getKiller() != ok)
window.openWindowInForeground();
if (window.getKiller() != window.ok())
return editor->frame();
m_frame = frame->getTextInt();
m_frame = window.frame()->getTextInt();
}
return MID(0, m_frame-1, editor->sprite()->lastFrame());