xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::replace_dialog Class Referencefinal
Inheritance diagram for xtd::forms::replace_dialog:
xtd::forms::component xtd::object

Definition

Represents a dialog box that displays find dialog.

Header
#include <xtd/forms/replace_dialog>
Namespace
xtd::forms
Library
xtd.forms
Appearance
Windows macOS Gnome
Light  
 
 
 
 
 
Dark  
 
 
 
 
 
Examples
The following code example demonstrates the use of replace_dialog dialog.
#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 {});
}
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a Windows button control.
Definition button.h:49
Represents a form that displays debug form. This class cannot be inherited.
Definition debug_form.h:36
Provides data for the xtd::forms::find_dialog::find_next and xtd::forms::replace_dialog::find_next ev...
Definition find_event_args.h:25
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
Represents a dialog box that displays find dialog.
Definition replace_dialog.h: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.h: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.h:134
xtd::event< replace_dialog, xtd::forms::find_event_handler > find_next
Occurs when the user click the find button.
Definition replace_dialog.h: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.h:23
@ e
The E key.
@ text
The xtd::forms::status_bar_panel displays text in the standard font.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Examples
replace_dialog.cpp.

Public Events

xtd::event< replace_dialog, xtd::forms::find_event_handlerfind_next
 Occurs when the user click the find button.
 
xtd::event< replace_dialog, xtd::forms::replace_event_handlerreplace
 Occurs when the user click the replace button.
 
xtd::event< replace_dialog, xtd::forms::replace_event_handlerreplace_all
 Occurs when the user click the replace all button.
 
xtd::event< replace_dialog, xtd::forms::dialog_closed_event_handlerdialog_closed
 Occurs when the user close the replace dialog box with dialog close button or cancel button.
 

Public Constructors

 replace_dialog ()
 Initializes a new instance of the replace_dialog class.
 

Public Properties

const xtd::stringfind_string () const noexcept
 Gets the string to find.
 
replace_dialogfind_string (const xtd::string &value)
 Sets the string to find.
 
const xtd::stringreplace_string () const noexcept
 Gets the replaced string.
 
replace_dialogreplace_string (const xtd::string &value)
 Sets the replaced string.
 
xtd::drawing::point location () const noexcept
 Gets the coordinates of the upper-left corner of the dialog relative to the upper-left corner of the screen.
 
replace_dialoglocation (const xtd::drawing::point &value)
 Sets the coordinates of the upper-left corner of the dialog relative to the upper-left corner of the screen.
 
bool match_case () const noexcept
 Gets the match case value.
 
replace_dialogmatch_case (bool value)
 Sets the match case value.
 
bool show_match_case () const noexcept
 Gets a value that indicates whether match case option is shown.
 
replace_dialogshow_match_case (bool value)
 Sets a value that indicates whether match case option is shown.
 
bool show_whole_word () const noexcept
 Gets a value that indicates whether whole word option is shown.
 
replace_dialogshow_whole_word (bool value)
 Sets a value that indicates whether whole word option is shown.
 
const xtd::stringtitle () const noexcept
 Gets the find dialog title.
 
replace_dialogtitle (const xtd::string &value)
 Sets the find dialog title.
 
bool whole_word () const noexcept
 Gets the whole word value.
 
replace_dialogwhole_word (bool value)
 Sets the whole word value.
 

Public Methods

void close ()
 Closes the find dialog box.
 
void reset () noexcept
 Resets all properties to default values.
 
void show (const iwin32_window &owner)
 Runs find dialog box.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 
- Protected Member Functions inherited from xtd::forms::component
 component ()
 Initialises a new instance of the component class.
 
virtual bool can_raise_events () const noexcept
 Gets a value indicating whether the component can raise an event.
 
bool design_mode () const noexcept
 Gets a value that indicates whether the component is currently in design mode.
 

Constructor & Destructor Documentation

◆ replace_dialog()

xtd::forms::replace_dialog::replace_dialog ( )

Initializes a new instance of the replace_dialog class.

Member Function Documentation

◆ find_string() [1/2]

const xtd::string & xtd::forms::replace_dialog::find_string ( ) const
noexcept

Gets the string to find.

Returns
The string to find.
Examples
replace_dialog.cpp.

◆ find_string() [2/2]

replace_dialog & xtd::forms::replace_dialog::find_string ( const xtd::string value)

Sets the string to find.

Parameters
valueThe string to find.
Returns
Current replace_dialog instance.

◆ replace_string() [1/2]

const xtd::string & xtd::forms::replace_dialog::replace_string ( ) const
noexcept

Gets the replaced string.

Returns
The replaced string.
Examples
replace_dialog.cpp.

◆ replace_string() [2/2]

replace_dialog & xtd::forms::replace_dialog::replace_string ( const xtd::string value)

Sets the replaced string.

Parameters
valueThe replaced string.
Returns
Current replace_dialog instance.

◆ location() [1/2]

xtd::drawing::point xtd::forms::replace_dialog::location ( ) const
noexcept

Gets the coordinates of the upper-left corner of the dialog relative to the upper-left corner of the screen.

Returns
The point that represents the upper-left corner of the dialog relative to the upper-left corner of its screen.

◆ location() [2/2]

replace_dialog & xtd::forms::replace_dialog::location ( const xtd::drawing::point value)

Sets the coordinates of the upper-left corner of the dialog relative to the upper-left corner of the screen.

Parameters
valueThe point that represents the upper-left corner of the dialog relative to the upper-left corner of its screen.
Returns
Current replace_dialog instance.

◆ match_case() [1/2]

bool xtd::forms::replace_dialog::match_case ( ) const
noexcept

Gets the match case value.

Returns
true if match case option selected; otherwise false. The default is false.

◆ match_case() [2/2]

replace_dialog & xtd::forms::replace_dialog::match_case ( bool  value)

Sets the match case value.

Parameters
valuetrue if match case option selected; otherwise false. The default is false.
Returns
Current replace_dialog instance.

◆ show_match_case() [1/2]

bool xtd::forms::replace_dialog::show_match_case ( ) const
noexcept

Gets a value that indicates whether match case option is shown.

Returns
true if match case option is shown; otherwise false. The default is true.

◆ show_match_case() [2/2]

replace_dialog & xtd::forms::replace_dialog::show_match_case ( bool  value)

Sets a value that indicates whether match case option is shown.

Parameters
valuetrue if match case option is shown; otherwise false. The default is true.
Returns
Current replace_dialog instance.

◆ show_whole_word() [1/2]

bool xtd::forms::replace_dialog::show_whole_word ( ) const
noexcept

Gets a value that indicates whether whole word option is shown.

Returns
true if whole word option is shown; otherwise false. The default is true.

◆ show_whole_word() [2/2]

replace_dialog & xtd::forms::replace_dialog::show_whole_word ( bool  value)

Sets a value that indicates whether whole word option is shown.

Parameters
valuetrue if whole word option is shown; otherwise false. The default is true.
Returns
Current replace_dialog instance.

◆ title() [1/2]

const xtd::string & xtd::forms::replace_dialog::title ( ) const
noexcept

Gets the find dialog title.

Returns
The find dialog title.
Examples
replace_dialog.cpp.

◆ title() [2/2]

replace_dialog & xtd::forms::replace_dialog::title ( const xtd::string value)

Sets the find dialog title.

Parameters
valueThe find dialog title.
Returns
Current replace_dialog instance.

◆ whole_word() [1/2]

bool xtd::forms::replace_dialog::whole_word ( ) const
noexcept

Gets the whole word value.

Returns
true if whole word option selected; otherwise false. The default is false.

◆ whole_word() [2/2]

replace_dialog & xtd::forms::replace_dialog::whole_word ( bool  value)

Sets the whole word value.

Parameters
valuetrue if whole word option selected; otherwise false. The default is false.
Returns
Current replace_dialog instance.

◆ close()

void xtd::forms::replace_dialog::close ( )

Closes the find dialog box.

Remarks
If the find dialog box is already closed, this method does nothing.

◆ reset()

void xtd::forms::replace_dialog::reset ( )
noexcept

Resets all properties to default values.

Remarks
When you reset the xtd::forms::replace::dialog, the following read/write properties are set to initial values.
Property Value
title ""
find_string ""
replace_string ""
show_whole_word true
show_match_case true
whole_word false
match_case false

◆ show()

void xtd::forms::replace_dialog::show ( const iwin32_window owner)

Runs find dialog box.

Remarks
If the find dialog box is already displayed, this method does nothing.
Examples
replace_dialog.cpp.

Member Data Documentation

◆ find_next

xtd::event<replace_dialog, xtd::forms::find_event_handler> xtd::forms::replace_dialog::find_next

Occurs when the user click the find button.

Remarks
For more information about handling events, see Handling and Raising Events.
Examples
replace_dialog.cpp.

◆ replace

xtd::event<replace_dialog, xtd::forms::replace_event_handler> xtd::forms::replace_dialog::replace

Occurs when the user click the replace button.

Remarks
For more information about handling events, see Handling and Raising Events.
Examples
replace_dialog.cpp.

◆ replace_all

xtd::event<replace_dialog, xtd::forms::replace_event_handler> xtd::forms::replace_dialog::replace_all

Occurs when the user click the replace all button.

Remarks
For more information about handling events, see Handling and Raising Events.
Examples
replace_dialog.cpp.

◆ dialog_closed

xtd::event<replace_dialog, xtd::forms::dialog_closed_event_handler> xtd::forms::replace_dialog::dialog_closed

Occurs when the user close the replace dialog box with dialog close button or cancel button.

Remarks
The xtd::forms::dialog_closed_event_args::dialog_result is always set to xtd::forms::dialog_result::cancel
For more information about handling events, see Handling and Raising Events.

The documentation for this class was generated from the following file: