Phase 3: generator emits set_items string form for ToolBar/MenuBar (fixes case 03 ambiguity)

This commit is contained in:
cnmcdee committed 2026-11-30 13:05:42 +00:00
1 parent 1f2c2c9cb4
commit 58e01603e8
1 file changed
+6 -20
+6 -20
View File
@@ -879,16 +879,9 @@ static void emit_widget_props(std::ostringstream& o, const Widget& w,
<< (prop_bool(w, "auto-snap", false) ? "true" : "false")
<< ");\n";
} else if (t == "ToolBar") {
if (has("items")) {
o << " " << var << ".w.set_items({";
bool first = true;
for (const std::string& item : split_on('|', prop_or(w, "items", ""))) {
if (!first) o << ", ";
first = false;
o << "\"" << esc_c(item) << "\"";
}
o << "});\n";
}
if (has("items"))
o << " " << var << ".w.set_items(\""
<< esc_c(prop_or(w, "items", "")) << "\");\n";
if (w.props.count("show-captions"))
o << " " << var << ".w.set_show_captions("
<< (prop_bool(w, "show-captions", true) ? "true" : "false")
@@ -905,16 +898,9 @@ static void emit_widget_props(std::ostringstream& o, const Widget& w,
o << " " << var << ".w.set_button_height("
<< prop_int(w, "button-height", 0) << ");\n";
} else if (t == "MenuBar") {
if (has("menus")) {
o << " " << var << ".w.set_items({";
bool first = true;
for (const std::string& item : split_on('|', prop_or(w, "menus", ""))) {
if (!first) o << ", ";
first = false;
o << "\"" << esc_c(item) << "\"";
}
o << "});\n";
}
if (has("menus"))
o << " " << var << ".w.set_items(\""
<< esc_c(prop_or(w, "menus", "")) << "\");\n";
} else if (t == "SpinEdit") {
int lo = prop_int(w, "minimum", 0);
int hi = prop_int(w, "maximum", 100);