• R/O
  • SSH
  • HTTPS

bchan: 提交


Commit MetaInfo

修訂430 (tree)
時間2012-04-14 14:49:30
作者ornse01

Log Message

implement subwindow.

Change Summary

差異

--- bchanf/trunk/src/tools/hmi_generator.rb (revision 429)
+++ bchanf/trunk/src/tools/hmi_generator.rb (revision 430)
@@ -1302,6 +1302,9 @@
13021302 def is_attr_opencheckable()
13031303 self.is_attr_xxx("opencheckable");
13041304 end
1305+ def is_attr_subwindow()
1306+ self.is_attr_xxx("subwindow");
1307+ end
13051308 def is_exportevent_draw()
13061309 self.is_exportevent_xxx("draw");
13071310 end
@@ -1343,6 +1346,9 @@
13431346 item.is_need_eventbreak();
13441347 };
13451348 end
1349+ def get_window_parent()
1350+ @yaml["parent"]
1351+ end
13461352
13471353 def generate_header_eventtype_enumulate(main_name)
13481354 script = <<-EOS
@@ -1441,7 +1447,7 @@
14411447
14421448 def generate_initialize_arguments()
14431449 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 -%><%- -%>
14451451 EOS
14461452
14471453 erb = ERB.new(script, nil, '-');
@@ -1465,7 +1471,11 @@
14651471 <%- end -%>
14661472 WID wid;
14671473 GID gid;
1474+ <%- if self.is_attr_subwindow() -%>
1475+ <%= self.get_window_parent() %>_t *parent;
1476+ <%- else -%>
14681477 WID parent;
1478+ <%- end -%>
14691479 RECT r;
14701480 PAT bgpat;
14711481 <%- if self.is_attr_scrollable() -%>
@@ -1708,7 +1718,7 @@
17081718 return 0;
17091719 }
17101720
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);
17121722 if (wid < 0) {
17131723 DP_ER("wopn_wnd: subjectoption error", wid);
17141724 return wid;
@@ -2539,6 +2549,11 @@
25392549 <%- @win.each do |w| -%>
25402550 EXPORT <%= w.struct_name() %>_t* <%= self.main_name() %>_new<%= w.struct_name() %>(<%= self.main_name() %>_t *hmi, <%= w.generate_initialize_arguments() %>)
25412551 {
2552+ <%- if w.is_attr_subwindow -%>
2553+ if (parent == NULL) {
2554+ return NULL;
2555+ }
2556+ <%- end -%>
25422557 if (hmi-><%= w.struct_name() %> != NULL) {
25432558 return NULL;
25442559 }
Show on old repository browser