开发者

Library to manage menus in embedded device for C/C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

I'm looking for a library to manage menus. I'm looking for something which is based on configuration files. It doesn't have to manage keyboard input or display, just the menu logic. What I have in mind something like:

//menu.xml
<menu>
    <Start />
    <Stop />
    <Configuration displayname="Configure System">
        <Sound type="toggle" />
        <Speed display="Speed related settings">
           <Speedy type="toggle" default="on" />
           <Optimizations type="toggle" />
        </Speed>
    </Configuration>
    <Filesystem>
         <SaveSnapshot />
         <LoadSnapshot />
    </Filesystem>
</menu>

In the code we would have:

//menu.cpp
Menu menu("menu.xml");
menu.bind("Sav开发者_StackOverflow中文版eSnapshot",saveSnapshotPressed);
menu.bind("LoadSnapshot",loadSnapshotPressed);
menu.bind("Sound",soundSetTo);
...
void onKeyPressed(key_t key) {
...
    switch (key) {
    case KEY_UP:
        menu.goUp();
        break;
    case KEY_DOWN:
        menu.goDown();
        break;
    case KEY_ENTER:
        menu.action();
        break;
    }
// display.cpp
void render(...) {
    for (int i=0;i<menu.items().size();++i) {
        renderText(getMenuCoord(i),menu.items()[i].c_str());
    }
    ...
}

Such a library could be very useful to display menus in embedded device.

I'll be glad to hear if such library exists, or is there a better idea for this library.


There are things like Kaleido: http://www.digitalairways.com/kaleido-engine.htm which are very nice, but pricey.

Emwin is simpler and cheaper but nothing like as rich in terms of functionality: http://www.segger.com/cms/emwin.html


You may want to look at the Android SDK. This too, may be more than you want to handle, but there may be value in replicating, or possibly using any tools google may have.


I know this is an old question but maybe someone else, has the same problem.

I think CLI is the solution you need.

CLI is a toolkit that allows you to easily implement C++ and Java Command Line Interfaces

It has XML configuration file and generates C++/Java source which you then link. I haven't tested it, just found it when searching for something to create CLI menus easier.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜