def generate_code_ctor(self, code_obj, is_new, tab):
    code_lines = []
    write = code_lines.append
    builder = self.obj_builders[code_obj.WX_CLASS]
    mycn = getattr(builder, 'cn', self.cn)
    mycn_f = getattr(builder, 'cn_f', self.cn_f)
    custom_base = ((code_obj.check_prop_nodefault('custom_base') and code_obj.custom_base.strip()) or None)
    new_signature = getattr(builder, 'new_signature', [])
    if is_new:
        write(('package %s;\n\n' % code_obj.klass))
        write(('use Wx qw[:everything];\nuse base qw(%s);\nuse strict;\n\n' % code_obj.WX_CLASS.replace('wx', 'Wx::', 1)))
        if self._use_gettext:
            if self.multiple_files:
                self.classes[code_obj].dependencies.add("use Wx::Locale gettext => '_T';\n")
            else:
                write("use Wx::Locale gettext => '_T';\n")
        dep_list = sorted(self.classes[code_obj].dependencies)
        if dep_list:
            code = self._tagcontent('dependencies', dep_list, True)
            write(code)
        write('sub new {\n')
        write((tab + ('my( $self, %s ) = @_;\n' % ', '.join(new_signature))))
        if new_signature:
            for k in new_signature:
                if (k in self.new_defaults):
                    write(self.new_defaults[k])
        else:
            new_signature = ['@_[1 .. $#_]']
            logging.info('%s did not declare self.new_defaults ', code_obj.klass)
    elif custom_base:
        self.warning(('%s has custom base classes, but you are not overwriting existing sources: please check that the resulting code is correct!' % code_obj.name))
    if self._mark_blocks:
        write((self.tmpl_block_begin % {'class_separator': self.class_separator, 'comment_sign': self.comment_sign, 'function': self.name_ctor, 'klass': self.cn_class(code_obj.klass), 'tab': tab}))
    if ((not self.preview) and code_obj.check_prop('extracode_pre')):
        for l in code_obj.properties['extracode_pre'].get_lines():
            write((tab + l))
    style_p = code_obj.properties.get('style')
    if (style_p and (style_p.value_set != style_p.default_value)):
        style = style_p.get_string_value()
        m_style = mycn_f(style)
        if m_style:
            stmt_style = self._format_style(style, code_obj)
            write((stmt_style % {'style': m_style, 'tab': tab}))
    write((tab + ('$self = $self->SUPER::new( %s );\n' % ', '.join(new_signature))))
    if code_obj.check_prop('size'):
        write((tab + self.generate_code_size(code_obj)))
    for l in builder.get_properties_code(code_obj):
        write((tab + l))
    if code_obj.check_prop_truth('extraproperties'):
        for l in builder.generate_code_extraproperties(code_obj):
            write((tab + l))
    for l in self.classes[code_obj].init:
        write((tab + l))
    if self.classes[code_obj].final:
        write((tab + '\n'))
        for l in self.classes[code_obj].final:
            write((tab + l))
    for l in builder.get_init_code(code_obj):
        write((tab + l))
    for l in builder.get_layout_code(code_obj):
        write((tab + l))
    if ((not self.preview) and code_obj.check_prop('extracode_post')):
        for l in code_obj.properties['extracode_post'].get_lines():
            write((tab + l))
    return code_lines
def generate_code_ctor(self, code_obj, is_new, tab):
    code_lines = []
    write = code_lines.append
    builder = self.obj_builders[code_obj.WX_CLASS]
    mycn = getattr(builder, 'cn', self.cn)
    mycn_f = getattr(builder, 'cn_f', self.cn_f)
    custom_base = ((code_obj.check_prop_nodefault('custom_base') and code_obj.custom_base.strip()) or None)
    new_signature = getattr(builder, 'new_signature', [])
    if is_new:
        write(('package %s;\n\n' % code_obj.klass))
        write(('use Wx qw[:everything];\nuse base qw(%s);\nuse strict;\n\n' % code_obj.WX_CLASS.replace('wx', 'Wx::', 1)))
        if self._use_gettext:
            if self.multiple_files:
                self.classes[code_obj].dependencies.add("use Wx::Locale gettext => '_T';\n")
            else:
                write("use Wx::Locale gettext => '_T';\n")
        dep_list = sorted(self.classes[code_obj].dependencies)
        if dep_list:
            code = self._tagcontent('dependencies', dep_list, True)
            write(code)
        write('sub new {\n')
        write((tab + ('my( $self, %s ) = @_;\n' % ', '.join(new_signature))))
        if new_signature:
            for k in new_signature:
                if (k in self.new_defaults):
                    write(self.new_defaults[k])
        else:
            new_signature = ['@_[1 .. $#_]']
            logging.info('%s did not declare self.new_defaults ', code_obj.klass)
    elif custom_base:
        self.warning(('%s has custom base classes, but you are not overwriting existing sources: please check that the resulting code is correct!' % code_obj.name))
    if self._mark_blocks:
        write((self.tmpl_block_begin % {'class_separator': self.class_separator, 'comment_sign': self.comment_sign, 'function': self.name_ctor, 'klass': self.cn_class(code_obj.klass), 'tab': tab}))
    if ((not self.preview) and code_obj.check_prop('extracode_pre')):
        for l in code_obj.properties['extracode_pre'].get_lines():
            write((tab + l))
    style_p = code_obj.properties.get('style')
    if (style_p and (style_p.value_set != style_p.default_value)):
        style = style_p.get_string_value()
        m_style = mycn_f(style)
        if m_style:
            stmt_style = self._format_style(style, code_obj)
            write((stmt_style % {'style': m_style, 'tab': tab}))
    write((tab + ('$self = $self->SUPER::new( %s );\n' % ', '.join(new_signature))))
    if code_obj.check_prop('size'):
        write((tab + self.generate_code_size(code_obj)))
    for l in builder.get_properties_code(code_obj):
        write((tab + l))
    if code_obj.check_prop_truth('extraproperties'):
        for l in builder.generate_code_extraproperties(code_obj):
            write((tab + l))
    for l in self.classes[code_obj].init:
        write((tab + l))
    if self.classes[code_obj].final:
        write((tab + '\n'))
        for l in self.classes[code_obj].final:
            write((tab + l))
    for l in builder.get_init_code(code_obj):
        write((tab + l))
    for l in builder.get_layout_code(code_obj):
        write((tab + l))
    if ((not self.preview) and code_obj.check_prop('extracode_post')):
        for l in code_obj.properties['extracode_post'].get_lines():
            write((tab + l))
    return code_lines