MadBuilder Wizard

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 2. about 3 years by wycc
  2. 1. about 3 years by wycc
 

Wizard for the MadBuilder

The MadBuilder will provide a couple of wizard to generate different types of applications. The wizard will ask users to answer a couple of questions and generate project files from these answers.

Browse application

The browse application will use mb_animated_menu to display a animated menu. Users can select the type of menu. The wizard can generate up to two types of menus. The wizard will generate a scene file for each type of menu. The wizard will generate main.c which contains the default application framework which will load all menus by default. The callback functions will be generated in a seperated file whose name is the projectname.c.

This application can be compiled directly. Users will see the menu is displayed with default title and image. The look and feel can be customized by using the integrated inkscape-based editor.

For each menu, the wizard will create a separate sprite. The main scene browser.mbsvg will be loaded bythe MBAF.

int main(int argc, char * const argv[]) {
    MyAppData data;
    myApp = MBApp_Init("browser");
    MBApp_setData(myApp,&data);
    MyApp_InitContent();

    MBApp_loop(myApp);

    return 0;
}

The MyApp_InitContent will load other scene files.

MyApp_InitContent(char *dir)
{
    MyAppData *data = MBAPP_DATA(myApp,MyAppData);
    subject_t *key = MBAPP_keySubject(myApp);
    mb_sprite_t *sprite=myApp->rootsprite;

    data->m = mb_animated_menu_new(myApp,myApp->rootsprite,"item",NULL);
    mb_animated_menu_set_callback(data->m, browser_select_callback);
    mb_animated_menu_set_update_callback(data->m, browser_update_callback);
    MyApp_fillDirInfo(myApp,dir);
    mb_animated_menu_set_speed(data->m,300);
}

The MyAppData will be defined in a separate header file browser.h. The template of browser_select_callback and browser_update_callback will be created in browser.c.