xtd 0.2.0
Loading...
Searching...
No Matches
h_scroll_bar.cpp

demonstrates the use of xtd::forms::h_scroll_bar control.

Windows

macOS

Gnome

#include <xtd/diagnostics/debug>
#include <xtd/forms/application>
#include <xtd/forms/debug_form>
#include <xtd/forms/form>
#include <xtd/forms/h_scroll_bar>
using namespace xtd::forms;
namespace h_scroll_bar_example {
class form1 : public form {
public:
form1() {
text("horizontal scroll bar example");
h_scroll_bar1.parent(*this);
h_scroll_bar1.location({30, 40});
h_scroll_bar2.parent(*this);
h_scroll_bar2.location({30, 80});
h_scroll_bar2.large_change(2);
h_scroll_bar2.minimum(0);
h_scroll_bar2.maximum(20);
h_scroll_bar2.value(10);
h_scroll_bar2.width(220);
h_scroll_bar2.scroll += [&] {
xtd::diagnostics::debug::write_line(xtd::string::format("h_scroll_bar2 value = {}", h_scroll_bar2.value()));
};
}
private:
h_scroll_bar h_scroll_bar1;
h_scroll_bar h_scroll_bar2;
};
}
auto main() -> int {
application::run(h_scroll_bar_example::form1 {});
}
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition debug.h:361
Represents a form that displays debug form. This class cannot be inherited.
Definition debug_form.h:36
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
Represents a standard Windows horizontal scroll bar.
Definition h_scroll_bar.h:29
static basic_string format(const basic_string< char > &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12