#include <xtd/xtd>
class form1 : public form {
public:
form1() {
text(
"Translator example"_t);
client_size({500, 300});
controls().push_back_range({open_button, close_button, text_label});
open_button.location({10, 10});
open_button.text("Open"_t);
close_button.location({100, 10});
close_button.text("Close"_t);
text_label.location({10, 50});
text_label.auto_size(true);
text_label.text("The quick brown fox jumps over the lazy dog."_t);
}
private:
};
auto main() -> int {
try {
translator::locale("ru_RU");
} catch (const std::exception& e) {
message_box::show(string::format(
"Make sure specified locale is installed on your system :\n\n{}",
e.what()),
"Exception");
return -1;
}
application::run(form1 {});
}
xtd::forms::style_sheets::control label
The label data allows you to specify the box of a label control.
Definition label.hpp:25
xtd::forms::style_sheets::control button
The buttton data allows you to specify the box of a button control.
Definition button.hpp:25
@ e
The E key.
Definition console_key.hpp:96
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:17
# Main window caption
key "Translator example"
value "Пример перевода"
# Open button text
key "Open"
value "Oткрыто"
# Close button text
key "Close"
value "Закрыть"
# Label text
key "The quick brown fox jumps over the lazy dog."
value "Быстрый коричневый лис перепрыгивает через ленивого пса."