Changeset 03145ee in mainline for uspace/app/calculator/calculator.c
- 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)
- File:
-
- 1 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");
Note:
See TracChangeset
for help on using the changeset viewer.