Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[example] Add ToggleButton. #111

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/widgets_example.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ namespace WidgetsExample
checkBox1 = std::make_unique<gcn::CheckBox>("Checkbox 1");
checkBox2 = std::make_unique<gcn::CheckBox>("Checkbox 2");

toggleButton = std::make_unique<gcn::ToggleButton>("Toggle button");

radioButton1 = std::make_unique<gcn::RadioButton>("Radio Button 1", "radiogroup", true);
radioButton2 = std::make_unique<gcn::RadioButton>("Radio Button 2", "radiogroup");
radioButton3 = std::make_unique<gcn::RadioButton>("Radio Button 3", "radiogroup");
Expand Down Expand Up @@ -138,10 +140,11 @@ namespace WidgetsExample
top->add(dropDown.get(), 580, 10);
top->add(checkBox1.get(), 580, 50);
top->add(checkBox2.get(), 580, 70);
top->add(toggleButton.get(), 580, 90);
top->add(radioButton1.get(), 580, 120);
top->add(radioButton2.get(), 580, 140);
top->add(radioButton3.get(), 580, 160);
top->add(slider.get(), 580, 200);
top->add(slider.get(), 580, 180);
top->add(window.get(), 100, 350);
top->add(nestedScrollArea.get(), 440, 350);

Expand Down Expand Up @@ -206,6 +209,7 @@ namespace WidgetsExample
std::unique_ptr<gcn::RadioButton> radioButton1; // Three radio buttons
std::unique_ptr<gcn::RadioButton> radioButton2;
std::unique_ptr<gcn::RadioButton> radioButton3;
std::unique_ptr<gcn::ToggleButton> toggleButton;
std::unique_ptr<gcn::Slider> slider; // A slider
std::unique_ptr<gcn::Image> image; // An image for the icon
std::unique_ptr<gcn::Window> window;
Expand Down