xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::find_dialog Class Referencefinal
Inheritance diagram for xtd::forms::find_dialog:
xtd::forms::component xtd::object

Definition

Represents a dialog box that displays find dialog.

Header
#include <xtd/forms/find_dialog>
Namespace
xtd::forms
Library
xtd.forms
Appearance
Windows macOS Gnome
Light
Dark
Examples
The following code example demonstrates the use of find_dialog dialog.
#include <xtd/xtd>
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 += delegate_ {
find_dialog.show(*this);
};
find_dialog.title("Find");
find_dialog.find_string("Gammasoft");
find_dialog.find_next += delegate_(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()));
};
}
private:
debug_form df;
button find_button;
xtd::forms::find_dialog find_dialog;
};
auto main() -> int {
application::run(form1 {});
}
static auto write_line() -> void
Writes a line terminator to the trace listeners in the listeners collection.
Definition debug.hpp:344
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
Represents a dialog box that displays find dialog.
Definition find_dialog.hpp:38
auto show(const iwin32_window &owner) -> void
Runs find dialog box.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
static auto format(const basic_string< char > &fmt, args_t &&... args) -> basic_string
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:1018
xtd::forms::style_sheets::control button
The buttton data allows you to specify the box of a button control.
Definition button.hpp:25
@ e
The E key.
Definition console_key.hpp:96
Examples
find_dialog.cpp.

Public Events

xtd::event< find_dialog, xtd::forms::find_event_handlerfind_next
 Occurs when the user click the find button.
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.

Public Constructors

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

Public Properties

auto find_string () const noexcept -> const xtd::string &
 Gets the string to find.
auto find_string (const xtd::string &value) -> find_dialog &
 Sets the string to find.
auto location () const noexcept -> xtd::drawing::point
 Gets the coordinates of the upper-left corner of the dialog relative to the upper-left corner of the screen.
auto location (const xtd::drawing::point &value) -> find_dialog &
 Sets the coordinates of the upper-left corner of the dialog relative to the upper-left corner of the screen.
auto match_case () const noexcept -> bool
 Gets the match case value.
auto match_case (bool value) -> find_dialog &
 Sets the match case value.
auto search_direction () const noexcept -> xtd::forms::search_direction
 Gets the search direction value.
auto search_direction (xtd::forms::search_direction value) -> find_dialog &
 Gets the search direction value.
auto show_match_case () const noexcept -> bool
 Gets a value that indicates whether match case option is shown.
auto show_match_case (bool value) -> find_dialog &
 Sets a value that indicates whether match case option is shown.
auto show_up_down () const noexcept -> bool
 Gets a value that indicates whether up down option is shown.
auto show_up_down (bool value) -> find_dialog &
 Sets a value that indicates whether up down option is shown.
auto show_whole_word () const noexcept -> bool
 Gets a value that indicates whether whole word option is shown.
auto show_whole_word (bool value) -> find_dialog &
 Sets a value that indicates whether whole word option is shown.
auto title () const noexcept -> const xtd::string &
 Gets the find dialog title.
auto title (const xtd::string &value) -> find_dialog &
 Sets the find dialog title.
auto whole_word () const noexcept -> bool
 Gets the whole word value.
auto whole_word (bool value) -> find_dialog &
 Sets the whole word value.

Public Methods

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

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ find_dialog()

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

Initializes a new instance of the find_dialog class.

Member Function Documentation

◆ find_string() [1/2]

auto xtd::forms::find_dialog::find_string ( ) const -> const xtd::string &
nodiscardnoexcept

Gets the string to find.

Returns
The string to find.

◆ find_string() [2/2]

auto xtd::forms::find_dialog::find_string ( const xtd::string & value) -> find_dialog &

Sets the string to find.

Parameters
valueThe string to find.
Returns
Current find_dialog instance.

◆ location() [1/2]

auto xtd::forms::find_dialog::location ( ) const -> xtd::drawing::point
nodiscardnoexcept

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]

auto xtd::forms::find_dialog::location ( const xtd::drawing::point & value) -> find_dialog &

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]

auto xtd::forms::find_dialog::match_case ( ) const -> bool
nodiscardnoexcept

Gets the match case value.

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

◆ match_case() [2/2]

auto xtd::forms::find_dialog::match_case ( bool value) -> find_dialog &

Sets the match case value.

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

◆ search_direction() [1/2]

auto xtd::forms::find_dialog::search_direction ( ) const -> xtd::forms::search_direction
nodiscardnoexcept

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]

auto xtd::forms::find_dialog::search_direction ( xtd::forms::search_direction value) -> find_dialog &

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_match_case() [1/2]

auto xtd::forms::find_dialog::show_match_case ( ) const -> bool
nodiscardnoexcept

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]

auto xtd::forms::find_dialog::show_match_case ( bool value) -> find_dialog &

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]

auto xtd::forms::find_dialog::show_up_down ( ) const -> bool
nodiscardnoexcept

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]

auto xtd::forms::find_dialog::show_up_down ( bool value) -> find_dialog &

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]

auto xtd::forms::find_dialog::show_whole_word ( ) const -> bool
nodiscardnoexcept

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]

auto xtd::forms::find_dialog::show_whole_word ( bool value) -> find_dialog &

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]

auto xtd::forms::find_dialog::title ( ) const -> const xtd::string &
nodiscardnoexcept

Gets the find dialog title.

Returns
The find dialog title.

◆ title() [2/2]

auto xtd::forms::find_dialog::title ( const xtd::string & value) -> find_dialog &

Sets the find dialog title.

Parameters
valueThe find dialog title.
Returns
Current find_dialog instance.

◆ whole_word() [1/2]

auto xtd::forms::find_dialog::whole_word ( ) const -> bool
nodiscardnoexcept

Gets the whole word value.

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

◆ whole_word() [2/2]

auto xtd::forms::find_dialog::whole_word ( bool value) -> find_dialog &

Sets the whole word value.

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

◆ close()

auto xtd::forms::find_dialog::close ( ) -> void

Closes the find dialog box.

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

◆ reset()

auto xtd::forms::find_dialog::reset ( ) -> void
noexcept

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

◆ show()

auto xtd::forms::find_dialog::show ( const iwin32_window & owner) -> void

Runs find dialog box.

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

Member Data Documentation

◆ find_next

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

Occurs when the user click the find button.

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

◆ dialog_closed

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

Occurs when the user close the find 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: