xtd 0.2.0
replace_dialog.h
Go to the documentation of this file.
1 #pragma once
6 #include "component.h"
8 #include "dialog_appearance.h"
9 #include "find_event_handler.h"
10 #include "replace_event_handler.h"
11 #include "iwin32_window.h"
12 #include <xtd/drawing/point>
13 #include <xtd/event>
14 #include <xtd/ustring>
15 
17 namespace xtd {
19  namespace forms {
36  class forms_export_ replace_dialog final : public component {
37  struct data;
38 
39  public:
41 
46 
48  ~replace_dialog();
50 
52 
56  const xtd::ustring& find_string() const noexcept;
60  replace_dialog& find_string(const xtd::ustring& value);
61 
64  const xtd::ustring& replace_string() const noexcept;
68  replace_dialog& replace_string(const xtd::ustring& value);
69 
72  xtd::drawing::point location() const noexcept;
77 
80  bool match_case() const noexcept;
84  replace_dialog& match_case(bool value);
85 
88  bool show_match_case() const noexcept;
92  replace_dialog& show_match_case(bool value);
93 
96  bool show_whole_word() const noexcept;
100  replace_dialog& show_whole_word(bool value);
101 
104  const xtd::ustring& title() const noexcept;
108  replace_dialog& title(const xtd::ustring& value);
109 
112  bool whole_word() const noexcept;
116  replace_dialog& whole_word(bool value);
118 
120 
125 
129 
133 
139 
141 
145  void close();
146 
158  void reset() noexcept;
159 
162  void show(const iwin32_window& owner);
164 
165  private:
166  void create_handle();
167  void destroy_handle();
168  void recreate_handle();
169  void on_dialog_closed();
170  void on_dialog_find(const xtd::drawing::point& location, const ustring& find_string, const ustring& replace_string, bool whole_word, bool match_case);
171  void on_dialog_replace(const xtd::drawing::point& location, const ustring& find_string, const ustring& replace_string, bool replace_all, bool whole_word, bool match_case);
172 
173  std::shared_ptr<data> data_;
174  };
175  }
176 }
xtd::event< replace_dialog, xtd::forms::replace_event_handler > replace
Occurs when the user click the replace button.
Definition: replace_dialog.h:128
Contains xtd::forms::dialog_appearance enum class.
Contains xtd::forms::dialog_closed_event_handler dialog.
Contains xtd::forms::layout::arranged_element_collection collection.
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Contains xtd::forms::iwin32_window interface.
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:21
Represents an event.
Definition: event.h:21
Represents a dialog box that displays find dialog.
Definition: replace_dialog.h:36
Contains xtd::forms::replace_event_handler event handler.
xtd::event< replace_dialog, xtd::forms::dialog_closed_event_handler > dialog_closed
Occurs when the user close the replace dialog box with dialog close button or cancel button...
Definition: replace_dialog.h:137
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Contains xtd::forms::component class.
Specifies that both the x and y coordinates of the control are defined.
xtd::event< replace_dialog, xtd::forms::replace_event_handler > replace_all
Occurs when the user click the replace all button.
Definition: replace_dialog.h:132
xtd::event< replace_dialog, xtd::forms::find_event_handler > find_next
Occurs when the user click the find button.
Definition: replace_dialog.h:124
Provides the base implementation and enables object sharing between applications. ...
Definition: component.h:23
Contains xtd::forms::find_event_handler event handler.