Skip to content

Custom Two Line Output #159

Open
Open
@davidbitton

Description

@davidbitton

I created my own in and out MenuIO files; jetiboxIn and jetiBoxOut. I used the serialIn and serialOut as examples to work from. I need to be able to replicate this type of output

pic

Each "window" if you will is two lines. I have to set the text for each line separately by calling jetiEx.SetJetiboxText(JetiExProtocol::LINE1, 0) and jetiEx.SetJetiboxText(JetiExProtocol::LINE2, 0). Where I'm stumbling on is setCursor and write. It's unclear in io.h and io.cpp how these are called. I decided to create two panels; one for each line like this:

#include "jetiboxOut.h"

namespace Menu {

    constMEM panel jetibox_panels[] MEMMODE = {{0, 0, 16, 1},{0, 1, 16, 1}};
    navNode *jetibox_nodes[sizeof(jetibox_panels) / sizeof(panel)];
    panelsList jetibox_panel_list(
        jetibox_panels, 
        jetibox_nodes,
        sizeof(jetibox_panels) / sizeof(panel)
    );

} // namespace Menu

How does ArduinoMenu uses multiple panels in lieu of a single two line panel? How is the text being passed to write? Is it one char at a time? Should I be keeping track of my "cursor" and copy each incoming char in write into the subsequent position in my output buffer? How does ArduinoMenu respect the defined width in chars of the given panels? Does it make more sense to have a single two line panel? Most windows are a label above and a choice or toggle on the 2nd line. I'd like to keep this as KISS as possible. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions