Building up a Framework

I've had my head down on implementing widgets and trying to make them fit together nicely in a framework. Instead of getting too focused on that, I should try to write a bit about activities more regularly. Anyway, here's what has happened recently.


Editable widgets can accept keyboard focus

Editors, like LineEdit and TextEdit will look and behave differently when they are given the keyboard focus. Panels can implement a bit of keyboard handling to manage focus navigation:

main_callback(panel: ref Panel, event: ref Panels->Event): int
{
    pick inst := event
    {
        Key =>
            case inst.key {
                Keyboard->Esc => return -1;
                9 => panel.nextfocus();
            }
    }
    return 0;
}

The panel.nextfocus method updates the panel's focus widget.


A menu of items

The Menu widget is similar to the TextEdit in implementation, so I wonder if I can somehow merge them at some point.


Showing the current day and providing a cursor

I updated the calendar widget to show the current day if it is shown in the current month. There is also a cursor you can use to navigate between days.


Marking appointments on a calendar

The calendar widget supports a set of flags that indicate which days have appointments. This needs to be updated by the application when the month changes, which is a bit awkward, but maybe I'll create a helper function that can do most of the work.


David Boddie
3 January 2022