annotate inkscape/firefox/template/textmenu/main.c @ 1381:9a585df24e52

Consider the width and height attribute for the rect elements. The inkscape will change the width and height directly without using transform when we resize the rectangle.
author wycc
date Wed, 23 Mar 2011 23:02:36 +0800
parents 26c302b47de1
children
rev   line source
371
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
1 #include <stdio.h>
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
2 #include <mb.h>
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
3 #include <string.h>
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
4 //#include "menu.h"
456
26c302b47de1 Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents: 454
diff changeset
5 #include "mb_af.h"
26c302b47de1 Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents: 454
diff changeset
6 #include "mb_ani_menu.h"
376
7d244a85dd68 Change the screen layout to make it more like an usual IDE.
wycc
parents: 371
diff changeset
7 #include "%n.h"
371
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
8
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
9
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
10 char *menus[] = {
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
11 "This is item 1",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
12 "This is item 2",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
13 "This is item 3",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
14 "This is item 4",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
15 "This is item 5",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
16 "This is item 6",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
17 "This is item 7",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
18 "This is item 8"
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
19 };
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
20
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
21
454
9b8dda201ccb Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 376
diff changeset
22 mbaf_t *myApp;
371
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
23
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
24 _MyApp_InitContent(int argc, char *argv[])
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
25 {
454
9b8dda201ccb Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 376
diff changeset
26 MyAppData *data = MBAF_DATA(myApp,MyAppData);
9b8dda201ccb Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 376
diff changeset
27 subject_t *key = MBAF_KB_SUBJECT(myApp);
371
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
28 char name[255];
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
29 coord_t *l;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
30 int i;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
31 mb_sprite_t *sprite=myApp->rootsprite;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
32
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
33 data->m = mb_animated_menu_new(myApp,myApp->rootsprite,"item",menus);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
34 mb_animated_menu_set_callback(data->m, myselect_callback);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
35 MyApp_InitContent(myApp,argc,argv);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
36 }
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
37
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
38 int main(int argc, char * const argv[]) {
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
39 subject_t *subject;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
40 mb_obj_t *button;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
41 MyAppData data;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
42
456
26c302b47de1 Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents: 454
diff changeset
43 myApp = mbaf_init("list", "");
454
9b8dda201ccb Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 376
diff changeset
44 mbaf_set_data(myApp,&data);
371
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
45 _MyApp_InitContent(argc,argv);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
46
454
9b8dda201ccb Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 376
diff changeset
47 mbaf_loop(myApp);
371
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
48
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
49 return 0;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
50 }
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
51
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
52 /* vim: set ts=4 */