Changeset 5e109e1 in mainline for uspace/lib/ui


Ignore:
Timestamp:
2021-08-10T09:49:21Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
307d4d2, 3a4a944f
Parents:
edeee9f
git-author:
Jiri Svoboda <jiri@…> (2021-08-09 18:49:14)
git-committer:
Jiri Svoboda <jiri@…> (2021-08-10 09:49:21)
Message:

File dialog prototype

This only contains a text entry for entering the file path and
OK / Cancel buttons.

Location:
uspace/lib/ui
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/include/ui/entry.h

    redeee9f r5e109e1  
    5252extern void ui_entry_set_read_only(ui_entry_t *, bool);
    5353extern errno_t ui_entry_set_text(ui_entry_t *, const char *);
     54extern const char *ui_entry_get_text(ui_entry_t *);
    5455extern errno_t ui_entry_paint(ui_entry_t *);
    5556extern void ui_entry_backspace(ui_entry_t *);
  • uspace/lib/ui/include/ui/msgdialog.h

    redeee9f r5e109e1  
    3131 */
    3232/**
    33  * @file Message Dialog
     33 * @file Message dialog
    3434 */
    3535
    36 #ifndef _UI_MSG_DIALOG_H
    37 #define _UI_MSG_DIALOG_H
     36#ifndef _UI_MSGDIALOG_H
     37#define _UI_MSGDIALOG_H
    3838
    3939#include <errno.h>
  • uspace/lib/ui/meson.build

    redeee9f r5e109e1  
    3333        'src/dummygc.c',
    3434        'src/entry.c',
     35        'src/filedialog.c',
    3536        'src/fixed.c',
    3637        'src/image.c',
     
    5556        'test/control.c',
    5657        'test/entry.c',
     58        'test/filedialog.c',
    5759        'test/fixed.c',
    5860        'test/image.c',
  • uspace/lib/ui/src/entry.c

    redeee9f r5e109e1  
    190190        entry->pos = str_size(text);
    191191        entry->sel_start = entry->pos;
     192
    192193        ui_entry_scroll_update(entry, false);
    193194        ui_entry_paint(entry);
    194195
    195196        return EOK;
     197}
     198
     199/** Get entry text.
     200 *
     201 * @return Pointer to entry text.
     202 */
     203const char *ui_entry_get_text(ui_entry_t *entry)
     204{
     205        return entry->text;
    196206}
    197207
  • uspace/lib/ui/src/msgdialog.c

    redeee9f r5e109e1  
    177177                goto error;
    178178
     179        dialog->bok = bok;
    179180        bok = NULL;
    180181
     
    187188
    188189        dialog->window = window;
    189         dialog->bok = bok;
    190190        *rdialog = dialog;
    191191        return EOK;
    192192error:
     193        if (bok != NULL)
     194                ui_pbutton_destroy(bok);
    193195        if (label != NULL)
    194196                ui_label_destroy(label);
  • uspace/lib/ui/test/main.c

    redeee9f r5e109e1  
    3434PCUT_IMPORT(checkbox);
    3535PCUT_IMPORT(entry);
     36PCUT_IMPORT(file_dialog);
    3637PCUT_IMPORT(fixed);
    3738PCUT_IMPORT(image);
     
    4041PCUT_IMPORT(menubar);
    4142PCUT_IMPORT(menuentry);
     43PCUT_IMPORT(msg_dialog);
    4244PCUT_IMPORT(paint);
    4345PCUT_IMPORT(pbutton);
  • uspace/lib/ui/test/msgdialog.c

    redeee9f r5e109e1  
    108108        ui_pbutton_clicked(dialog->bok);
    109109
    110         /* Button callback with unfocus callback not implemented */
     110        /* Button callback with callback not implemented */
    111111        ui_msg_dialog_set_cb(dialog, &dummy_msg_dialog_cb, NULL);
    112112        ui_pbutton_clicked(dialog->bok);
Note: See TracChangeset for help on using the changeset viewer.