#include <xtd/xtd>
namespace numeric_up_down_example {
class form1 : public form {
public:
form1() {
text("Numeric up down example");
active_control(numeric_up_down1);
numeric_up_down1.parent(*this);
numeric_up_down1.location({80, 50});
numeric_up_down1.wrapped(true);
numeric_up_down1.value_changed +=
delegate_ {
label1.text(string::format("value = {}", numeric_up_down1.value()));
};
cdebug << string::format("text = {}", numeric_up_down1.text()) << environment::new_line;
};
numeric_up_down1.value(50);
numeric_up_down2.parent(*this);
numeric_up_down2.location({80, 100});
numeric_up_down2.decimal_place(2);
numeric_up_down2.increment(.01);
numeric_up_down2.minimum(10.0);
numeric_up_down2.maximum(11.0);
label1.parent(*this);
label1.location({80, 150});
}
private:
numeric_up_down numeric_up_down1;
numeric_up_down numeric_up_down2;
label label1;
};
}
auto main() -> int {
application::run(numeric_up_down_example::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