xtd 0.2.0
replace_dialog.cpp

demonstrates the use of xtd::forms::replace_dialog dialog.

Windows
replace_dialog_w.png

replace_dialog_wd.png
macOS
replace_dialog_m.png

replace_dialog_md.png
Gnome
replace_dialog_g.png

replace_dialog_gd.png
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/debug_form>
#include <xtd/forms/form>
#include <xtd/forms/replace_dialog>
#include <xtd/diagnostics/debug>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Replace dialog example");
replace_button.parent(*this);
replace_button.text("replace...");
replace_button.location({10, 10});
replace_button.click += [&] {
};
replace_dialog.title("Replace");
replace_dialog.find_next += [&](object& sender, const find_event_args& e) {
diagnostics::debug::write_line(ustring::format("Find next : find string [{}], match case [{}], search direction [{}], whole word [{}]", e.find_string(), e.match_case(), e.search_direction(), e.whole_word()));
};
replace_dialog.replace += [&](object& sender, const replace_event_args& e) {
diagnostics::debug::write_line(ustring::format("Replace : find string [{}], replace string [{}], match case [{}], whole word [{}]", e.find_string(), e.replace_string(), e.match_case(), e.whole_word()));
};
replace_dialog.replace_all += [&](object& sender, const replace_event_args& e) {
diagnostics::debug::write_line(ustring::format("Replace all : find string [{}], replace string [{}], match case [{}], whole word [{}]", e.find_string(), e.replace_string(), e.match_case(), e.whole_word()));
};
}
private:
button replace_button;
};
auto main()->int {
application::run(form1 {});
}