26 size_ = default_size();
41 if (control::dock() != dock_style::left && control::dock() == dock_style::right && control::dock() == dock_style::top && control::dock() == dock_style::bottom)
throw argument_exception(
"splitter control must be docked left, right, top, or bottom."_t,
current_stack_frame_);
44 if (default_width_ && (dock == dock_style::left || dock == dock_style::right))
width(3);
45 if (default_width_ && (dock == dock_style::top || dock == dock_style::bottom))
height(3);
51 virtual int min_size()
const {
return min_size_;}
56 if (min_size_ != min_size) {
81 control::on_mouse_down(
e);
82 mouse_down_location = control::dock() == dock_style::left || control::dock() == dock_style::right ? cursor::position().x() : cursor::position().y();
83 if (parent().has_value()) {
84 for(
size_t index = 0; index < parent().value().get().controls().size(); index++) {
85 if (parent().value().get().controls()[index].get() == *
this) {
86 if (index > 0) previous_control_cursor_ = (previous_control_ = &parent().value().get().controls()[index - 1].get())->
cursor();
87 if (index < parent().value().get().controls().size() -1) next_control_cursor_ = (next_control_ = &parent().value().get().controls()[index + 1].get())->
cursor();
92 if (previous_control_) previous_control_->
cursor(default_cursor());
93 if (next_control_) next_control_->cursor(default_cursor());
97 control::on_mouse_move(
e);
98 if (previous_control_) previous_control_->cursor(default_cursor());
99 if (next_control_) next_control_->cursor(default_cursor());
100 if (mouse_down_location != -1 && next_control_) {
101 if (splitter_style_ == splitter_style::draw_line) {
104 int delta_size = control::dock() == dock_style::left || control::dock() == dock_style::right ? (next_control_->width() + cursor::position().x()) : (next_control_->height() + cursor::position().y());
105 int new_size = delta_size - mouse_down_location;
106 if (new_size < min_size_) new_size = min_size_;
108 if (control::dock() == dock_style::left || control::dock() == dock_style::right) next_control_->width(new_size);
109 else next_control_->height(new_size);
110 mouse_down_location = control::dock() == dock_style::left || control::dock() == dock_style::right ? cursor::position().x() : cursor::position().y();
116 control::on_mouse_up(
e);
117 if (previous_control_) previous_control_->cursor(previous_control_cursor_);
118 if (next_control_) next_control_->cursor(previous_control_cursor_);
119 if (mouse_down_location != -1 && parent().has_value() && next_control_) {
120 int new_size = (control::dock() == dock_style::left || control::dock() == dock_style::right ? (next_control_->width() + cursor::position().x()) : (next_control_->height() + cursor::position().y())) - mouse_down_location;
121 if (new_size < min_size_) new_size = min_size_;
122 if (control::dock() == dock_style::left || control::dock() == dock_style::right) next_control_->width(new_size);
123 else next_control_->height(new_size);
124 mouse_down_location = -1;
126 previous_control_ =
nullptr;
127 next_control_ =
nullptr;
131 control::on_handle_created(
e);
135 bool default_width_ =
true;
139 int mouse_down_location = -1;
143 control* previous_control_ =
nullptr;
144 control* next_control_ =
nullptr;
Contains xtd::argument_exception exception.
The exception that is thrown when one of the arguments provided to a method is not valid.
Definition: argument_exception.h:19
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
Contains xtd::forms::control control.
#define forms_export_
Define shared library export.
Definition: forms_export.h:13
#define current_stack_frame_
Provides information about the current stack frame.
Definition: stack_frame.h:201
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::forms::splitter_style enum class.