add save dialog to specify file name
This commit is contained in:
@@ -66,9 +66,6 @@ void NodeDialogOpen::init_controls()
|
||||
|
||||
void NodeDialogOpen::loaded()
|
||||
{
|
||||
// ui::Image thumb = ui::Canvas::I->thumbnail_read(data_path);
|
||||
// auto image_tex = find<NodeImageTexture>("thumb-tex");
|
||||
// image_tex->tex.create(thumb);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
@@ -126,4 +123,37 @@ kEventResult NodeDialogOpenItem::handle_event(Event* e)
|
||||
break;
|
||||
}
|
||||
return kEventResult::Consumed;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
Node* NodeDialogSave::clone_instantiate() const
|
||||
{
|
||||
return new NodeDialogSave;
|
||||
}
|
||||
void NodeDialogSave::clone_finalize(Node* dest) const
|
||||
{
|
||||
NodeDialogSave* n = static_cast<NodeDialogSave*>(dest);
|
||||
n->init_controls();
|
||||
}
|
||||
void NodeDialogSave::init()
|
||||
{
|
||||
auto tpl = static_cast<const NodeBorder*>(init_template("dialog-save"));
|
||||
m_color = tpl->m_color;
|
||||
m_border_color = tpl->m_border_color;
|
||||
m_thinkness = tpl->m_thinkness;
|
||||
init_controls();
|
||||
}
|
||||
void NodeDialogSave::init_controls()
|
||||
{
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
input = find<NodeTextInput>("txt-input");
|
||||
}
|
||||
void NodeDialogSave::loaded()
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user