demonstrates the use of xtd::forms::form control.
- Windows
-
- macOS
-
- Gnome
-
#include <xtd/xtd>
auto main() -> int {
auto button1_clicked = 0, button2_clicked = 0;
button button1, button2;
label label1, label2;
form form1;
button1.text("Button 1").location({50, 50});
button2.auto_repeat(true).text("Button 2").location({50, 100}).size({200, 75});
label1.text("Button 1 clicked 0 times").location({50, 200}).width(200);
label2.text("Button 2 clicked 0 times").location({50, 230}).width(200);
button1.click +=
delegate_ {label1.text(string::format(
"Button 1 clicked {} times", ++button1_clicked));};
button2.click +=
delegate_ {label2.text(string::format(
"Button 2 clicked {} times", ++button2_clicked));};
form1.text("Button 2 example");
form1.controls().add_range({button1, button2, label1, label2});
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:942