implement subwindow.
@@ -1302,6 +1302,9 @@ | ||
1302 | 1302 | def is_attr_opencheckable() |
1303 | 1303 | self.is_attr_xxx("opencheckable"); |
1304 | 1304 | end |
1305 | + def is_attr_subwindow() | |
1306 | + self.is_attr_xxx("subwindow"); | |
1307 | + end | |
1305 | 1308 | def is_exportevent_draw() |
1306 | 1309 | self.is_exportevent_xxx("draw"); |
1307 | 1310 | end |
@@ -1343,6 +1346,9 @@ | ||
1343 | 1346 | item.is_need_eventbreak(); |
1344 | 1347 | }; |
1345 | 1348 | end |
1349 | + def get_window_parent() | |
1350 | + @yaml["parent"] | |
1351 | + end | |
1346 | 1352 | |
1347 | 1353 | def generate_header_eventtype_enumulate(main_name) |
1348 | 1354 | script = <<-EOS |
@@ -1441,7 +1447,7 @@ | ||
1441 | 1447 | |
1442 | 1448 | def generate_initialize_arguments() |
1443 | 1449 | script = <<-EOS |
1444 | -<%- if self.is_attr_resizable() -%>RECT *r<% else %>PNT *p<% end %>, WID parent, TC *title, PAT *bgpat<%- @parts.each do |p| -%><% if p.is_databox_specify_argument() %>, W dnum_<%= p.name() %><% end %><%- end -%><%- -%> | |
1450 | +<%- if self.is_attr_resizable() -%>RECT *r<% else %>PNT *p<% end %>, <%- if self.is_attr_subwindow() -%><%= self.get_window_parent() %>_t *parent<%- else -%>WID parent<%- end -%>, TC *title, PAT *bgpat<%- @parts.each do |p| -%><% if p.is_databox_specify_argument() %>, W dnum_<%= p.name() %><% end %><%- end -%><%- -%> | |
1445 | 1451 | EOS |
1446 | 1452 | |
1447 | 1453 | erb = ERB.new(script, nil, '-'); |
@@ -1465,7 +1471,11 @@ | ||
1465 | 1471 | <%- end -%> |
1466 | 1472 | WID wid; |
1467 | 1473 | GID gid; |
1474 | + <%- if self.is_attr_subwindow() -%> | |
1475 | + <%= self.get_window_parent() %>_t *parent; | |
1476 | + <%- else -%> | |
1468 | 1477 | WID parent; |
1478 | + <%- end -%> | |
1469 | 1479 | RECT r; |
1470 | 1480 | PAT bgpat; |
1471 | 1481 | <%- if self.is_attr_scrollable() -%> |
@@ -1708,7 +1718,7 @@ | ||
1708 | 1718 | return 0; |
1709 | 1719 | } |
1710 | 1720 | |
1711 | - wid = wopn_wnd(WA_STD<% if self.is_attr_resizable() %>|WA_SIZE|WA_HHDL|WA_VHDL<% end %><% if self.is_attr_scrollable() %>|WA_BBAR|WA_RBAR<% end %>, window->parent, &(window->r), NULL, 2, <%- if self.get_window_title() != nil -%>title<%- else -%>NULL<%- end -%>, &window->bgpat, NULL); | |
1721 | + wid = wopn_wnd(WA_STD<% if self.is_attr_subwindow() %>|WA_SUBW<% end %><% if self.is_attr_resizable() %>|WA_SIZE|WA_HHDL|WA_VHDL<% end %><% if self.is_attr_scrollable() %>|WA_BBAR|WA_RBAR<% end %>, <% if self.is_attr_subwindow() %>window->parent->wid<% else %>window->parent<% end %>, &(window->r), NULL, 2, <%- if self.get_window_title() != nil -%>title<%- else -%>NULL<%- end -%>, &window->bgpat, NULL); | |
1712 | 1722 | if (wid < 0) { |
1713 | 1723 | DP_ER("wopn_wnd: subjectoption error", wid); |
1714 | 1724 | return wid; |
@@ -2539,6 +2549,11 @@ | ||
2539 | 2549 | <%- @win.each do |w| -%> |
2540 | 2550 | EXPORT <%= w.struct_name() %>_t* <%= self.main_name() %>_new<%= w.struct_name() %>(<%= self.main_name() %>_t *hmi, <%= w.generate_initialize_arguments() %>) |
2541 | 2551 | { |
2552 | + <%- if w.is_attr_subwindow -%> | |
2553 | + if (parent == NULL) { | |
2554 | + return NULL; | |
2555 | + } | |
2556 | + <%- end -%> | |
2542 | 2557 | if (hmi-><%= w.struct_name() %> != NULL) { |
2543 | 2558 | return NULL; |
2544 | 2559 | } |