xtd - Reference Guide 0.2.0
xtd::forms::find_dialog Class Referencefinal

#include <find_dialog.h>

Definition

Represents a dialog box that displays find dialog.

Namespace
xtd::forms
Library
xtd.forms
Examples
The following code example demonstrates the use of find_dialog dialog.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Find dialog example");
find_button.parent(*this);
find_button.text("find...");
find_button.location({10, 10});
find_button.click += [&] {
find_dialog.show(*this);
};
find_dialog.title("Find");
find_dialog.find_string("Gammasoft");
find_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()));
};
}
private:
button find_button;
};
int main() {
application::run(form1 {});
}

Constructors

 find_dialog ()=default
 Initializes a new instance of the find_dialog class. More...
 

Properties

const xtd::ustringfind_string () const
 Gets the string to find. More...
 
find_dialogfind_string (const xtd::ustring &value)
 Sets the string to find. More...
 
xtd::drawing::point location () const
 Gets the coordinates of the upper-left corner of the dialog relative to the upper-left corner of the screen. More...
 
find_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. More...
 
bool match_case () const
 Gets the match case value. More...
 
find_dialogmatch_case (bool value)
 Sets the match case value. More...
 
xtd::forms::search_direction search_direction () const
 Gets the search direction value. More...
 
find_dialogsearch_direction (xtd::forms::search_direction value)
 Gets the search direction value. More...
 
bool show_match_case () const
 Gets a value that indicates whether match case option is shown. More...
 
find_dialogshow_match_case (bool value)
 Sets a value that indicates whether match case option is shown. More...
 
bool show_up_down () const
 Gets a value that indicates whether up down option is shown. More...
 
find_dialogshow_up_down (bool value)
 Sets a value that indicates whether up down option is shown. More...
 
bool show_whole_word () const
 Gets a value that indicates whether whole word option is shown. More...
 
find_dialogshow_whole_word (bool value)
 Sets a value that indicates whether whole word option is shown. More...
 
const xtd::ustringtitle () const
 Gets the find dialog title. More...
 
find_dialogtitle (const xtd::ustring &value)
 Sets the find dialog title. More...
 
bool whole_word () const
 Gets the whole word value. More...
 
find_dialogwhole_word (bool value)
 Sets the whole word value. More...
 

Events

xtd::event< find_dialog, xtd::forms::find_event_handlerfind_next
 Occurs when the user click the find button. More...
 
xtd::event< find_dialog, xtd::forms::dialog_closed_event_handlerdialog_closed
 Occurs when the user close the find dialog box with dialog close button or cancel button. More...
 

Methods

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

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ find_dialog()

xtd::forms::find_dialog::find_dialog ( )
default

Initializes a new instance of the find_dialog class.

Member Function Documentation

◆ close()

void xtd::forms::find_dialog::close ( )

Closes the find dialog box.

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

◆ find_string() [1/2]

const xtd::ustring& xtd::forms::find_dialog::find_string ( ) const

Gets the string to find.

Returns
The string to find.

◆ find_string() [2/2]

find_dialog& xtd::forms::find_dialog::find_string ( const xtd::ustring value)

Sets the string to find.

Parameters
valueThe string to find.
Returns
Current find_dialog instance.

◆ location() [1/2]

xtd::drawing::point xtd::forms::find_dialog::location ( ) const

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]

find_dialog& xtd::forms::find_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 find_dialog instance.

◆ match_case() [1/2]

bool xtd::forms::find_dialog::match_case ( ) const

Gets the match case value.

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

◆ match_case() [2/2]

find_dialog& xtd::forms::find_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 find_dialog instance.

◆ reset()

void xtd::forms::find_dialog::reset ( )

Resets all properties to default values.

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

◆ search_direction() [1/2]

xtd::forms::search_direction xtd::forms::find_dialog::search_direction ( ) const

Gets the search direction value.

Returns
One of xtd::forms::search_direction values. The default is xtd::forms::search_direction::down.

◆ search_direction() [2/2]

find_dialog& xtd::forms::find_dialog::search_direction ( xtd::forms::search_direction  value)

Gets the search direction value.

Parameters
valueOne of xtd::forms::search_direction values. The default is xtd::forms::search_direction::down.
Returns
Current find_dialog instance.

◆ show()

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

Runs find dialog box.

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

◆ show_match_case() [1/2]

bool xtd::forms::find_dialog::show_match_case ( ) const

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]

find_dialog& xtd::forms::find_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 find_dialog instance.

◆ show_up_down() [1/2]

bool xtd::forms::find_dialog::show_up_down ( ) const

Gets a value that indicates whether up down option is shown.

Returns
true if up down option is shown; otherwise false. The default is true.

◆ show_up_down() [2/2]

find_dialog& xtd::forms::find_dialog::show_up_down ( bool  value)

Sets a value that indicates whether up down option is shown.

Parameters
valuetrue if up down option is shown; otherwise false. The default is true.
Returns
Current find_dialog instance.

◆ show_whole_word() [1/2]

bool xtd::forms::find_dialog::show_whole_word ( ) const

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]

find_dialog& xtd::forms::find_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 find_dialog instance.

◆ title() [1/2]

const xtd::ustring& xtd::forms::find_dialog::title ( ) const

Gets the find dialog title.

Returns
The find dialog title.

◆ title() [2/2]

find_dialog& xtd::forms::find_dialog::title ( const xtd::ustring value)

Sets the find dialog title.

Parameters
valueThe find dialog title.
Returns
Current find_dialog instance.

◆ whole_word() [1/2]

bool xtd::forms::find_dialog::whole_word ( ) const

Gets the whole word value.

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

◆ whole_word() [2/2]

find_dialog& xtd::forms::find_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 find_dialog instance.

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