MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / scrollAreaHandler

Method scrollAreaHandler

source/windowing/StarWidgetParsing.cpp:764–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762}
763
764WidgetConstructResult WidgetParser::scrollAreaHandler(String const& name, Json const& config) {
765 auto scrollArea = make_shared<ScrollArea>();
766
767 if (config.contains("buttons"))
768 scrollArea->setButtonImages(config.get("buttons"));
769 if (config.contains("thumbs"))
770 scrollArea->setThumbImages(config.get("thumbs"));
771
772 if (config.contains("children"))
773 constructImpl(config.get("children"), scrollArea.get());
774
775 if (config.contains("horizontalScroll"))
776 scrollArea->setHorizontalScroll(config.getBool("horizontalScroll"));
777 if (config.contains("verticalScroll"))
778 scrollArea->setVerticalScroll(config.getBool("verticalScroll"));
779
780 scrollArea->setUpdatesChildren(config.getBool("updatesChildren", false));
781
782 common(scrollArea, config, false);
783 return WidgetConstructResult(scrollArea, name, config.getFloat("zlevel", 0));
784}
785
786void WidgetParser::common(WidgetPtr widget, Json const& config, bool getChildren) {
787 if (config.contains("rect")) {

Callers

nothing calls this directly

Calls 10

setButtonImagesMethod · 0.80
setThumbImagesMethod · 0.80
setHorizontalScrollMethod · 0.80
getBoolMethod · 0.80
setVerticalScrollMethod · 0.80
setUpdatesChildrenMethod · 0.80
getFloatMethod · 0.80
containsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected