add tick and on_tick event, fix unsaved document prompt, implement TextInput blinking cursor

This commit is contained in:
2018-10-08 01:00:49 +02:00
parent e2069fadca
commit c9c7b9f1c4
19 changed files with 226 additions and 46 deletions

View File

@@ -194,6 +194,24 @@ void NodeDialogSave::init_controls()
if (btn_ok->on_click)
btn_ok->on_click(btn_ok);
};
#if defined(_WIN32) || defined(__OSX__)
static char path_buffer[256];
btn_path = find<NodeButton>("btn-path");
btn_path->on_click = [this](Node*){
App::I.pick_dir([this](std::string path){
LOG("change working path to %s", path.c_str());
async_start();
App::I.work_path = path;
realpath(path.c_str(), path_buffer);
working_path->set_text_format("Working dir: %s", path_buffer);
async_update();
async_end();
});
};
working_path = find<NodeText>("path");
realpath(App::I.work_path.c_str(), path_buffer);
working_path->set_text_format("Working dir: %s", path_buffer);
#endif
}
void NodeDialogSave::loaded()
{
@@ -238,9 +256,12 @@ void NodeDialogNewDoc::init_controls()
btn_path->on_click = [this](Node*){
App::I.pick_dir([this](std::string path){
LOG("change working path to %s", path.c_str());
async_start();
App::I.work_path = path;
realpath(path.c_str(), path_buffer);
working_path->set_text_format("Working dir: %s", path_buffer);
async_update();
async_end();
});
};
working_path = find<NodeText>("path");