Changeset 03145ee in mainline
- Timestamp:
- 2020-11-10T09:00:48Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d942ca4
- Parents:
- 0d71fd6
- git-author:
- Jiri Svoboda <jiri@…> (2020-11-09 20:00:37)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-11-10 09:00:48)
- Location:
- uspace
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/calculator/calculator.c
r0d71fd6 r03145ee 42 42 #include <stdlib.h> 43 43 #include <str.h> 44 #include <ui/ label.h>44 #include <ui/entry.h> 45 45 #include <ui/fixed.h> 46 46 #include <ui/pbutton.h> … … 133 133 134 134 static char *expr = NULL; 135 static ui_ label_t *display;135 static ui_entry_t *display; 136 136 137 137 static bool is_digit(char c) … … 350 350 { 351 351 if (expr != NULL) 352 (void) ui_ label_set_text(display, (void *) expr);352 (void) ui_entry_set_text(display, (void *) expr); 353 353 else 354 (void) ui_ label_set_text(display, (void *) NULL_DISPLAY);355 356 ui_ label_paint(display);354 (void) ui_entry_set_text(display, (void *) NULL_DISPLAY); 355 356 ui_entry_paint(display); 357 357 } 358 358 … … 366 366 switch (error_type) { 367 367 case ERROR_SYNTAX: 368 (void) ui_ label_set_text(display,368 (void) ui_entry_set_text(display, 369 369 (void *) SYNTAX_ERROR_DISPLAY); 370 370 break; 371 371 case ERROR_NUMERIC: 372 (void) ui_ label_set_text(display,372 (void) ui_entry_set_text(display, 373 373 (void *) NUMERIC_ERROR_DISPLAY); 374 374 break; 375 375 default: 376 (void) ui_ label_set_text(display,376 (void) ui_entry_set_text(display, 377 377 (void *) UNKNOWN_ERROR_DISPLAY); 378 378 break; 379 379 } 380 380 381 ui_ label_paint(display);381 ui_entry_paint(display); 382 382 } 383 383 … … 618 618 } 619 619 620 rc = ui_ label_create(ui_res, NULL_DISPLAY, &display);620 rc = ui_entry_create(ui_res, NULL_DISPLAY, &display); 621 621 if (rc != EOK) { 622 printf("Error creating label.\n");622 printf("Error creating text lentry.\n"); 623 623 return rc; 624 624 } 625 625 626 626 rect.p0.x = 15; 627 rect.p0.y = 50;627 rect.p0.y = 45; 628 628 rect.p1.x = 235; 629 629 rect.p1.y = 70; 630 ui_ label_set_rect(display, &rect);631 ui_ label_set_halign(display, gfx_halign_right);632 633 rc = ui_fixed_add(fixed, ui_ label_ctl(display));630 ui_entry_set_rect(display, &rect); 631 ui_entry_set_halign(display, gfx_halign_right); 632 633 rc = ui_fixed_add(fixed, ui_entry_ctl(display)); 634 634 if (rc != EOK) { 635 635 printf("Error adding control to layout.\n"); -
uspace/lib/ui/meson.build
r0d71fd6 r03145ee 31 31 'src/control.c', 32 32 'src/dummygc.c', 33 'src/entry.c', 33 34 'src/fixed.c', 34 35 'src/image.c', … … 44 45 test_src = files( 45 46 'test/control.c', 47 'test/entry.c', 46 48 'test/fixed.c', 47 49 'test/image.c', -
uspace/lib/ui/private/resource.h
r0d71fd6 r03145ee 87 87 /** Inactive titlebar text color */ 88 88 gfx_color_t *tbar_inact_text_color; 89 90 /** Entry (text entry, checkbox, radio button) foreground color */ 91 gfx_color_t *entry_fg_color; 92 /** Entry (text entry, checkbox, raido button) background color */ 93 gfx_color_t *entry_bg_color; 89 94 }; 90 95 -
uspace/lib/ui/src/resource.c
r0d71fd6 r03145ee 74 74 gfx_color_t *tbar_act_text_color = NULL; 75 75 gfx_color_t *tbar_inact_text_color = NULL; 76 gfx_color_t *entry_fg_color = NULL; 77 gfx_color_t *entry_bg_color = NULL; 76 78 errno_t rc; 77 79 … … 156 158 rc = gfx_color_new_rgb_i16(0x5858, 0x5858, 0x5858, 157 159 &tbar_inact_text_color); 160 if (rc != EOK) 161 goto error; 162 163 rc = gfx_color_new_rgb_i16(0, 0, 0, &entry_fg_color); 164 if (rc != EOK) 165 goto error; 166 167 rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &entry_bg_color); 158 168 if (rc != EOK) 159 169 goto error; … … 180 190 resource->tbar_inact_bg_color = tbar_inact_bg_color; 181 191 resource->tbar_inact_text_color = tbar_inact_text_color; 192 193 resource->entry_fg_color = entry_fg_color; 194 resource->entry_bg_color = entry_bg_color; 182 195 183 196 *rresource = resource; … … 217 230 gfx_color_delete(tbar_inact_text_color); 218 231 232 if (entry_fg_color != NULL) 233 gfx_color_delete(entry_fg_color); 234 if (entry_bg_color != NULL) 235 gfx_color_delete(entry_bg_color); 236 219 237 if (tface != NULL) 220 238 gfx_typeface_destroy(tface); … … 250 268 gfx_color_delete(resource->tbar_inact_text_color); 251 269 270 gfx_color_delete(resource->entry_fg_color); 271 gfx_color_delete(resource->entry_bg_color); 272 252 273 gfx_font_close(resource->font); 253 274 gfx_typeface_destroy(resource->tface); -
uspace/lib/ui/test/main.c
r0d71fd6 r03145ee 32 32 33 33 PCUT_IMPORT(control); 34 PCUT_IMPORT(entry); 34 35 PCUT_IMPORT(fixed); 35 36 PCUT_IMPORT(image);
Note:
See TracChangeset
for help on using the changeset viewer.