Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset ff6e91b in mainline for uspace/lib/ui/test/menu.c


Ignore:
Timestamp:
2021-08-30T20:41:27Z (7 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
81ec7e1
Parents:
9b2e20c
Message:

Make use of code page 437 characters

To draw proper text boxes, for a nice round radio button light,
for a nice contiguous slider groove.

File:
1 edited

Legend:

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

    r9b2e20c rff6e91b  
    209209}
    210210
     211/** Paint background in graphics mode */
     212PCUT_TEST(paint_bg_gfx)
     213{
     214        ui_t *ui = NULL;
     215        ui_window_t *window = NULL;
     216        ui_wnd_params_t params;
     217        ui_menu_bar_t *mbar = NULL;
     218        ui_menu_t *menu = NULL;
     219        gfx_rect_t prect;
     220        gfx_coord2_t pos;
     221        errno_t rc;
     222
     223        rc = ui_create_disp(NULL, &ui);
     224        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     225
     226        ui_wnd_params_init(&params);
     227        params.caption = "Hello";
     228
     229        rc = ui_window_create(ui, &params, &window);
     230        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     231        PCUT_ASSERT_NOT_NULL(window);
     232
     233        rc = ui_menu_bar_create(ui, window, &mbar);
     234        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     235        PCUT_ASSERT_NOT_NULL(mbar);
     236
     237        rc = ui_menu_create(mbar, "Test", &menu);
     238        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     239        PCUT_ASSERT_NOT_NULL(menu);
     240
     241        prect.p0.x = 0;
     242        prect.p0.y = 0;
     243        prect.p1.x = 0;
     244        prect.p1.y = 0;
     245
     246        /* Menu needs to be open to be able to paint it */
     247        rc = ui_menu_open(menu, &prect);
     248        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     249
     250        pos.x = 0;
     251        pos.y = 0;
     252        rc = ui_menu_paint_bg_gfx(menu, &pos);
     253        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     254
     255        ui_menu_bar_destroy(mbar);
     256        ui_window_destroy(window);
     257        ui_destroy(ui);
     258}
     259
     260/** Paint background in text mode */
     261PCUT_TEST(paint_bg_text)
     262{
     263        ui_t *ui = NULL;
     264        ui_window_t *window = NULL;
     265        ui_wnd_params_t params;
     266        ui_menu_bar_t *mbar = NULL;
     267        ui_menu_t *menu = NULL;
     268        gfx_rect_t prect;
     269        gfx_coord2_t pos;
     270        errno_t rc;
     271
     272        rc = ui_create_disp(NULL, &ui);
     273        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     274
     275        ui_wnd_params_init(&params);
     276        params.caption = "Hello";
     277
     278        rc = ui_window_create(ui, &params, &window);
     279        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     280        PCUT_ASSERT_NOT_NULL(window);
     281
     282        rc = ui_menu_bar_create(ui, window, &mbar);
     283        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     284        PCUT_ASSERT_NOT_NULL(mbar);
     285
     286        rc = ui_menu_create(mbar, "Test", &menu);
     287        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     288        PCUT_ASSERT_NOT_NULL(menu);
     289
     290        prect.p0.x = 0;
     291        prect.p0.y = 0;
     292        prect.p1.x = 0;
     293        prect.p1.y = 0;
     294
     295        /* Menu needs to be open to be able to paint it */
     296        rc = ui_menu_open(menu, &prect);
     297        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     298
     299        pos.x = 0;
     300        pos.y = 0;
     301        rc = ui_menu_paint_bg_text(menu, &pos);
     302        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     303
     304        ui_menu_bar_destroy(mbar);
     305        ui_window_destroy(window);
     306        ui_destroy(ui);
     307}
     308
    211309/** Paint menu */
    212310PCUT_TEST(paint)
Note: See TracChangeset for help on using the changeset viewer.