Go Down

Topic: MenuBackend, new menu managment library (Read 48351 times) previous topic - next topic

Sanddune600

that was fast thanks I assumed this was a zipped file and it opened with winrar but the extension was missing so I had to do it manually

AlphaBeta

You had to do what? Anyways, glad you got it working.

On my windows box it downloads and extracts correctly.

Sanddune600

basically the name of this file is menubackend and for it to open without having to manually select a program it should be menubackend.zip I am using windows 7 starter not a big deal I just figured someone else might need to know :D

AlphaBeta

I'm curious, what browser do you use?

Sanddune600

firefox 3.6.12  I downloaded it twice and it doesnt come up with a zip extension does it for you

AlphaBeta


AlphaBeta

Does this fix it: http://www.arduino.cc/playground/uploads/Profiles/MenuBackend.zip

vzhang

hi, I just test the example. the menuchanged event doesn't work. the 'to' and 'from' are always the same.

AlphaBeta

Thank you for discovering that bug! current was set to next before the callback was called... :-[

http://www.arduino.cc/playground/uploads/Profiles/MenuBackend_1-4.zip
New version! 1.4 with the bug presumably removed (I't would be great if you could report back, I added you to the contributors list, if you want name/email just let me know).

NiklasC

Hi everybody!

Im trying to compile this in crossworks with a Cortex-M3 as a processor. But i get following trubble when I try to build it. Anyone knows?

"
   declaration of C function 'bool operator==(const MenuItem&, char*)' conflicts with
   previous declaration 'bool operator==(MenuItem&, char*)' here

Build failed

"
Please help, ide like to try this nice menusystem out!

Regards Niklas from Sweden



vzhang

Hi, Alphabeta,can you tell me how to set the current menuitem when initializing the menu?

Thanks.

Bebbetufs

#57
Dec 27, 2010, 12:56 pm Last Edit: Dec 27, 2010, 12:56 pm by Bebbetufs Reason: 1
Thanks for a super tool. For a noob like me this is priceless.

I Would like to know if I can run part of the menu from the main loop rather then from memory? I'm building a datalogger for my car, and I want to limit the amount of memory used, and code run when logging.

My menu is structured like this: (Input will be from a rotary encoder).
Secondary LCD View - Main LCD View(root) - Setup
                                                                   +Set Boost - Max->Zero gauge
                                                                   +Set Alarms->Overboost
                                                                   +Reset Max G->YES->NO
                                                                   +Reset Max RPM->YES->NO
                                                                   +Speed->log speed->calibrate
                                                                   +Set Time
                                                                   +ETC.
                                                                 
I want to run an IF statement to check whether setup has been entered and only load the corresponding menu if this is the case. Also, is it possible to hide menu labels? The two views will themselves serve as labels and I do not have space to print a menu label to the LCD when in these views.

Bebbetufs

#58
Dec 30, 2010, 06:25 pm Last Edit: Dec 30, 2010, 06:39 pm by Bebbetufs Reason: 1
I'm having an extremely hard time figuring out how to use  getX().
Does it have to be placed inside a menuUseEvent() or a menuChangeEvent()?

Exactly how should it be called. I've tried these with no luck:
Code: [Select]
void menuChangeEvent(MenuChangeEvent changed)
{
    //Serial.print("Menu change: ");
    Serial.print("<-");
    Serial.println(changed.getLeft());
    Serial.print("^");
    Serial.println(changed.getBefore());
    Serial.print(">>");
    Serial.println(changed.getCurrent());
    Serial.print("v");
    Serial.println(changed.getAfter());
    Serial.print("->");
    Serial.println(changed.getRight());
}
Code: [Select]

void menuUseEvent(MenuUseEvent used)
{
    Serial.print("Menu use: ");
    Serial.println(used.item.getBefore());
    Serial.println(used.item.getCurrent());
    Serial.println(used.item.getCurrent(getBefore));
}


Also, what happened to the hasChildren() function? I'm using v.1.4

Go Up