comparison gui/mplayer/menu.c @ 32912:ca4d3fa55e43

Adjust the listItems structure. Add 'main' to members referring to the main window, switch bar with menu members and adjust the spelling of 'MenuItems' to the other 'Items'.
author ib
date Wed, 02 Mar 2011 16:05:37 +0000
parents e06fbdd8eb46
children 03b1051bed5c
comparison
equal deleted inserted replaced
32911:e06fbdd8eb46 32912:ca4d3fa55e43
50 // --- 50 // ---
51 if ( mplMenuItem != -1 ) 51 if ( mplMenuItem != -1 )
52 { 52 {
53 buf=(uint32_t *)mplMenuDrawBuffer; 53 buf=(uint32_t *)mplMenuDrawBuffer;
54 drw=(uint32_t *)appMPlayer.menuSelected.Bitmap.Image; 54 drw=(uint32_t *)appMPlayer.menuSelected.Bitmap.Image;
55 for ( y=appMPlayer.MenuItems[ mplMenuItem ].y; y < appMPlayer.MenuItems[ mplMenuItem ].y + appMPlayer.MenuItems[ mplMenuItem ].height; y++ ) 55 for ( y=appMPlayer.menuItems[ mplMenuItem ].y; y < appMPlayer.menuItems[ mplMenuItem ].y + appMPlayer.menuItems[ mplMenuItem ].height; y++ )
56 for ( x=appMPlayer.MenuItems[ mplMenuItem ].x; x < appMPlayer.MenuItems[ mplMenuItem ].x + appMPlayer.MenuItems[ mplMenuItem ].width; x++ ) 56 for ( x=appMPlayer.menuItems[ mplMenuItem ].x; x < appMPlayer.menuItems[ mplMenuItem ].x + appMPlayer.menuItems[ mplMenuItem ].width; x++ )
57 { 57 {
58 tmp=drw[ y * appMPlayer.menuSelected.width + x ]; 58 tmp=drw[ y * appMPlayer.menuSelected.width + x ];
59 if ( tmp != 0x00ff00ff ) buf[ y * appMPlayer.menuBase.width + x ]=tmp; 59 if ( tmp != 0x00ff00ff ) buf[ y * appMPlayer.menuBase.width + x ]=tmp;
60 } 60 }
61 } 61 }
83 } 83 }
84 84
85 for( i=0;i<=appMPlayer.NumberOfMenuItems;i++ ) 85 for( i=0;i<=appMPlayer.NumberOfMenuItems;i++ )
86 { 86 {
87 if ( wgIsRect( x,y, 87 if ( wgIsRect( x,y,
88 appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y, 88 appMPlayer.menuItems[i].x,appMPlayer.menuItems[i].y,
89 appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width,appMPlayer.MenuItems[i].y+appMPlayer.MenuItems[i].height ) ) { mplMenuItem=i; break; } 89 appMPlayer.menuItems[i].x+appMPlayer.menuItems[i].width,appMPlayer.menuItems[i].y+appMPlayer.menuItems[i].height ) ) { mplMenuItem=i; break; }
90 } 90 }
91 wsPostRedisplay( &appMPlayer.menuWindow ); 91 wsPostRedisplay( &appMPlayer.menuWindow );
92 } 92 }
93 93
94 void mplShowMenu( int mx,int my ) 94 void mplShowMenu( int mx,int my )
128 wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow ); 128 wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow );
129 129
130 if ( ( x < 0 ) || ( y < 0 ) ) return; 130 if ( ( x < 0 ) || ( y < 0 ) ) return;
131 131
132 // printf( "---------> %d %d,%d\n",i,x,y ); 132 // printf( "---------> %d %d,%d\n",i,x,y );
133 // printf( "--------> mi: %d,%d %dx%d\n",appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y,appMPlayer.MenuItems[i].width,appMPlayer.MenuItems[i].height ); 133 // printf( "--------> mi: %d,%d %dx%d\n",appMPlayer.menuItems[i].x,appMPlayer.menuItems[i].y,appMPlayer.menuItems[i].width,appMPlayer.menuItems[i].height );
134 if ( wgIsRect( x,y, 134 if ( wgIsRect( x,y,
135 appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y, 135 appMPlayer.menuItems[i].x,appMPlayer.menuItems[i].y,
136 appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width, 136 appMPlayer.menuItems[i].x+appMPlayer.menuItems[i].width,
137 appMPlayer.MenuItems[i].y+appMPlayer.MenuItems[i].height ) ) 137 appMPlayer.menuItems[i].y+appMPlayer.menuItems[i].height ) )
138 { 138 {
139 mplEventHandling( appMPlayer.MenuItems[i].message,(float)w ); 139 mplEventHandling( appMPlayer.menuItems[i].message,(float)w );
140 } 140 }
141 } 141 }
142 142
143 void mplMenuInit( void ) 143 void mplMenuInit( void )
144 { 144 {