Пример #1
0
def test_ui_creates():
    assert_equal(ui.Menu().__class__, _ui._Menu._create().__class__)
    assert_equal(ui.LayoutNode().__class__,
                 _ui._LayoutNode._create().__class__)
    assert_equal(ui.Button().__class__, _ui._Button._create().__class__)
    assert_equal(ui.Mesh().__class__, _ui._Mesh._create().__class__)
    assert_equal(ui.Slider().__class__, _ui._Slider._create().__class__)
    assert_equal(ui.Label().__class__, _ui._Label._create().__class__)
    assert_equal(ui.TextInput().__class__, _ui._TextInput._create().__class__)
    assert_equal(ui.UIList().__class__, _ui._UIList._create().__class__)
Пример #2
0
def test_ui():
    UI.Button()
    UI.Label()
    UI.Mesh()
    UI.Slider()
    UI.TextInput()
    UI.Image()
    UI.LoadingBar()
    UI.UIList()
    UI.Menu()
Пример #3
0
def button_api_test():
    val1 = rand_string()
    val2 = rand_string()
    button = UI.Button(val1, val2)
    assert_multi(button.text.value, val1)
    assert_multi(button.icon.value, val2)
    check_property(button, "name")
    text = button.text
    #text
    check_property(text, "active")
    check_multi(text.value)
    check_property(text, "auto_size")
    check_property(text, "min_size")
    check_property(text, "max_size")
    check_property(text, "size")
    check_property(text, "underlined")
    check_property(text, "ellipsis")
    check_multi(text.bold)
    check_multi(text.color)
    check_property(text, "padding_top")
    check_property(text, "padding_bottom")
    check_property(text, "padding_left")
    check_property(text, "padding_right")
    check_property(text, "line_spacing")
    check_property(text, "vertical_align")
    check_property(text, "horizontal_align")
    #icon
    icon = button.icon
    check_property(icon, "active")
    check_multi(icon.value)
    check_multi(icon.color)
    check_property(icon, "sharpness")
    check_property(icon, "size")
    check_property(icon, "ratio")
    check_property(icon, "position")
    check_property(icon, "rotation")
    #mesh
    mesh = button.mesh
    check_property(mesh, "active")
    check_multi(mesh.enabled)
    check_multi(mesh.color)
    #outline
    outline = button.outline
    check_property(outline, "active")
    check_multi(outline.size)
    check_multi(outline.color)
    #tooltip
    tooltip = button.tooltip
    check_property(tooltip, "title")
    check_property(tooltip, "content")
    check_property(tooltip, "bounds")
    check_property(tooltip, "positioning_target")
    check_property(tooltip, "positioning_origin")
Пример #4
0
def test_deprecated_button():
    suspend_warning()
    button = UI.Button()
    test_multi_var(button.text.value, button.text, "value")
    test_multi_var(button.icon.value, button.icon, "value")
    test_multi_var(button.icon.color, button.icon, "color")
    value = "bolded1234"
    button.text.bolded = value
    assert_multi(button.text.bold, value)
    button.set_all_text(value)
    assert_multi(button.text.value, value)
    button.set_all_icon(value)
    assert_multi(button.icon.value, value)
    restore_warning()
Пример #5
0
def CreateButton():
    value = UI.Button()
    value = alter_object(value)
    return value