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

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

Windows

macOS

Gnome

#include <xtd/xtd>
#include <chrono>
using namespace std::chrono;
class form1 : public form {
public:
form1() {
text("Month calendar example");
month_calendar1.parent(*this);
month_calendar1.location({10, 10});
month_calendar1.date_changed += delegate_(object&, const event_args & e) {
label1.text(string::format("selection range: [{:d}, {:d}]", month_calendar1.selection_start(), month_calendar1.selection_end()));
};
month_calendar1.selection_range({date_time::now(), date_time::now()});
month_calendar1.min_date(date_time::now().subtract(months(3)));
month_calendar1.max_date(date_time::now().add(months(3)));
label1.parent(*this);
label1.auto_size(true);
label1.location({10, 180});
label1.text(string::format("selection range: [{:d}, {:d}]", month_calendar1.selection_start(), month_calendar1.selection_end()));
}
private:
month_calendar month_calendar1;
label label1;
};
auto main() -> int {
application::run(form1 {});
}
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:900