xtd 0.2.0
Loading...
Searching...
No Matches
replace_dialog.cpp

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

Windows

macOS

Gnome

#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(string::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(string::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(string::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 {});
}
Represents a Windows button control.
Definition button.hpp:49
Represents a form that displays debug form. This class cannot be inherited.
Definition debug_form.hpp:36
Provides data for the xtd::forms::find_dialog::find_next and xtd::forms::replace_dialog::find_next ev...
Definition find_event_args.hpp:25
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a dialog box that displays find dialog.
Definition replace_dialog.hpp:38
void show(const iwin32_window &owner)
Runs find dialog box.
const xtd::string & find_string() const noexcept
Gets the string to find.
xtd::event< replace_dialog, xtd::forms::replace_event_handler > replace
Occurs when the user click the replace button.
Definition replace_dialog.hpp:130
const xtd::string & title() const noexcept
Gets the find dialog title.
xtd::event< replace_dialog, xtd::forms::replace_event_handler > replace_all
Occurs when the user click the replace all button.
Definition replace_dialog.hpp:134
xtd::event< replace_dialog, xtd::forms::find_event_handler > find_next
Occurs when the user click the find button.
Definition replace_dialog.hpp:126
const xtd::string & replace_string() const noexcept
Gets the replaced string.
Provides data for the xtd::forms::replace_dialog::replace and xtd::forms::replace_dialog::replace_all...
Definition replace_event_args.hpp:23
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10