def generate_code_size(self, obj):
    objname = self.format_generic_access(obj)
    size = obj.properties['size'].get_string_value()
    use_dialog_units = (size[(- 1)] == 'd')
    method = ('SetMinSize' if obj.parent_window else 'SetSize')
    if use_dialog_units:
        return ('%s->%s(%s->ConvertDialogSizeToPixels(Wx::Size->new(%s)));\n' % (objname, method, objname, size[:(- 1)]))
    return ('%s->%s(Wx::Size->new(%s));\n' % (objname, method, size))
def generate_code_size(self, obj):
    objname = self.format_generic_access(obj)
    size = obj.properties['size'].get_string_value()
    use_dialog_units = (size[(- 1)] == 'd')
    method = ('SetMinSize' if obj.parent_window else 'SetSize')
    if use_dialog_units:
        return ('%s->%s(%s->ConvertDialogSizeToPixels(Wx::Size->new(%s)));\n' % (objname, method, objname, size[:(- 1)]))
    return ('%s->%s(Wx::Size->new(%s));\n' % (objname, method, size))