HackStudio: Use the GWidget class registry to populate the toolbar
This will allow HackStudio to learn about new GWidget types without having to do anything in HackStudio :^)
BIN
Base/res/icons/widgets/GButton.png
Normal file
After Width: | Height: | Size: 266 B |
BIN
Base/res/icons/widgets/GCheckBox.png
Normal file
After Width: | Height: | Size: 184 B |
BIN
Base/res/icons/widgets/GGroupBox.png
Normal file
After Width: | Height: | Size: 177 B |
BIN
Base/res/icons/widgets/GLabel.png
Normal file
After Width: | Height: | Size: 162 B |
BIN
Base/res/icons/widgets/GProgressBar.png
Normal file
After Width: | Height: | Size: 186 B |
BIN
Base/res/icons/widgets/GRadioButton.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
Base/res/icons/widgets/GScrollBar.png
Normal file
After Width: | Height: | Size: 239 B |
BIN
Base/res/icons/widgets/GSlider.png
Normal file
After Width: | Height: | Size: 177 B |
BIN
Base/res/icons/widgets/GSpinBox.png
Normal file
After Width: | Height: | Size: 261 B |
BIN
Base/res/icons/widgets/GTextBox.png
Normal file
After Width: | Height: | Size: 243 B |
|
@ -127,9 +127,16 @@ int main(int argc, char** argv)
|
||||||
auto form_widgets_toolbar = GToolBar::construct(Orientation::Vertical, 26, g_form_inner_container);
|
auto form_widgets_toolbar = GToolBar::construct(Orientation::Vertical, 26, g_form_inner_container);
|
||||||
form_widgets_toolbar->set_preferred_size(38, 0);
|
form_widgets_toolbar->set_preferred_size(38, 0);
|
||||||
|
|
||||||
form_widgets_toolbar->add_action(GAction::create("GLabel", GraphicsBitmap::load_from_file("/res/icons/vbwidgets/label.png"), [&](auto&) {}));
|
form_widgets_toolbar->add_action(GAction::create("Cursor", GraphicsBitmap::load_from_file("/res/cursors/arrow.png"), [&](auto&) {
|
||||||
form_widgets_toolbar->add_action(GAction::create("GButton", GraphicsBitmap::load_from_file("/res/icons/vbwidgets/button.png"), [&](auto&) {}));
|
}));
|
||||||
form_widgets_toolbar->add_action(GAction::create("GSpinBox", GraphicsBitmap::load_from_file("/res/icons/vbwidgets/spinbox.png"), [&](auto&) {}));
|
|
||||||
|
GWidgetClassRegistration::for_each([&](const GWidgetClassRegistration& reg) {
|
||||||
|
auto icon_path = String::format("/res/icons/widgets/%s.png", reg.class_name().characters());
|
||||||
|
auto action = GAction::create(reg.class_name(), GraphicsBitmap::load_from_file(icon_path), [&](auto&) {
|
||||||
|
|
||||||
|
});
|
||||||
|
form_widgets_toolbar->add_action(move(action));
|
||||||
|
});
|
||||||
|
|
||||||
auto form_editor_inner_splitter = GSplitter::construct(Orientation::Horizontal, g_form_inner_container);
|
auto form_editor_inner_splitter = GSplitter::construct(Orientation::Horizontal, g_form_inner_container);
|
||||||
|
|
||||||
|
|