annotate gui/ui/menu.c @ 37003:2d8157b3b386

Fix the index passed to PutImage() for item type itVPotmeter. Unlike the position for drawing the button (from bottom to top), the index for the phase image has to be in the usual range, i.e. 0 for 0% and numphases - 1 for 100%, so that the phase image can be designed straightforwardly. Fix the parameter although PutImage() currently doesn't work for item type itVPotmeter at all.
author ib
date Fri, 28 Mar 2014 12:21:07 +0000
parents 6bb8d4f4a7b0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
2 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
5 * it under the terms of the GNU General Public License as published by
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
7 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
8 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
12 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
13 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
14 * You should have received a copy of the GNU General Public License along
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
17 */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
18
34699
ed0e00db4306 Cosmetic: Move, change and add some comments on GUI windows.
ib
parents: 34684
diff changeset
19 /* menu window */
ed0e00db4306 Cosmetic: Move, change and add some comments on GUI windows.
ib
parents: 34684
diff changeset
20
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21 #include <stdlib.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
22 #include <stdio.h>
33123
9566100d88a1 Replace inttypes.h by stdint.h and remove inttypes.h where unneeded.
ib
parents: 33084
diff changeset
23 #include <stdint.h>
33738
998f94e62a61 Remove unnecessary #include "gui/interface.h".
ib
parents: 33556
diff changeset
24 #include <string.h>
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
25
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
26 #include "help_mp.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
27 #include "mp_msg.h"
35525
e27855a45128 Rebuild GUI directory structure.
ib
parents: 35493
diff changeset
28 #include "gui/app/app.h"
e27855a45128 Rebuild GUI directory structure.
ib
parents: 35493
diff changeset
29 #include "gui/app/gui.h"
35772
3fec1d4b2736 Relocate uiMainEvent() prototype.
ib
parents: 35768
diff changeset
30 #include "actions.h"
35528
ab07b17fddfb Rebuild GUI directory structure.
ib
parents: 35525
diff changeset
31 #include "ui.h"
35796
497a1c45a597 Add uiMainDone(), uiVideoDone(), uiPlaybarDone() and uiMenuDone().
ib
parents: 35782
diff changeset
32 #include "gui/util/mem.h"
36962
6bb8d4f4a7b0 Add missing #include.
ib
parents: 36694
diff changeset
33 #include "gui/wm/ws.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
34
35529
8ad4d2fb46e8 Rebuild GUI directory structure.
ib
parents: 35528
diff changeset
35 #include "gui/dialog/dialog.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
36
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
37 unsigned char * menuDrawBuffer = NULL;
35750
b4599f797483 Rename menuRender uiMenuRender and make it static.
ib
parents: 35744
diff changeset
38 static int uiMenuRender = True;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
39 int menuItem = -1;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
40 int oldMenuItem = -1;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
41 int menuX,menuY;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
43 static void uiMenuDraw( void )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
44 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45 uint32_t * buf = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
46 uint32_t * drw = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47 int x,y,tmp;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
48
35803
8e5a3da0a858 Remove pointless condition.
ib
parents: 35802
diff changeset
49 if ( !guiApp.menuIsPresent ) return;
35750
b4599f797483 Rename menuRender uiMenuRender and make it static.
ib
parents: 35744
diff changeset
50 if ( !uiMenuRender && !guiApp.menuWindow.Visible ) return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51
35750
b4599f797483 Rename menuRender uiMenuRender and make it static.
ib
parents: 35744
diff changeset
52 if ( uiMenuRender || menuItem != oldMenuItem )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
54 memcpy( menuDrawBuffer,guiApp.menu.Bitmap.Image,guiApp.menu.Bitmap.ImageSize );
34684
b03481253518 Cosmetic: Prefer C style for single line comments.
ib
parents: 34472
diff changeset
55 /* --- */
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
56 if ( menuItem != -1 )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
58 buf=(uint32_t *)menuDrawBuffer;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
59 drw=(uint32_t *)guiApp.menuSelected.Bitmap.Image;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
60 for ( y=guiApp.menuItems[ menuItem ].y; y < guiApp.menuItems[ menuItem ].y + guiApp.menuItems[ menuItem ].height; y++ )
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
61 for ( x=guiApp.menuItems[ menuItem ].x; x < guiApp.menuItems[ menuItem ].x + guiApp.menuItems[ menuItem ].width; x++ )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
63 tmp=drw[ y * guiApp.menuSelected.width + x ];
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
64 if ( !IS_TRANSPARENT ( tmp ) ) buf[ y * guiApp.menu.width + x ]=tmp;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
65 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
66 }
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
67 oldMenuItem=menuItem;
34684
b03481253518 Cosmetic: Prefer C style for single line comments.
ib
parents: 34472
diff changeset
68 /* --- */
35744
bfe51acc36fb Cosmetic: Rename wsImageConvert() wsImageRender().
ib
parents: 35683
diff changeset
69 wsImageRender( &guiApp.menuWindow,menuDrawBuffer );
35750
b4599f797483 Rename menuRender uiMenuRender and make it static.
ib
parents: 35744
diff changeset
70 uiMenuRender=False;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71 }
35681
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
72 wsImageDraw( &guiApp.menuWindow );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
73 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74
35778
8ba56e7c14fb Set MouseHandler for menu window.
ib
parents: 35773
diff changeset
75 static void uiMenuMouse( int Button,int X,int Y,int RX,int RY )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
77 int x,y,i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
78
36010
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 35803
diff changeset
79 (void) Button;
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 35803
diff changeset
80 (void) RX;
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 35803
diff changeset
81 (void) RY;
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 35803
diff changeset
82
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
83 menuItem=-1;
35778
8ba56e7c14fb Set MouseHandler for menu window.
ib
parents: 35773
diff changeset
84 x=X - guiApp.menuWindow.X;
8ba56e7c14fb Set MouseHandler for menu window.
ib
parents: 35773
diff changeset
85 y=Y - guiApp.menuWindow.Y;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
86 if ( ( x < 0 ) || ( y < 0 ) || ( x > guiApp.menu.width ) || ( y > guiApp.menu.height ) )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
87 {
35681
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
88 wsWindowRedraw( &guiApp.menuWindow );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
89 return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
91
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
92 for( i=0;i<=guiApp.IndexOfMenuItems;i++ )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93 {
35675
9e2183017f1f Move wgIsRect from ws.h to gui.h.
ib
parents: 35658
diff changeset
94 if ( isInside( x,y,
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
95 guiApp.menuItems[i].x,guiApp.menuItems[i].y,
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
96 guiApp.menuItems[i].x+guiApp.menuItems[i].width,guiApp.menuItems[i].y+guiApp.menuItems[i].height ) ) { menuItem=i; break; }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
97 }
35681
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
98 wsWindowRedraw( &guiApp.menuWindow );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
99 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
100
35767
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
101 void uiMenuInit( void )
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
102 {
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
103
35803
8e5a3da0a858 Remove pointless condition.
ib
parents: 35802
diff changeset
104 if ( !guiApp.menuIsPresent ) return;
35767
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
105
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
106 guiApp.menu.x=0;
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
107 guiApp.menu.y=0;
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
108
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
109 if ( ( menuDrawBuffer = calloc( 1,guiApp.menu.Bitmap.ImageSize ) ) == NULL )
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
110 {
36694
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36670
diff changeset
111 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu] " MSGTR_GUI_MSG_MemoryErrorWindow );
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36670
diff changeset
112 gtkMessageBox( MSGBOX_FATAL,"[menu] " MSGTR_GUI_MSG_MemoryErrorWindow );
35767
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
113 return;
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
114 }
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
115
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
116 wsWindowCreate( &guiApp.menuWindow,
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
117 guiApp.menu.x,guiApp.menu.y,guiApp.menu.width,guiApp.menu.height,
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
118 wsOverredirect|wsHideFrame|wsMaxSize|wsMinSize|wsHideWindow,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,"MPlayer menu" );
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
119
35782
e30d541b3ea6 Relocate menu window initialization debug message.
ib
parents: 35780
diff changeset
120 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu] menuWindow ID: 0x%x\n",(int)guiApp.menuWindow.WindowID );
35767
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
121
35782
e30d541b3ea6 Relocate menu window initialization debug message.
ib
parents: 35780
diff changeset
122 wsWindowShape( &guiApp.menuWindow,guiApp.menu.Mask.Image );
35767
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
123
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
124 guiApp.menuWindow.DrawHandler=uiMenuDraw;
35778
8ba56e7c14fb Set MouseHandler for menu window.
ib
parents: 35773
diff changeset
125 guiApp.menuWindow.MouseHandler=uiMenuMouse;
35780
4073fff5efc7 Add new functions uiMainInit() and uiVideoInit().
ib
parents: 35778
diff changeset
126 // guiApp.menuWindow.KeyHandler=guiApp.mainWindow.KeyHandler;
35767
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
127 uiMenuRender=True; wsWindowRedraw( &guiApp.menuWindow );
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
128 }
23e241430e9c Cosmetic: Replace uiMenuInit().
ib
parents: 35766
diff changeset
129
35796
497a1c45a597 Add uiMainDone(), uiVideoDone(), uiPlaybarDone() and uiMenuDone().
ib
parents: 35782
diff changeset
130 void uiMenuDone( void )
497a1c45a597 Add uiMainDone(), uiVideoDone(), uiPlaybarDone() and uiMenuDone().
ib
parents: 35782
diff changeset
131 {
497a1c45a597 Add uiMainDone(), uiVideoDone(), uiPlaybarDone() and uiMenuDone().
ib
parents: 35782
diff changeset
132 nfree(menuDrawBuffer);
497a1c45a597 Add uiMainDone(), uiVideoDone(), uiPlaybarDone() and uiMenuDone().
ib
parents: 35782
diff changeset
133 wsWindowDestroy(&guiApp.menuWindow);
36291
b2edfe1a11a6 Process events after destroying a window.
ib
parents: 36280
diff changeset
134 wsEvents();
35796
497a1c45a597 Add uiMainDone(), uiVideoDone(), uiPlaybarDone() and uiMenuDone().
ib
parents: 35782
diff changeset
135 }
497a1c45a597 Add uiMainDone(), uiVideoDone(), uiPlaybarDone() and uiMenuDone().
ib
parents: 35782
diff changeset
136
35766
16ed8155439b Rename uiShowMenu() uiMenuShow() and uiHideMenu() uiMenuHide().
ib
parents: 35762
diff changeset
137 void uiMenuShow( int mx,int my )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
138 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
139 int x,y;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
140
35803
8e5a3da0a858 Remove pointless condition.
ib
parents: 35802
diff changeset
141 if ( !guiApp.menuIsPresent ) return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
142
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
143 x=mx;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
144 if ( x + guiApp.menuWindow.Width > wsMaxX ) x=wsMaxX - guiApp.menuWindow.Width - 1 + wsOrgX;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
145 y=my;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
146 if ( y + guiApp.menuWindow.Height > wsMaxY ) y=wsMaxY - guiApp.menuWindow.Height - 1 + wsOrgY;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
147
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
148 menuX=x; menuY=y;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
149
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
150 menuItem = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
151
35681
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
152 wsWindowMove( &guiApp.menuWindow,True,x,y );
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
153 wsWindowRaiseTop( wsDisplay,guiApp.menuWindow.WindowID );
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
154 wsWindowLayer( wsDisplay,guiApp.menuWindow.WindowID,1 );
35750
b4599f797483 Rename menuRender uiMenuRender and make it static.
ib
parents: 35744
diff changeset
155 uiMenuRender=True;
35681
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
156 wsWindowVisibility( &guiApp.menuWindow,wsShowWindow );
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
157 wsWindowRedraw( &guiApp.menuWindow );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
158 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
159
35766
16ed8155439b Rename uiShowMenu() uiMenuShow() and uiHideMenu() uiMenuHide().
ib
parents: 35762
diff changeset
160 void uiMenuHide( int mx,int my,int w )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
161 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
162 int x,y,i=menuItem;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
163
35803
8e5a3da0a858 Remove pointless condition.
ib
parents: 35802
diff changeset
164 if ( !guiApp.menuIsPresent ) return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
165
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
166 x=mx-menuX;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
167 y=my-menuY;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
168 // x=RX - guiApp.menuWindow.X;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
169 // y=RY - guiApp.menuWindow.Y;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
170
35681
80c5c89f77d6 Cosmetic: Rename ws functions for the sake of consistency.
ib
parents: 35675
diff changeset
171 wsWindowVisibility( &guiApp.menuWindow,wsHideWindow );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
172
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
173 if ( ( x < 0 ) || ( y < 0 ) ) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
174
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
175 // printf( "---------> %d %d,%d\n",i,x,y );
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
176 // printf( "--------> mi: %d,%d %dx%d\n",guiApp.menuItems[i].x,guiApp.menuItems[i].y,guiApp.menuItems[i].width,guiApp.menuItems[i].height );
35675
9e2183017f1f Move wgIsRect from ws.h to gui.h.
ib
parents: 35658
diff changeset
177 if ( isInside( x,y,
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
178 guiApp.menuItems[i].x,guiApp.menuItems[i].y,
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
179 guiApp.menuItems[i].x+guiApp.menuItems[i].width,
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
180 guiApp.menuItems[i].y+guiApp.menuItems[i].height ) )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181 {
36280
e160aade4b6d Remove unnecessary type conversions.
ib
parents: 36036
diff changeset
182 uiEvent( guiApp.menuItems[i].message,w );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
183 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
184 }