Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » Prevent selection of title

Author: pruttelherrie
11/09/2021 16:54:03
Hi Dave,

Is it possible to prevent the menu from scrolling up to the Title, which does nothing? Using version 2.2 I can scroll onto the title, but I would like the cursor to stay on the topmost item. Is this possible?

Author: davetcc
12/09/2021 07:47:22
Hi there, at the moment in 2.2 it is not configurable, but we could put in an option to prevent it being selected.

You can set an action for the title using "setTitlePressedCallback" as per below, I usually use it to show version information:

setTitlePressedCallback([](int id) {
        withMenuDialogIfAvailable([](MenuBasedDialog* dlg) {
            dlg->setButtons(BTNTYPE_CLOSE, BTNTYPE_NONE);
            dlg->showRam("ARM Example", false);
            char menuVer[10];
            tccore::copyTcMenuVersion(menuVer, sizeof menuVer);
            dlg->copyIntoBuffer(menuVer);
        });
    });



Author: pruttelherrie
12/09/2021 08:37:35
Ah, nice!

Thanks.

Author: davetcc
12/09/2021 09:08:23
BTW the withMenuDialogIfAvailable is a new function that will be released along with the full 2.2 release. I'm just finishing the testing now.

Author: patebeng
17/09/2021 01:03:32
removed




Register / Login  |  Desktop view  |  Jump to top of page