def rect_string()
"{{" + @yaml["rect"]["left"].to_s + ", " + @yaml["rect"]["top"].to_s + ", " + @yaml["rect"]["right"].to_s + ", " + @yaml["rect"]["bottom"].to_s + "}}";
end
+ def rect_left()
+ @yaml["rect"]["left"].to_s
+ end
+ def rect_top()
+ @yaml["rect"]["top"].to_s
+ end
+ def rect_right()
+ @yaml["rect"]["right"].to_s
+ end
+ def rect_bottom()
+ @yaml["rect"]["bottom"].to_s
+ end
def text_array()
conv_TCArray_to_hex_definition(conv_euc_to_TCArray(@yaml["text"]));
end
+ def text_array_length()
+ calc_euc_to_TCArray_length(@yaml["text"]);
+ end
def is_attr_specified()
@yaml["attr"] != nil
end
def is_databox_use()
@yaml["databox"] != nil && (@yaml["databox"]["specify"] != "direct" || @yaml["databox"]["specify"] != "argument")
end
+ def is_use_rect_in_open()
+ !is_databox_use()
+ end
def generate_header_eventtype_enumulate(main_name, window_name)
script = <<-EOS
erb = ERB.new(script, nil, '-');
erb.result(binding)
end
+
+ def generate_draw_in_draw(main_name, window_name)
+ script = <<-EOS
+ EOS
+
+ erb = ERB.new(script, nil, '-');
+ erb.result(binding)
+ end
end
class HMITextBoxParts < HMIParts
end
end
+class HMIFixedTextParts < HMIParts
+ def is_need_eventbreak()
+ return false
+ end
+ def is_use_rect_in_open()
+ return false
+ end
+
+ def generate_initialize_in_new()
+ return ""
+ end
+ def generate_create_in_open()
+ return ""
+ end
+ def generate_draw_in_draw(main_name, window_name)
+ script = <<-EOS
+ gdra_stp(window->gid, <%= self.rect_left() %>, <%= self.rect_bottom() %>, (TC[]){<%= self.text_array() %>}, <%= self.text_array_length() %>, G_STORE);
+ EOS
+
+ erb = ERB.new(script, nil, '-');
+ erb.result(binding)
+ end
+end
+
def generate_parts(type, a)
case type
when "textbox"
return HMINumberBoxParts.new(a);
when "switchselector"
return HMISwitchSelectorParts.new(a);
+ when "fixedtext"
+ return HMIFixedTextParts.new(a)
end
end
def is_exist_controllparts()
@parts.length > 0;
end
- def is_exist_nondatabox_controllparts()
+ def is_exist_use_rect_in_open()
@parts.any? { |item|
- !item.is_databox_use();
+ item.is_use_rect_in_open();
};
end
def is_need_flag()
LOCAL VOID <%= self.struct_name() %>_draw(<%= self.struct_name() %>_t *window, RECT *r)
{
cdsp_pwd(window->wid, r, P_RDISP);
+ <%- @parts.each do |p| -%><%= p.generate_draw_in_draw(main_name, self.struct_name()) %><%- end -%>
}
LOCAL VOID <%= self.struct_name() %>_redisp(<%= self.struct_name() %>_t *window)
<% if self.is_attr_alwaysopen() %>LOCAL<% else %>EXPORT<% end %> W <%= self.struct_name() %>_open(<%= self.struct_name() %>_t *window<% if self.is_attr_alwaysopen() %>, TC *title<% end %>)
{
WID wid;
- <%- if self.is_exist_nondatabox_controllparts() -%>
+ <%- if self.is_exist_use_rect_in_open() -%>
RECT r;
<%- end -%>