Changeset 1eaead4 in mainline for uspace/lib/ui/test/paint.c


Ignore:
Timestamp:
2023-02-07T16:11:53Z (14 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0366d09d
Parents:
7c5320c
Message:

Tab set control

This allows to expand the space available in a dialog window
using stacking, with individual tabs that can be activated
by clicking the handle.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/test/paint.c

    r7c5320c r1eaead4  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    7575} testgc_bitmap_t;
    7676
     77/** Test box characters */
     78static ui_box_chars_t test_box_chars = {
     79        {
     80                { "A", "B", "C" },
     81                { "D", " ", "E" },
     82                { "F", "G", "H" }
     83        }
     84};
     85
    7786/** Paint bevel */
    7887PCUT_TEST(bevel)
     
    466475        /* Paint text box */
    467476        rc = ui_paint_text_box(resource, &rect, ui_box_single, color);
     477        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     478
     479        gfx_color_delete(color);
     480        ui_resource_destroy(resource);
     481        rc = gfx_context_delete(gc);
     482        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     483}
     484
     485/** Paint custom text box */
     486PCUT_TEST(text_box_custom)
     487{
     488        errno_t rc;
     489        gfx_context_t *gc = NULL;
     490        ui_resource_t *resource = NULL;
     491        gfx_color_t *color = NULL;
     492        test_gc_t tgc;
     493        gfx_rect_t rect;
     494
     495        memset(&tgc, 0, sizeof(tgc));
     496        rc = gfx_context_new(&ops, &tgc, &gc);
     497        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     498
     499        rc = ui_resource_create(gc, false, &resource);
     500        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     501        PCUT_ASSERT_NOT_NULL(resource);
     502
     503        rc = gfx_color_new_rgb_i16(1, 2, 3, &color);
     504        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     505
     506        rect.p0.x = 10;
     507        rect.p0.y = 20;
     508        rect.p1.x = 30;
     509        rect.p1.y = 40;
     510
     511        /* Paint text box */
     512        rc = ui_paint_text_box_custom(resource, &rect, &test_box_chars, color);
    468513        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
    469514
Note: See TracChangeset for help on using the changeset viewer.