vkQuake2 doxygen  1.0 dev
qmenu.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 #include <string.h>
21 #include <ctype.h>
22 
23 #include "client.h"
24 #include "qmenu.h"
25 
26 static void Action_DoEnter( menuaction_s *a );
27 static void Action_Draw( menuaction_s *a );
28 static void Menu_DrawStatusBar( const char *string );
29 static void Menulist_DoEnter( menulist_s *l );
30 static void MenuList_Draw( menulist_s *l );
31 static void Separator_Draw( menuseparator_s *s );
32 static void Slider_DoSlide( menuslider_s *s, int dir );
33 static void Slider_Draw( menuslider_s *s );
34 static void SpinControl_DoEnter( menulist_s *s );
35 static void SpinControl_Draw( menulist_s *s );
36 static void SpinControl_DoSlide( menulist_s *s, int dir );
37 
38 #define RCOLUMN_OFFSET 16 * vid_hudscale->value
39 #define LCOLUMN_OFFSET -16 * vid_hudscale->value
40 
41 extern refexport_t re;
42 extern viddef_t viddef;
43 extern cvar_t *vid_hudscale;
44 
45 #define VID_WIDTH viddef.width
46 #define VID_HEIGHT viddef.height
47 
48 #define Draw_Char re.DrawChar
49 #define Draw_Fill re.DrawFill
50 
52 {
53  if ( a->generic.callback )
54  a->generic.callback( a );
55 }
56 
58 {
59  if ( a->generic.flags & QMF_LEFT_JUSTIFY )
60  {
61  if ( a->generic.flags & QMF_GRAYED )
63  else
65  }
66  else
67  {
68  if ( a->generic.flags & QMF_GRAYED )
70  else
72  }
73  if ( a->generic.ownerdraw )
74  a->generic.ownerdraw( a );
75 }
76 
78 {
79  if ( f->generic.callback )
80  {
81  f->generic.callback( f );
82  return true;
83  }
84  return false;
85 }
86 
88 {
89  int i;
90  char tempbuffer[128]="";
91 
92  if ( f->generic.name )
94 
95  strncpy( tempbuffer, f->buffer + f->visible_offset, f->visible_length );
96 
97  Draw_Char( f->generic.x + f->generic.parent->x + 16 * vid_hudscale->value, f->generic.y + f->generic.parent->y - 4 * vid_hudscale->value, 18 );
98  Draw_Char( f->generic.x + f->generic.parent->x + 16 * vid_hudscale->value, f->generic.y + f->generic.parent->y + 4 * vid_hudscale->value, 24 );
99 
102 
103  for ( i = 0; i < f->visible_length; i++ )
104  {
105  Draw_Char( f->generic.x + f->generic.parent->x + 24 * vid_hudscale->value + i * 8 * vid_hudscale->value, f->generic.y + f->generic.parent->y - 4 * vid_hudscale->value, 19 );
106  Draw_Char( f->generic.x + f->generic.parent->x + 24 * vid_hudscale->value + i * 8 * vid_hudscale->value, f->generic.y + f->generic.parent->y + 4 * vid_hudscale->value, 25 );
107  }
108 
109  Menu_DrawString( f->generic.x + f->generic.parent->x + 24 * vid_hudscale->value, f->generic.y + f->generic.parent->y, tempbuffer );
110 
111  if ( Menu_ItemAtCursor( f->generic.parent ) == f )
112  {
113  int offset;
114 
115  if ( f->visible_offset )
116  offset = f->visible_length;
117  else
118  offset = f->cursor;
119 
120  if ( ( ( int ) ( Sys_Milliseconds() / 250 ) ) & 1 )
121  {
122  Draw_Char( f->generic.x + f->generic.parent->x + ( offset + 2 ) * 8 * vid_hudscale->value + 8 * vid_hudscale->value,
123  f->generic.y + f->generic.parent->y,
124  11 );
125  }
126  else
127  {
128  Draw_Char( f->generic.x + f->generic.parent->x + ( offset + 2 ) * 8 * vid_hudscale->value + 8 * vid_hudscale->value,
129  f->generic.y + f->generic.parent->y,
130  ' ' );
131  }
132  }
133 }
134 
136 {
137  extern int keydown[];
138 
139  switch ( key )
140  {
141  case K_KP_SLASH:
142  key = '/';
143  break;
144  case K_KP_MINUS:
145  key = '-';
146  break;
147  case K_KP_PLUS:
148  key = '+';
149  break;
150  case K_KP_HOME:
151  key = '7';
152  break;
153  case K_KP_UPARROW:
154  key = '8';
155  break;
156  case K_KP_PGUP:
157  key = '9';
158  break;
159  case K_KP_LEFTARROW:
160  key = '4';
161  break;
162  case K_KP_5:
163  key = '5';
164  break;
165  case K_KP_RIGHTARROW:
166  key = '6';
167  break;
168  case K_KP_END:
169  key = '1';
170  break;
171  case K_KP_DOWNARROW:
172  key = '2';
173  break;
174  case K_KP_PGDN:
175  key = '3';
176  break;
177  case K_KP_INS:
178  key = '0';
179  break;
180  case K_KP_DEL:
181  key = '.';
182  break;
183  }
184 
185  if ( key > 127 )
186  {
187  switch ( key )
188  {
189  case K_DEL:
190  default:
191  return false;
192  }
193  }
194 
195  /*
196  ** support pasting from the clipboard
197  */
198  if ( ( toupper( key ) == 'V' && keydown[K_CTRL] ) ||
199  ( ( ( key == K_INS ) || ( key == K_KP_INS ) ) && keydown[K_SHIFT] ) )
200  {
201  char *cbd;
202 
203  if ( ( cbd = Sys_GetClipboardData() ) != 0 )
204  {
205  strtok( cbd, "\n\r\b" );
206 
207  strncpy( f->buffer, cbd, f->length - 1 );
208  f->cursor = (int)strlen( f->buffer );
209  f->visible_offset = f->cursor - f->visible_length;
210  if ( f->visible_offset < 0 )
211  f->visible_offset = 0;
212 
213  free( cbd );
214  }
215  return true;
216  }
217 
218  switch ( key )
219  {
220  case K_KP_LEFTARROW:
221  case K_LEFTARROW:
222  case K_BACKSPACE:
223  if ( f->cursor > 0 )
224  {
225  memmove( &f->buffer[f->cursor-1], &f->buffer[f->cursor], strlen( &f->buffer[f->cursor] ) + 1 );
226  f->cursor--;
227 
228  if ( f->visible_offset )
229  {
230  f->visible_offset--;
231  }
232  }
233  break;
234 
235  case K_KP_DEL:
236  case K_DEL:
237  memmove( &f->buffer[f->cursor], &f->buffer[f->cursor+1], strlen( &f->buffer[f->cursor+1] ) + 1 );
238  break;
239 
240  case K_KP_ENTER:
241  case K_ENTER:
242  case K_ESCAPE:
243  case K_TAB:
244  return false;
245 
246  case K_SPACE:
247  default:
248  if ( !isdigit( key ) && ( f->generic.flags & QMF_NUMBERSONLY ) )
249  return false;
250 
251  if ( f->cursor < f->length )
252  {
253  f->buffer[f->cursor++] = key;
254  f->buffer[f->cursor] = 0;
255 
256  if ( f->cursor > f->visible_length )
257  {
258  f->visible_offset++;
259  }
260  }
261  }
262 
263  return true;
264 }
265 
266 void Menu_AddItem( menuframework_s *menu, void *item )
267 {
268  if ( menu->nitems == 0 )
269  menu->nslots = 0;
270 
271  if ( menu->nitems < MAXMENUITEMS )
272  {
273  menu->items[menu->nitems] = item;
274  ( ( menucommon_s * ) menu->items[menu->nitems] )->parent = menu;
275  menu->nitems++;
276  }
277 
278  menu->nslots = Menu_TallySlots( menu );
279 }
280 
281 /*
282 ** Menu_AdjustCursor
283 **
284 ** This function takes the given menu, the direction, and attempts
285 ** to adjust the menu's cursor so that it's at the next available
286 ** slot.
287 */
289 {
290  menucommon_s *citem;
291 
292  /*
293  ** see if it's in a valid spot
294  */
295  if ( m->cursor >= 0 && m->cursor < m->nitems )
296  {
297  if ( ( citem = Menu_ItemAtCursor( m ) ) != 0 )
298  {
299  if ( citem->type != MTYPE_SEPARATOR )
300  return;
301  }
302  }
303 
304  /*
305  ** it's not in a valid spot, so crawl in the direction indicated until we
306  ** find a valid spot
307  */
308  if ( dir == 1 )
309  {
310  while ( 1 )
311  {
312  citem = Menu_ItemAtCursor( m );
313  if ( citem )
314  if ( citem->type != MTYPE_SEPARATOR )
315  break;
316  m->cursor += dir;
317  if ( m->cursor >= m->nitems )
318  m->cursor = 0;
319  }
320  }
321  else
322  {
323  while ( 1 )
324  {
325  citem = Menu_ItemAtCursor( m );
326  if ( citem )
327  if ( citem->type != MTYPE_SEPARATOR )
328  break;
329  m->cursor += dir;
330  if ( m->cursor < 0 )
331  m->cursor = m->nitems - 1;
332  }
333  }
334 }
335 
337 {
338  int height;
339 
340  height = ( ( menucommon_s * ) menu->items[menu->nitems-1])->y;
341  height += 10;
342 
343  menu->y = ( VID_HEIGHT - height ) / 2;
344 }
345 
347 {
348  int i;
349  menucommon_s *item;
350 
351  /*
352  ** draw contents
353  */
354  for ( i = 0; i < menu->nitems; i++ )
355  {
356  switch ( ( ( menucommon_s * ) menu->items[i] )->type )
357  {
358  case MTYPE_FIELD:
359  Field_Draw( ( menufield_s * ) menu->items[i] );
360  break;
361  case MTYPE_SLIDER:
362  Slider_Draw( ( menuslider_s * ) menu->items[i] );
363  break;
364  case MTYPE_LIST:
365  MenuList_Draw( ( menulist_s * ) menu->items[i] );
366  break;
367  case MTYPE_SPINCONTROL:
368  SpinControl_Draw( ( menulist_s * ) menu->items[i] );
369  break;
370  case MTYPE_ACTION:
371  Action_Draw( ( menuaction_s * ) menu->items[i] );
372  break;
373  case MTYPE_SEPARATOR:
374  Separator_Draw( ( menuseparator_s * ) menu->items[i] );
375  break;
376  }
377  }
378 
379  item = Menu_ItemAtCursor( menu );
380 
381  if ( item && item->cursordraw )
382  {
383  item->cursordraw( item );
384  }
385  else if ( menu->cursordraw )
386  {
387  menu->cursordraw( menu );
388  }
389  else if ( item && item->type != MTYPE_FIELD )
390  {
391  if ( item->flags & QMF_LEFT_JUSTIFY )
392  {
393  Draw_Char( menu->x + item->x - 24*vid_hudscale->value + item->cursor_offset*vid_hudscale->value, menu->y + item->y, 12 + ( ( int ) ( Sys_Milliseconds()/250 ) & 1 ) );
394  }
395  else
396  {
397  Draw_Char( menu->x + item->cursor_offset*vid_hudscale->value, menu->y + item->y, 12 + ( ( int ) ( Sys_Milliseconds()/250 ) & 1 ) );
398  }
399  }
400 
401  if ( item )
402  {
403  if ( item->statusbarfunc )
404  item->statusbarfunc( ( void * ) item );
405  else if ( item->statusbar )
406  Menu_DrawStatusBar( item->statusbar );
407  else
408  Menu_DrawStatusBar( menu->statusbar );
409 
410  }
411  else
412  {
413  Menu_DrawStatusBar( menu->statusbar );
414  }
415 }
416 
417 void Menu_DrawStatusBar( const char *string )
418 {
419  if ( string )
420  {
421  int l = (int)strlen( string );
422  int maxcol = VID_WIDTH / (8*vid_hudscale->value);
423  int col = maxcol / 2 - l / 2;
424 
427  }
428  else
429  {
431  }
432 }
433 
434 void Menu_DrawString( int x, int y, const char *string )
435 {
436  unsigned i;
437 
438  for ( i = 0; i < strlen( string ); i++ )
439  {
440  Draw_Char( ( x + i*8*vid_hudscale->value ), y, string[i] );
441  }
442 }
443 
444 void Menu_DrawStringDark( int x, int y, const char *string )
445 {
446  unsigned i;
447 
448  for ( i = 0; i < strlen( string ); i++ )
449  {
450  Draw_Char( ( x + i*8*vid_hudscale->value ), y, string[i] + 128 );
451  }
452 }
453 
454 void Menu_DrawStringR2L( int x, int y, const char *string )
455 {
456  unsigned i;
457 
458  for ( i = 0; i < strlen( string ); i++ )
459  {
460  Draw_Char( ( x - i*8*vid_hudscale->value), y, string[strlen(string)-i-1] );
461  }
462 }
463 
464 void Menu_DrawStringR2LDark( int x, int y, const char *string )
465 {
466  unsigned i;
467 
468  for ( i = 0; i < strlen( string ); i++ )
469  {
470  Draw_Char( ( x - i*8*vid_hudscale->value ), y, string[strlen(string)-i-1]+128 );
471  }
472 }
473 
475 {
476  if ( m->cursor < 0 || m->cursor >= m->nitems )
477  return 0;
478 
479  return m->items[m->cursor];
480 }
481 
483 {
484  menucommon_s *item = ( menucommon_s * ) Menu_ItemAtCursor( s );
485 
486  if ( item )
487  {
488  switch ( item->type )
489  {
490  case MTYPE_FIELD:
491  return Field_DoEnter( ( menufield_s * ) item ) ;
492  case MTYPE_ACTION:
493  Action_DoEnter( ( menuaction_s * ) item );
494  return true;
495  case MTYPE_LIST:
496 // Menulist_DoEnter( ( menulist_s * ) item );
497  return false;
498  case MTYPE_SPINCONTROL:
499 // SpinControl_DoEnter( ( menulist_s * ) item );
500  return false;
501  }
502  }
503  return false;
504 }
505 
506 void Menu_SetStatusBar( menuframework_s *m, const char *string )
507 {
508  m->statusbar = string;
509 }
510 
512 {
513  menucommon_s *item = ( menucommon_s * ) Menu_ItemAtCursor( s );
514 
515  if ( item )
516  {
517  switch ( item->type )
518  {
519  case MTYPE_SLIDER:
520  Slider_DoSlide( ( menuslider_s * ) item, dir );
521  break;
522  case MTYPE_SPINCONTROL:
523  SpinControl_DoSlide( ( menulist_s * ) item, dir );
524  break;
525  }
526  }
527 }
528 
530 {
531  int i;
532  int total = 0;
533 
534  for ( i = 0; i < menu->nitems; i++ )
535  {
536  if ( ( ( menucommon_s * ) menu->items[i] )->type == MTYPE_LIST )
537  {
538  int nitems = 0;
539  const char **n = ( ( menulist_s * ) menu->items[i] )->itemnames;
540 
541  while (*n)
542  nitems++, n++;
543 
544  total += nitems;
545  }
546  else
547  {
548  total++;
549  }
550  }
551 
552  return total;
553 }
554 
556 {
557  int start;
558 
559  start = l->generic.y / 10 + 1;
560 
561  l->curvalue = l->generic.parent->cursor - start;
562 
563  if ( l->generic.callback )
564  l->generic.callback( l );
565 }
566 
568 {
569  const char **n;
570  int y = 0;
571 
573 
574  n = l->itemnames;
575 
576  Draw_Fill( l->generic.x - 112 + l->generic.parent->x, l->generic.parent->y + l->generic.y + l->curvalue*10 + 10, 128, 10, 16 );
577  while ( *n )
578  {
579  Menu_DrawStringR2LDark( l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET, l->generic.y + l->generic.parent->y + y + 10, *n );
580 
581  n++;
582  y += 10;
583  }
584 }
585 
587 {
588  if ( s->generic.name )
589  Menu_DrawStringR2LDark( s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y, s->generic.name );
590 }
591 
592 void Slider_DoSlide( menuslider_s *s, int dir )
593 {
594  s->curvalue += dir;
595 
596  if ( s->curvalue > s->maxvalue )
597  s->curvalue = s->maxvalue;
598  else if ( s->curvalue < s->minvalue )
599  s->curvalue = s->minvalue;
600 
601  if ( s->generic.callback )
602  s->generic.callback( s );
603 }
604 
605 #define SLIDER_RANGE 10
606 
608 {
609  int i;
610 
611  Menu_DrawStringR2LDark( s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET,
612  s->generic.y + s->generic.parent->y,
613  s->generic.name );
614 
615  s->range = ( s->curvalue - s->minvalue ) / ( float ) ( s->maxvalue - s->minvalue );
616 
617  if ( s->range < 0)
618  s->range = 0;
619  if ( s->range > 1)
620  s->range = 1;
621  Draw_Char( s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, 128);
622  for ( i = 0; i < SLIDER_RANGE; i++ )
623  Draw_Char( RCOLUMN_OFFSET + s->generic.x + i*8*vid_hudscale->value + s->generic.parent->x + 8*vid_hudscale->value, s->generic.y + s->generic.parent->y, 129);
624  Draw_Char( RCOLUMN_OFFSET + s->generic.x + i*8*vid_hudscale->value + s->generic.parent->x + 8*vid_hudscale->value, s->generic.y + s->generic.parent->y, 130);
625  Draw_Char( ( int ) ( 8*vid_hudscale->value + RCOLUMN_OFFSET + s->generic.parent->x + s->generic.x + (SLIDER_RANGE-1)*8*vid_hudscale->value * s->range ), s->generic.y + s->generic.parent->y, 131);
626 }
627 
629 {
630  s->curvalue++;
631  if ( s->itemnames[s->curvalue] == 0 )
632  s->curvalue = 0;
633 
634  if ( s->generic.callback )
635  s->generic.callback( s );
636 }
637 
639 {
640  s->curvalue += dir;
641 
642  if ( s->curvalue < 0 )
643  s->curvalue = 0;
644  else if ( s->itemnames[s->curvalue] == 0 )
645  s->curvalue--;
646 
647  if ( s->generic.callback )
648  s->generic.callback( s );
649 }
650 
652 {
653  char buffer[100];
654 
655  if ( s->generic.name )
656  {
657  Menu_DrawStringR2LDark( s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET,
658  s->generic.y + s->generic.parent->y,
659  s->generic.name );
660  }
661  if ( !strchr( s->itemnames[s->curvalue], '\n' ) )
662  {
663  Menu_DrawString( RCOLUMN_OFFSET + s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y, s->itemnames[s->curvalue] );
664  }
665  else
666  {
667  strcpy( buffer, s->itemnames[s->curvalue] );
668  *strchr( buffer, '\n' ) = 0;
669  Menu_DrawString( RCOLUMN_OFFSET + s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y, buffer );
670  strcpy( buffer, strchr( s->itemnames[s->curvalue], '\n' ) + 1 );
671  Menu_DrawString( RCOLUMN_OFFSET + s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y + 10 * vid_hudscale->value, buffer );
672  }
673 }
674 
K_KP_ENTER
#define K_KP_ENTER
Definition: keys.h:70
menucommon_s::cursordraw
void(* cursordraw)(void *self)
Definition: qmenu.h:79
K_INS
#define K_INS
Definition: keys.h:53
menuseparator_s
Definition: qmenu.h:118
height
GLsizei height
Definition: qgl_win.c:69
menufield_s::visible_offset
int visible_offset
Definition: qmenu.h:90
K_KP_RIGHTARROW
#define K_KP_RIGHTARROW
Definition: keys.h:66
RCOLUMN_OFFSET
#define RCOLUMN_OFFSET
Definition: qmenu.c:38
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
K_SPACE
#define K_SPACE
Definition: keys.h:28
Draw_Char
#define Draw_Char
Definition: qmenu.c:48
Field_DoEnter
qboolean Field_DoEnter(menufield_s *f)
Definition: qmenu.c:77
_tag_menuframework::items
void * items[64]
Definition: qmenu.h:56
VID_WIDTH
#define VID_WIDTH
Definition: qmenu.c:45
menufield_s::generic
menucommon_s generic
Definition: qmenu.h:84
menufield_s::visible_length
int visible_length
Definition: qmenu.h:89
keydown
qboolean keydown[256]
Definition: keys.c:45
menucommon_s::type
int type
Definition: qmenu.h:66
_tag_menuframework::y
int y
Definition: qmenu.h:51
menufield_s::length
int length
Definition: qmenu.h:88
MAXMENUITEMS
#define MAXMENUITEMS
Definition: qmenu.h:23
SpinControl_Draw
static void SpinControl_Draw(menulist_s *s)
Definition: qmenu.c:651
K_BACKSPACE
#define K_BACKSPACE
Definition: keys.h:32
K_KP_END
#define K_KP_END
Definition: keys.h:67
qboolean
qboolean
Definition: q_shared.h:63
x
GLint GLenum GLint x
Definition: qgl_win.c:116
K_ENTER
#define K_ENTER
Definition: keys.h:26
K_KP_MINUS
#define K_KP_MINUS
Definition: keys.h:74
i
int i
Definition: q_shared.c:305
menucommon_s::flags
unsigned flags
Definition: qmenu.h:72
MenuList_Draw
static void MenuList_Draw(menulist_s *l)
Definition: qmenu.c:567
menucommon_s::x
int x
Definition: qmenu.h:68
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
QMF_LEFT_JUSTIFY
#define QMF_LEFT_JUSTIFY
Definition: qmenu.h:45
_tag_menuframework::statusbar
const char * statusbar
Definition: qmenu.h:58
menucommon_s::ownerdraw
void(* ownerdraw)(void *self)
Definition: qmenu.h:78
menuaction_s::generic
menucommon_s generic
Definition: qmenu.h:115
Menu_DrawStringR2L
void Menu_DrawStringR2L(int x, int y, const char *string)
Definition: qmenu.c:454
Menu_DrawStringDark
void Menu_DrawStringDark(int x, int y, const char *string)
Definition: qmenu.c:444
K_KP_PLUS
#define K_KP_PLUS
Definition: keys.h:75
Menu_Center
void Menu_Center(menuframework_s *menu)
Definition: qmenu.c:336
viddef_t
Definition: vid.h:27
cvar_s
Definition: q_shared.h:324
K_CTRL
#define K_CTRL
Definition: keys.h:39
qmenu.h
viddef
viddef_t viddef
Definition: vid_dll.c:54
QMF_GRAYED
#define QMF_GRAYED
Definition: qmenu.h:46
Menu_DrawStringR2LDark
void Menu_DrawStringR2LDark(int x, int y, const char *string)
Definition: qmenu.c:464
Menu_DrawString
void Menu_DrawString(int x, int y, const char *string)
Definition: qmenu.c:434
menufield_s::cursor
int cursor
Definition: qmenu.h:87
vid_hudscale
cvar_t * vid_hudscale
Definition: vid_dll.c:48
K_KP_5
#define K_KP_5
Definition: keys.h:65
Action_DoEnter
static void Action_DoEnter(menuaction_s *a)
Definition: qmenu.c:51
Menu_Draw
void Menu_Draw(menuframework_s *menu)
Definition: qmenu.c:346
K_KP_SLASH
#define K_KP_SLASH
Definition: keys.h:73
Draw_Fill
#define Draw_Fill
Definition: qmenu.c:49
menucommon_s::y
int y
Definition: qmenu.h:68
menucommon_s
Definition: qmenu.h:64
K_KP_INS
#define K_KP_INS
Definition: keys.h:71
menulist_s
Definition: qmenu.h:104
MTYPE_LIST
#define MTYPE_LIST
Definition: qmenu.h:26
Menu_ItemAtCursor
void * Menu_ItemAtCursor(menuframework_s *m)
Definition: qmenu.c:474
Menu_SelectItem
qboolean Menu_SelectItem(menuframework_s *s)
Definition: qmenu.c:482
Menu_AdjustCursor
void Menu_AdjustCursor(menuframework_s *m, int dir)
Definition: qmenu.c:288
menucommon_s::callback
void(* callback)(void *self)
Definition: qmenu.h:76
K_LEFTARROW
#define K_LEFTARROW
Definition: keys.h:35
refexport_t
Definition: ref.h:133
re
refexport_t re
Definition: vid_dll.c:32
_tag_menuframework::cursordraw
void(* cursordraw)(struct _tag_menuframework *m)
Definition: qmenu.h:60
_tag_menuframework::cursor
int cursor
Definition: qmenu.h:52
cvar_s::value
float value
Definition: q_shared.h:331
K_KP_DEL
#define K_KP_DEL
Definition: keys.h:72
K_KP_UPARROW
#define K_KP_UPARROW
Definition: keys.h:62
K_KP_HOME
#define K_KP_HOME
Definition: keys.h:61
menucommon_s::cursor_offset
int cursor_offset
Definition: qmenu.h:70
VID_HEIGHT
#define VID_HEIGHT
Definition: qmenu.c:46
MTYPE_ACTION
#define MTYPE_ACTION
Definition: qmenu.h:27
menuaction_s
Definition: qmenu.h:113
Slider_DoSlide
static void Slider_DoSlide(menuslider_s *s, int dir)
Definition: qmenu.c:592
SLIDER_RANGE
#define SLIDER_RANGE
Definition: qmenu.c:605
_tag_menuframework
Definition: qmenu.h:49
_tag_menuframework::nitems
int nitems
Definition: qmenu.h:54
menulist_s::curvalue
int curvalue
Definition: qmenu.h:108
s
static fixed16_t s
Definition: r_scan.c:30
y
GLint y
Definition: qgl_win.c:115
SpinControl_DoSlide
static void SpinControl_DoSlide(menulist_s *s, int dir)
Definition: qmenu.c:638
MTYPE_SLIDER
#define MTYPE_SLIDER
Definition: qmenu.h:25
Menu_DrawStatusBar
static void Menu_DrawStatusBar(const char *string)
Definition: qmenu.c:417
Menu_SetStatusBar
void Menu_SetStatusBar(menuframework_s *m, const char *string)
Definition: qmenu.c:506
Field_Draw
void Field_Draw(menufield_s *f)
Definition: qmenu.c:87
LCOLUMN_OFFSET
#define LCOLUMN_OFFSET
Definition: qmenu.c:39
_tag_menuframework::x
int x
Definition: qmenu.h:51
menucommon_s::statusbarfunc
void(* statusbarfunc)(void *self)
Definition: qmenu.h:77
Menulist_DoEnter
static void Menulist_DoEnter(menulist_s *l)
Definition: qmenu.c:555
menuslider_s
Definition: qmenu.h:93
menucommon_s::name
const char * name
Definition: qmenu.h:67
menufield_s
Definition: qmenu.h:82
Field_Key
qboolean Field_Key(menufield_s *f, int key)
Definition: qmenu.c:135
menulist_s::itemnames
const char ** itemnames
Definition: qmenu.h:110
MTYPE_SPINCONTROL
#define MTYPE_SPINCONTROL
Definition: qmenu.h:28
K_DEL
#define K_DEL
Definition: keys.h:54
_tag_menuframework::nslots
int nslots
Definition: qmenu.h:55
SpinControl_DoEnter
static void SpinControl_DoEnter(menulist_s *s)
Definition: qmenu.c:628
Menu_SlideItem
void Menu_SlideItem(menuframework_s *s, int dir)
Definition: qmenu.c:511
MTYPE_FIELD
#define MTYPE_FIELD
Definition: qmenu.h:30
Separator_Draw
static void Separator_Draw(menuseparator_s *s)
Definition: qmenu.c:586
K_KP_PGUP
#define K_KP_PGUP
Definition: keys.h:63
K_KP_DOWNARROW
#define K_KP_DOWNARROW
Definition: keys.h:68
K_ESCAPE
#define K_ESCAPE
Definition: keys.h:27
K_TAB
#define K_TAB
Definition: keys.h:25
K_SHIFT
#define K_SHIFT
Definition: keys.h:40
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
K_KP_PGDN
#define K_KP_PGDN
Definition: keys.h:69
menulist_s::generic
menucommon_s generic
Definition: qmenu.h:106
Menu_TallySlots
int Menu_TallySlots(menuframework_s *menu)
Definition: qmenu.c:529
MTYPE_SEPARATOR
#define MTYPE_SEPARATOR
Definition: qmenu.h:29
Menu_AddItem
void Menu_AddItem(menuframework_s *menu, void *item)
Definition: qmenu.c:266
Sys_GetClipboardData
char * Sys_GetClipboardData(void)
Definition: sys_win.c:431
menucommon_s::parent
menuframework_s * parent
Definition: qmenu.h:69
menufield_s::buffer
char buffer[80]
Definition: qmenu.h:86
K_KP_LEFTARROW
#define K_KP_LEFTARROW
Definition: keys.h:64
client.h
QMF_NUMBERSONLY
#define QMF_NUMBERSONLY
Definition: qmenu.h:47
Action_Draw
static void Action_Draw(menuaction_s *a)
Definition: qmenu.c:57
Slider_Draw
static void Slider_Draw(menuslider_s *s)
Definition: qmenu.c:607