xtd - Reference Guide 0.2.0
find_box.h
Go to the documentation of this file.
1 #pragma once
5 #include <memory>
6 #include <xtd/static.h>
7 #include "find_dialog.h"
8 
10 namespace xtd {
12  namespace forms {
22  class find_box final static_ {
23  public:
25 
30  template<typename find_next_callback_t>
31  static void show(const iwin32_window& owner, find_next_callback_t find_next) {show_find_box(owner, xtd::forms::find_event_handler(find_next));}
36  template<typename find_next_callback_t>
37  static void show(const iwin32_window& owner, const xtd::ustring& find_string, find_next_callback_t find_next) {show_find_box(owner, xtd::forms::find_event_handler(find_next), find_string);}
43  template<typename find_next_callback_t>
44  static void show(const iwin32_window& owner, const xtd::ustring& find_string, const xtd::ustring& title, find_next_callback_t find_next) {show_find_box(owner, xtd::forms::find_event_handler(find_next), find_string, title);}
51  template<typename find_next_callback_t>
52  static void show(const iwin32_window& owner, const xtd::ustring& find_string, const xtd::ustring& title, bool match_case, find_next_callback_t find_next) {show_find_box(owner, xtd::forms::find_event_handler(find_next), find_string, title, match_case);}
60  template<typename find_next_callback_t>
61  static void show(const iwin32_window& owner, const xtd::ustring& find_string, const xtd::ustring& title, bool match_case, xtd::forms::search_direction search_direction, find_next_callback_t find_next) {show_find_box(owner, xtd::forms::find_event_handler(find_next), find_string, title, match_case, search_direction);}
70  template<typename find_next_callback_t>
71  static void show(const iwin32_window& owner, const xtd::ustring& find_string, const xtd::ustring& title, bool match_case, xtd::forms::search_direction search_direction, bool whole_word, find_next_callback_t find_next) {show_find_box(owner, xtd::forms::find_event_handler(find_next), find_string, title, match_case, search_direction, whole_word);}
73 
74  private:
75  static void show_find_box(const iwin32_window& owner, xtd::forms::find_event_handler find_next, const xtd::ustring& find_string = "", const xtd::ustring& title = "", bool match_case = false, xtd::forms::search_direction search_direction = xtd::forms::search_direction::down, bool whole_word = false) {
76  auto dialog = new xtd::forms::find_dialog();
77  dialog->title(title).find_string(find_string).match_case(match_case).search_direction(search_direction).whole_word(whole_word);
78  dialog->show(owner);
79  dialog->find_next += find_next;
80  dialog->dialog_closed += [dialog] {
81  delete dialog;
82  };
83  }
84  };
85  }
86 }
Contains xtd::forms::find_dialog dialog.
Contains xtd::static_object class.
static void show(const iwin32_window &owner, const xtd::ustring &find_string, const xtd::ustring &title, bool match_case, find_next_callback_t find_next)
Displays a find dialog box.
Definition: find_box.h:52
static void show(const iwin32_window &owner, find_next_callback_t find_next)
Displays a find dialog box.
Definition: find_box.h:31
#define static_
This keyword is use to represent a static object. A static object can&#39;t be instantiated (constructors...
Definition: static.h:38
delegate< void(object &sender, const find_event_args &e)> find_event_handler
Represents the method that will handle the xtd::forms::find_dialog::find_next event of the xtd::forms...
Definition: find_event_handler.h:21
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
static void show(const iwin32_window &owner, const xtd::ustring &find_string, const xtd::ustring &title, bool match_case, xtd::forms::search_direction search_direction, find_next_callback_t find_next)
Displays a find dialog box.
Definition: find_box.h:61
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:50
Search direction down.
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:19
Represents a common dialog box that displays a find dialog. This class cannot be inherited.
Definition: find_box.h:22
static void show(const iwin32_window &owner, const xtd::ustring &find_string, find_next_callback_t find_next)
Displays a find dialog box.
Definition: find_box.h:37
static void show(const iwin32_window &owner, const xtd::ustring &find_string, const xtd::ustring &title, bool match_case, xtd::forms::search_direction search_direction, bool whole_word, find_next_callback_t find_next)
Displays a find dialog box.
Definition: find_box.h:71
search_direction
Specifies the search direction for xtd::forms::find_dialog dialog.
Definition: search_direction.h:17
static void show(const iwin32_window &owner, const xtd::ustring &find_string, const xtd::ustring &title, find_next_callback_t find_next)
Displays a find dialog box.
Definition: find_box.h:44
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Represents a dialog box that displays find dialog.
Definition: find_dialog.h:29