#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/button_images>
#include <xtd/forms/form>
#include <xtd/forms/track_bar>
#include <xtd/startup>
class form1 :
public form {
public:
form1() {
client_size({400, 100});
controls().push_back_range({track_bar1,
button1});
text(
"Track bar 2 example");
track_bar1.auto_size(false);
track_bar1.bounds({40, 10, 200, 80});
track_bar1.set_range(0, 100);
track_bar1.tick_frequency(10);
track_bar1.value_changed += [&] {
if (muted && track_bar1.value()) muted = false;
if (!muted || track_bar1.value()) volume = track_bar1.value();
};
track_bar1.value(60);
muted = !muted;
track_bar1.value(muted ? 0 : volume);
};
}
static auto main() {
}
private:
bool muted = false;
int volume = 0;
};
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31