add tick and on_tick event, fix unsaved document prompt, implement TextInput blinking cursor
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user