xtd.forms - Reference Guide  0.1.0
Modern c++17 library containing classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and Linux like Ubuntu operating system.
folder_browser_dialog.h
1 #pragma once
2 #include <xtd/environment.h>
3 #include <xtd/forms/folder_browser_dialog_flags.h>
4 #include "common_dialog.h"
5 
7 namespace xtd {
9  namespace forms {
11  public:
12  folder_browser_dialog() = default;
13 
14  bool auto_upgrade_enable() const {return this->get_option(BIF_USENEWUI);}
15  folder_browser_dialog& auto_upgrade_enable(bool value) {
16  this->set_option(BIF_USENEWUI, value);
17  return *this;
18  }
19 
20  const std::string& description() const {return description_;}
21  folder_browser_dialog& description(const std::string& value) {
22  description_ = value;
23  return *this;
24  }
25 
26  environment::special_folder root_folder() const {return root_folder_;}
27  folder_browser_dialog& root_folder(environment::special_folder value) {
28  root_folder_ = value;
29  return *this;
30  }
31 
32  const std::string& selected_path() const {return selected_path_;}
33  folder_browser_dialog& selected_path(const std::string& value) {
34  selected_path_ = value;
35  return *this;
36  }
37 
39  void reset() override;
40 
41  protected:
45  bool run_dialog(intptr_t owner) override;
46 
47  private:
48  bool get_option(size_t flag) const {return (this->options_ & flag) == flag;}
49  void set_option(size_t flag, bool value) {this->options_ = value ? this->options_ | flag : this->options_ & ~flag;}
50 
51  std::string description_;
52  environment::special_folder root_folder_ = environment::special_folder::desktop;
53  std::string selected_path_;
54  size_t options_ = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;
55  };
56  }
57 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: folder_browser_dialog.h:10
bool run_dialog(intptr_t owner) override
When overridden in a derived class, specifies a common dialog box.
void reset() override
Resets all options to their default values, the last selected color to black, and the custom colors t...
Specifies the base class used for displaying dialog boxes on the screen.
Definition: common_dialog.h:16