99#include < IoLogging.h>
1010#include < TaskManagerIO.h>
1111#include < BaseDialog.h>
12- #include < tcMenuVersion .h>
12+ #include < tcUtil .h>
1313
1414// TFT_eSPI setup is "Setup60_RP2040_ILI9341.h".
1515
@@ -24,8 +24,6 @@ const char* fileNames[] = {
2424
2525#define FILE_NAME_SIZE 5
2626
27- void onTitlePressed (int );
28-
2927void setup () {
3028 // This example logs using IoLogging, see the following guide to enable
3129 // https://www.thecoderscorner.com/products/arduino-libraries/io-abstraction/arduino-logging-with-io-logging/
@@ -35,7 +33,10 @@ void setup() {
3533 setupMenu ();
3634
3735 // Add a callback to show the build version when the title is pressed
38- setTitlePressedCallback (onTitlePressed);
36+ // this uses the standard function to show a version dialog from tcUtil.h
37+ setTitlePressedCallback ([](int ) {
38+ showVersionDialog (&applicationInfo);
39+ });
3940
4041 // Add another button that directly controls the mute menu item
4142 switches.addSwitch (22 , [] (pinid_t key, bool held) {
@@ -154,6 +155,9 @@ void CALLBACK_FUNCTION onShowDialogs(int) {
154155 */
155156int CALLBACK_FUNCTION fnRootListRtCall (RuntimeMenuItem* item, uint8_t row, RenderFnMode mode, char * buffer, int bufferSize) {
156157 switch (mode) {
158+ case RENDERFN_ACTIVATE:
159+ serlogF2 (SER_DEBUG, " List activate " , row);
160+ return false ;
157161 case RENDERFN_INVOKE:
158162 // we have a list of files and a refresh option at the end.
159163 if (row < FILE_NAME_SIZE) {
@@ -187,13 +191,3 @@ int CALLBACK_FUNCTION fnRootListRtCall(RuntimeMenuItem* item, uint8_t row, Rende
187191 default : return false ;
188192 }
189193}
190-
191- void onTitlePressed (int ) {
192- withMenuDialogIfAvailable ([](MenuBasedDialog *dlg) {
193- dlg->setButtons (BTNTYPE_NONE, BTNTYPE_CLOSE);
194- dlg->show (" TcMenu PI Pico example" , false );
195- char sz[20 ];
196- tccore::copyTcMenuVersion (sz, sizeof sz);
197- dlg->copyIntoBuffer (sz);
198- });
199- }
0 commit comments