doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ListWindow.cpp
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #include "../idlib/precompiled.h"
30 #pragma hdrstop
31 
32 #include "../framework/Session_local.h"
33 
34 #include "DeviceContext.h"
35 #include "Window.h"
36 #include "UserInterfaceLocal.h"
37 #include "SliderWindow.h"
38 #include "ListWindow.h"
39 
40 // Number of pixels above the text that the rect starts
41 static const int pixelOffset = 3;
42 
43 // number of pixels between columns
44 static const int tabBorder = 4;
45 
46 // Time in milliseconds between clicks to register as a double-click
47 static const int doubleClickSpeed = 300;
48 
50  typed = "";
51  typedTime = 0;
52  clickTime = 0;
53  currentSel.Clear();
54  top = 0;
55  sizeBias = 0;
56  horizontal = false;
57  scroller = new idSliderWindow(dc, gui);
58  multipleSel = false;
59 }
60 
62  dc = d;
63  gui = g;
64  CommonInit();
65 }
66 
68  gui = g;
69  CommonInit();
70 }
71 
72 void idListWindow::SetCurrentSel( int sel ) {
73  currentSel.Clear();
74  currentSel.Append( sel );
75 }
76 
78  int cur = currentSel.FindIndex( sel );
79  if ( cur >= 0 ) {
80  currentSel.RemoveIndex( cur );
81  }
82 }
83 
84 void idListWindow::AddCurrentSel( int sel ) {
85  currentSel.Append( sel );
86 }
87 
89  return ( currentSel.Num() ) ? currentSel[0] : 0;
90 }
91 
93  return ( currentSel.FindIndex( index ) >= 0 );
94 }
95 
96 const char *idListWindow::HandleEvent(const sysEvent_t *event, bool *updateVisuals) {
97  // need to call this to allow proper focus and capturing on embedded children
98  const char *ret = idWindow::HandleEvent(event, updateVisuals);
99 
100  float vert = GetMaxCharHeight();
101  int numVisibleLines = textRect.h / vert;
102 
103  int key = event->evValue;
104 
105  if ( event->evType == SE_KEY ) {
106  if ( !event->evValue2 ) {
107  // We only care about key down, not up
108  return ret;
109  }
110 
111  if ( key == K_MOUSE1 || key == K_MOUSE2 ) {
112  // If the user clicked in the scroller, then ignore it
113  if ( scroller->Contains(gui->CursorX(), gui->CursorY()) ) {
114  return ret;
115  }
116  }
117 
118  if ( ( key == K_ENTER || key == K_KP_ENTER ) ) {
119  RunScript( ON_ENTER );
120  return cmd;
121  }
122 
123  if ( key == K_MWHEELUP ) {
124  key = K_UPARROW;
125  } else if ( key == K_MWHEELDOWN ) {
126  key = K_DOWNARROW;
127  }
128 
129  if ( key == K_MOUSE1) {
130  if (Contains(gui->CursorX(), gui->CursorY())) {
131  int cur = ( int )( ( gui->CursorY() - actualY - pixelOffset ) / vert ) + top;
132  if ( cur >= 0 && cur < listItems.Num() ) {
133  if ( multipleSel && idKeyInput::IsDown( K_CTRL ) ) {
134  if ( IsSelected( cur ) ) {
135  ClearSelection( cur );
136  } else {
137  AddCurrentSel( cur );
138  }
139  } else {
140  if ( IsSelected( cur ) && ( gui->GetTime() < clickTime + doubleClickSpeed ) ) {
141  // Double-click causes ON_ENTER to get run
143  return cmd;
144  }
145  SetCurrentSel( cur );
146 
147  clickTime = gui->GetTime();
148  }
149  } else {
150  SetCurrentSel( listItems.Num() - 1 );
151  }
152  }
153  } else if ( key == K_UPARROW || key == K_PGUP || key == K_DOWNARROW || key == K_PGDN ) {
154  int numLines = 1;
155 
156  if ( key == K_PGUP || key == K_PGDN ) {
157  numLines = numVisibleLines / 2;
158  }
159 
160  if ( key == K_UPARROW || key == K_PGUP ) {
161  numLines = -numLines;
162  }
163 
164  if ( idKeyInput::IsDown( K_CTRL ) ) {
165  top += numLines;
166  } else {
167  SetCurrentSel( GetCurrentSel() + numLines );
168  }
169  } else {
170  return ret;
171  }
172  } else if ( event->evType == SE_CHAR ) {
173  if ( !idStr::CharIsPrintable(key) ) {
174  return ret;
175  }
176 
177  if ( gui->GetTime() > typedTime + 1000 ) {
178  typed = "";
179  }
180  typedTime = gui->GetTime();
181  typed.Append( key );
182 
183  for ( int i=0; i<listItems.Num(); i++ ) {
184  if ( idStr::Icmpn( typed, listItems[i], typed.Length() ) == 0 ) {
185  SetCurrentSel( i );
186  break;
187  }
188  }
189 
190  } else {
191  return ret;
192  }
193 
194  if ( GetCurrentSel() < 0 ) {
195  SetCurrentSel( 0 );
196  }
197 
198  if ( GetCurrentSel() >= listItems.Num() ) {
199  SetCurrentSel( listItems.Num() - 1 );
200  }
201 
202  if ( scroller->GetHigh() > 0.0f ) {
203  if ( !idKeyInput::IsDown( K_CTRL ) ) {
204  if ( top > GetCurrentSel() - 1 ) {
205  top = GetCurrentSel() - 1;
206  }
207  if ( top < GetCurrentSel() - numVisibleLines + 2 ) {
208  top = GetCurrentSel() - numVisibleLines + 2;
209  }
210  }
211 
212  if ( top > listItems.Num() - 2 ) {
213  top = listItems.Num() - 2;
214  }
215  if ( top < 0 ) {
216  top = 0;
217  }
219  } else {
220  top = 0;
221  scroller->SetValue(0.0f);
222  }
223 
224  if ( key != K_MOUSE1 ) {
225  // Send a fake mouse click event so onAction gets run in our parents
226  const sysEvent_t ev = sys->GenerateMouseButtonEvent( 1, true );
227  idWindow::HandleEvent(&ev, updateVisuals);
228  }
229 
230  if ( currentSel.Num() > 0 ) {
231  for ( int i = 0; i < currentSel.Num(); i++ ) {
232  gui->SetStateInt( va( "%s_sel_%i", listName.c_str(), i ), currentSel[i] );
233  }
234  } else {
235  gui->SetStateInt( va( "%s_sel_0", listName.c_str() ), 0 );
236  }
237  gui->SetStateInt( va( "%s_numsel", listName.c_str() ), currentSel.Num() );
238 
239  return ret;
240 }
241 
242 
243 bool idListWindow::ParseInternalVar(const char *_name, idParser *src) {
244  if (idStr::Icmp(_name, "horizontal") == 0) {
245  horizontal = src->ParseBool();
246  return true;
247  }
248  if (idStr::Icmp(_name, "listname") == 0) {
249  ParseString(src, listName);
250  return true;
251  }
252  if (idStr::Icmp(_name, "tabstops") == 0) {
253  ParseString(src, tabStopStr);
254  return true;
255  }
256  if (idStr::Icmp(_name, "tabaligns") == 0) {
257  ParseString(src, tabAlignStr);
258  return true;
259  }
260  if (idStr::Icmp(_name, "multipleSel") == 0) {
261  multipleSel = src->ParseBool();
262  return true;
263  }
264  if(idStr::Icmp(_name, "tabvaligns") == 0) {
266  return true;
267  }
268  if(idStr::Icmp(_name, "tabTypes") == 0) {
269  ParseString(src, tabTypeStr);
270  return true;
271  }
272  if(idStr::Icmp(_name, "tabIconSizes") == 0) {
274  return true;
275  }
276  if(idStr::Icmp(_name, "tabIconVOffset") == 0) {
278  return true;
279  }
280 
281  idStr strName = _name;
282  if(idStr::Icmp(strName.Left(4), "mtr_") == 0) {
283  idStr matName;
284  const idMaterial* mat;
285 
286  ParseString(src, matName);
287  mat = declManager->FindMaterial(matName);
288  mat->SetImageClassifications( 1 ); // just for resource tracking
289  if ( mat && !mat->TestMaterialFlag( MF_DEFAULTED ) ) {
290  mat->SetSort(SS_GUI );
291  }
292  iconMaterials.Set(_name, mat);
293  return true;
294  }
295 
296  return idWindow::ParseInternalVar(_name, src);
297 }
298 
299 idWinVar *idListWindow::GetWinVarByName(const char *_name, bool fixup, drawWin_t** owner) {
300  return idWindow::GetWinVarByName(_name, fixup, owner);
301 }
302 
305 
307 
308  idList<int> tabStops;
309  idList<int> tabAligns;
310  if (tabStopStr.Length()) {
312  idToken tok;
313  while (src.ReadToken(&tok)) {
314  if (tok == ",") {
315  continue;
316  }
317  tabStops.Append(atoi(tok));
318  }
319  }
320  if (tabAlignStr.Length()) {
322  idToken tok;
323  while (src.ReadToken(&tok)) {
324  if (tok == ",") {
325  continue;
326  }
327  tabAligns.Append(atoi(tok));
328  }
329  }
330  idList<int> tabVAligns;
331  if (tabVAlignStr.Length()) {
333  idToken tok;
334  while (src.ReadToken(&tok)) {
335  if (tok == ",") {
336  continue;
337  }
338  tabVAligns.Append(atoi(tok));
339  }
340  }
341 
342  idList<int> tabTypes;
343  if (tabTypeStr.Length()) {
345  idToken tok;
346  while (src.ReadToken(&tok)) {
347  if (tok == ",") {
348  continue;
349  }
350  tabTypes.Append(atoi(tok));
351  }
352  }
353  idList<idVec2> tabSizes;
354  if (tabIconSizeStr.Length()) {
356  idToken tok;
357  while (src.ReadToken(&tok)) {
358  if (tok == ",") {
359  continue;
360  }
361  idVec2 size;
362  size.x = atoi(tok);
363 
364  src.ReadToken(&tok); //","
365  src.ReadToken(&tok);
366 
367  size.y = atoi(tok);
368  tabSizes.Append(size);
369  }
370  }
371 
372  idList<float> tabIconVOffsets;
373  if (tabIconVOffsetStr.Length()) {
375  idToken tok;
376  while (src.ReadToken(&tok)) {
377  if (tok == ",") {
378  continue;
379  }
380  tabIconVOffsets.Append(atof(tok));
381  }
382  }
383 
384  int c = tabStops.Num();
385  bool doAligns = (tabAligns.Num() == tabStops.Num());
386  for (int i = 0; i < c; i++) {
387  idTabRect r;
388  r.x = tabStops[i];
389  r.w = (i < c - 1) ? tabStops[i+1] - r.x - tabBorder : -1;
390  r.align = (doAligns) ? tabAligns[i] : 0;
391  if(tabVAligns.Num() > 0) {
392  r.valign = tabVAligns[i];
393  } else {
394  r.valign = 0;
395  }
396  if(tabTypes.Num() > 0) {
397  r.type = tabTypes[i];
398  } else {
399  r.type = TAB_TYPE_TEXT;
400  }
401  if(tabSizes.Num() > 0) {
402  r.iconSize = tabSizes[i];
403  } else {
404  r.iconSize.Zero();
405  }
406  if(tabIconVOffsets.Num() > 0 ) {
407  r.iconVOffset = tabIconVOffsets[i];
408  } else {
409  r.iconVOffset = 0;
410  }
411  tabInfo.Append(r);
412  }
413  flags |= WIN_CANFOCUS;
414 }
415 
416 /*
417 ================
418 idListWindow::InitScroller
419 
420 This is the same as in idEditWindow
421 ================
422 */
423 void idListWindow::InitScroller( bool horizontal )
424 {
425  const char *thumbImage = "guis/assets/scrollbar_thumb.tga";
426  const char *barImage = "guis/assets/scrollbarv.tga";
427  const char *scrollerName = "_scrollerWinV";
428 
429  if (horizontal) {
430  barImage = "guis/assets/scrollbarh.tga";
431  scrollerName = "_scrollerWinH";
432  }
433 
434  const idMaterial *mat = declManager->FindMaterial( barImage );
435  mat->SetSort( SS_GUI );
436  sizeBias = mat->GetImageWidth();
437 
438  idRectangle scrollRect;
439  if (horizontal) {
440  sizeBias = mat->GetImageHeight();
441  scrollRect.x = 0;
442  scrollRect.y = (clientRect.h - sizeBias);
443  scrollRect.w = clientRect.w;
444  scrollRect.h = sizeBias;
445  } else {
446  scrollRect.x = (clientRect.w - sizeBias);
447  scrollRect.y = 0;
448  scrollRect.w = sizeBias;
449  scrollRect.h = clientRect.h;
450  }
451 
452  scroller->InitWithDefaults(scrollerName, scrollRect, foreColor, matColor, mat->GetName(), thumbImage, !horizontal, true);
454  scroller->SetBuddy(this);
455 }
456 
457 void idListWindow::Draw(int time, float x, float y) {
458  idVec4 color;
459  idStr work;
460  int count = listItems.Num();
462  float scale = textScale;
463  float lineHeight = GetMaxCharHeight();
464 
465  float bottom = textRect.Bottom();
466  float width = textRect.w;
467 
468  if ( scroller->GetHigh() > 0.0f ) {
469  if ( horizontal ) {
470  bottom -= sizeBias;
471  } else {
472  width -= sizeBias;
473  rect.w = width;
474  }
475  }
476 
477  if ( noEvents || !Contains(gui->CursorX(), gui->CursorY()) ) {
478  hover = false;
479  }
480 
481  for (int i = top; i < count; i++) {
482  if ( IsSelected( i ) ) {
483  rect.h = lineHeight;
484  dc->DrawFilledRect(rect.x, rect.y + pixelOffset, rect.w, rect.h, borderColor);
485  if ( flags & WIN_FOCUS ) {
486  idVec4 color = borderColor;
487  color.w = 1.0f;
488  dc->DrawRect(rect.x, rect.y + pixelOffset, rect.w, rect.h, 1.0f, color );
489  }
490  }
491  rect.y ++;
492  rect.h = lineHeight - 1;
493  if ( hover && !noEvents && Contains(rect, gui->CursorX(), gui->CursorY()) ) {
494  color = hoverColor;
495  } else {
496  color = foreColor;
497  }
498  rect.h = lineHeight + pixelOffset;
499  rect.y --;
500 
501  if ( tabInfo.Num() > 0 ) {
502  int start = 0;
503  int tab = 0;
504  int stop = listItems[i].Find('\t', 0);
505  while ( start < listItems[i].Length() ) {
506  if ( tab >= tabInfo.Num() ) {
507  common->Warning( "idListWindow::Draw: gui '%s' window '%s' tabInfo.Num() exceeded", gui->GetSourceFile(), name.c_str() );
508  break;
509  }
510  listItems[i].Mid(start, stop - start, work);
511 
512  rect.x = textRect.x + tabInfo[tab].x;
513  rect.w = (tabInfo[tab].w == -1) ? width - tabInfo[tab].x : tabInfo[tab].w;
514  dc->PushClipRect( rect );
515 
516  if ( tabInfo[tab].type == TAB_TYPE_TEXT ) {
517  dc->DrawText(work, scale, tabInfo[tab].align, color, rect, false, -1);
518  } else if (tabInfo[tab].type == TAB_TYPE_ICON) {
519 
520  const idMaterial **hashMat;
521  const idMaterial *iconMat;
522 
523  // leaving the icon name empty doesn't draw anything
524  if ( work[0] != '\0' ) {
525 
526  if ( iconMaterials.Get(work, &hashMat) == false ) {
527  iconMat = declManager->FindMaterial("_default");
528  } else {
529  iconMat = *hashMat;
530  }
531 
532  idRectangle iconRect;
533  iconRect.w = tabInfo[tab].iconSize.x;
534  iconRect.h = tabInfo[tab].iconSize.y;
535 
536  if(tabInfo[tab].align == idDeviceContext::ALIGN_LEFT) {
537  iconRect.x = rect.x;
538  } else if (tabInfo[tab].align == idDeviceContext::ALIGN_CENTER) {
539  iconRect.x = rect.x + rect.w/2.0f - iconRect.w/2.0f;
540  } else if (tabInfo[tab].align == idDeviceContext::ALIGN_RIGHT) {
541  iconRect.x = rect.x + rect.w - iconRect.w;
542  }
543 
544  if(tabInfo[tab].valign == 0) { //Top
545  iconRect.y = rect.y + tabInfo[tab].iconVOffset;
546  } else if(tabInfo[tab].valign == 1) { //Center
547  iconRect.y = rect.y + rect.h/2.0f - iconRect.h/2.0f + tabInfo[tab].iconVOffset;
548  } else if(tabInfo[tab].valign == 2) { //Bottom
549  iconRect.y = rect.y + rect.h - iconRect.h + tabInfo[tab].iconVOffset;
550  }
551 
552  dc->DrawMaterial(iconRect.x, iconRect.y, iconRect.w, iconRect.h, iconMat, idVec4(1.0f,1.0f,1.0f,1.0f), 1.0f, 1.0f);
553 
554  }
555  }
556 
557  dc->PopClipRect();
558 
559  start = stop + 1;
560  stop = listItems[i].Find('\t', start);
561  if ( stop < 0 ) {
562  stop = listItems[i].Length();
563  }
564  tab++;
565  }
566  rect.x = textRect.x;
567  rect.w = width;
568  } else {
569  dc->DrawText(listItems[i], scale, 0, color, rect, false, -1);
570  }
571  rect.y += lineHeight;
572  if ( rect.y > bottom ) {
573  break;
574  }
575  }
576 }
577 
578 void idListWindow::Activate(bool activate, idStr &act) {
579  idWindow::Activate(activate, act);
580 
581  if ( activate ) {
582  UpdateList();
583  }
584 }
585 
587  top = scroller->GetValue();
588 }
589 
591  idStr str, strName;
592  listItems.Clear();
593  for (int i = 0; i < MAX_LIST_ITEMS; i++) {
594  if (gui->State().GetString( va("%s_item_%i", listName.c_str(), i), "", str) ) {
595  if ( str.Length() ) {
596  listItems.Append(str);
597  }
598  } else {
599  break;
600  }
601  }
602  float vert = GetMaxCharHeight();
603  int fit = textRect.h / vert;
604  if ( listItems.Num() < fit ) {
605  scroller->SetRange(0.0f, 0.0f, 1.0f);
606  } else {
607  scroller->SetRange(0.0f, (listItems.Num() - fit) + 1.0f, 1.0f);
608  }
609 
610  SetCurrentSel( gui->State().GetInt( va( "%s_sel_0", listName.c_str() ) ) );
611 
612  float value = scroller->GetValue();
613  if ( value > listItems.Num() - 1 ) {
614  value = listItems.Num() - 1;
615  }
616  if ( value < 0.0f ) {
617  value = 0.0f;
618  }
619  scroller->SetValue(value);
620  top = value;
621 
622  typedTime = 0;
623  clickTime = 0;
624  typed = "";
625 }
626 
627 void idListWindow::StateChanged( bool redraw ) {
628  UpdateList();
629 }
630 
static bool IsDown(int keyNum)
Definition: KeyInput.cpp:271
GLdouble GLdouble bottom
Definition: qgl.h:273
GLubyte g
Definition: glext.h:4662
byte color[4]
Definition: MegaTexture.cpp:54
float GetMaxCharHeight()
Definition: Window.cpp:303
GLsizei const GLfloat * value
Definition: glext.h:3614
virtual void StateChanged(bool redraw=false)
Definition: ListWindow.cpp:627
int GetInt(const char *key, const char *defaultString="0") const
Definition: Dict.h:252
idWinFloat textScale
Definition: Window.h:405
virtual void SetStateInt(const char *varName, const int value)
idVec2 iconSize
Definition: ListWindow.h:44
bool Contains(float x, float y)
Definition: Window.cpp:681
idStrList listItems
Definition: ListWindow.h:87
float y
Definition: Vector.h:55
idStr tabStopStr
Definition: ListWindow.h:78
idSliderWindow * scroller
Definition: ListWindow.h:88
unsigned int flags
Definition: Window.h:371
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:4804
int Length(void) const
Definition: Str.h:702
void InitWithDefaults(const char *_name, const idRectangle &rect, const idVec4 &foreColor, const idVec4 &matColor, const char *_background, const char *thumbShader, bool _vertical, bool _scrollbar)
idStr tabIconSizeStr
Definition: ListWindow.h:82
idWinBool noEvents
Definition: Window.h:398
virtual bool ParseInternalVar(const char *name, idParser *src)
Definition: Window.cpp:1915
GLenum GLint GLint y
Definition: glext.h:2849
idWinVec4 matColor
Definition: Window.h:401
case const int
Definition: Callbacks.cpp:52
virtual void HandleBuddyUpdate(idWindow *buddy)
Definition: ListWindow.cpp:586
const int WIN_FOCUS
Definition: Window.h:44
virtual void Draw(int time, float x, float y)
Definition: ListWindow.cpp:457
void ParseString(idParser *src, idStr &out)
Definition: Window.cpp:1883
const char * GetName(void) const
Definition: DeclManager.h:140
bool multipleSel
Definition: ListWindow.h:85
idStr tabAlignStr
Definition: ListWindow.h:79
const char * Left(int len, idStr &result) const
Definition: Str.h:892
idStr listName
Definition: ListWindow.h:90
int GetImageHeight(void) const
Definition: Material.cpp:2526
GLuint GLuint GLsizei GLenum type
Definition: glext.h:2845
virtual bool ParseInternalVar(const char *name, idParser *src)
Definition: ListWindow.cpp:243
Definition: Token.h:71
void PushClipRect(float x, float y, float w, float h)
idDeviceContext * dc
Definition: Window.h:425
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
GLuint src
Definition: glext.h:5390
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
Definition: ListWindow.cpp:96
GLenum GLint x
Definition: glext.h:2849
int i
Definition: process.py:33
const int MAX_LIST_ITEMS
Definition: Window.h:72
idStr tabVAlignStr
Definition: ListWindow.h:80
int Icmp(const char *text) const
Definition: Str.h:667
void SetValue(float _value)
void Zero(void)
Definition: Vector.h:119
virtual void Activate(bool activate, idStr &act)
Definition: ListWindow.cpp:578
int Icmpn(const char *text, int n) const
Definition: Str.h:672
idList< int > currentSel
Definition: ListWindow.h:89
void Set(const char *key, Type &value)
Definition: HashTable.h:186
idRectangle clientRect
Definition: Window.h:374
bool ParseBool(void)
Definition: Parser.cpp:2797
GLuint GLuint GLsizei count
Definition: glext.h:2845
idStr tabIconVOffsetStr
Definition: ListWindow.h:83
virtual void Activate(bool activate, idStr &act)
Definition: Window.cpp:481
float GetValue()
Definition: SliderWindow.h:47
Definition: Vector.h:52
virtual void PostParse()
Definition: Window.cpp:1709
int DrawText(const char *text, float textScale, int textAlign, idVec4 color, idRectangle rectDraw, bool wrap, int cursor=-1, bool calcOnly=false, idList< int > *breaks=NULL, int limit=0)
GLuint index
Definition: glext.h:3476
const GLubyte * c
Definition: glext.h:4677
const char * GetString(const char *key, const char *defaultString="") const
Definition: Dict.h:240
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:3454
Definition: Vector.h:808
idSys * sys
Definition: maya_main.cpp:48
virtual void SetBuddy(idWindow *buddy)
int GetCurrentSel()
Definition: ListWindow.cpp:88
float y
Definition: Rectangle.h:37
idCommon * common
Definition: Common.cpp:206
void DrawFilledRect(float x, float y, float width, float height, const idVec4 &color)
#define NULL
Definition: Lib.h:88
float actualY
Definition: Window.h:369
int evValue2
Definition: sys_public.h:218
virtual float CursorY()
virtual void PostParse()
Definition: ListWindow.cpp:303
const char * GetSourceFile(void) const
int align
Definition: ListWindow.h:41
idWinVec4 foreColor
Definition: Window.h:402
void UpdateList()
Definition: ListWindow.cpp:590
const int WIN_CANFOCUS
Definition: Window.h:50
float w
Definition: Vector.h:813
int valign
Definition: ListWindow.h:42
float x
Definition: Vector.h:54
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
Definition: ListWindow.cpp:299
type * Find(type const &obj) const
Definition: List.h:782
GLenum GLsizei width
Definition: glext.h:2846
virtual const idDict & State() const
sysEventType_t evType
Definition: sys_public.h:216
idStr cmd
Definition: Window.h:316
void InitScroller(bool horizontal)
Definition: ListWindow.cpp:423
idWinRectangle rect
Definition: Window.h:399
float x
Definition: Rectangle.h:36
idDeclManager * declManager
bool Get(const char *key, Type **value=NULL) const
Definition: HashTable.h:214
idWinVec4 borderColor
Definition: Window.h:404
virtual sysEvent_t GenerateMouseButtonEvent(int button, bool down)=0
int Append(const type &obj)
Definition: List.h:646
GLdouble GLdouble GLdouble r
Definition: glext.h:2951
void ClearSelection(int sel)
Definition: ListWindow.cpp:77
idUserInterfaceLocal * gui
Definition: Window.h:427
void SetCurrentSel(int sel)
Definition: ListWindow.cpp:72
tuple f
Definition: idal.py:89
void Append(const char a)
Definition: Str.h:729
int Num(void) const
Definition: List.h:265
bool horizontal
Definition: ListWindow.h:77
bool RemoveIndex(int index)
Definition: List.h:849
const GLcharARB * name
Definition: glext.h:3629
GLsizeiptr size
Definition: glext.h:3112
bool IsSelected(int index)
Definition: ListWindow.cpp:92
float Bottom() const
Definition: Rectangle.h:42
Definition: Str.h:116
int GetImageWidth(void) const
Definition: Material.cpp:2516
float w
Definition: Rectangle.h:38
const char * c_str(void) const
Definition: Str.h:487
bool InsertChild(idWindow *win, idWindow *before)
Definition: Window.cpp:4089
void AddCurrentSel(int sel)
Definition: ListWindow.cpp:84
bool TestMaterialFlag(const int flag) const
Definition: Material.h:494
void SetSort(float s) const
Definition: Material.h:513
idList< idTabRect > tabInfo
Definition: ListWindow.h:74
int FindIndex(const type &obj) const
Definition: List.h:761
float iconVOffset
Definition: ListWindow.h:45
int type
Definition: ListWindow.h:43
float h
Definition: Rectangle.h:39
void SetImageClassifications(int tag) const
Definition: Material.cpp:2644
bool RunScript(int n)
Definition: Window.cpp:2690
bool hover
Definition: Window.h:423
void SetRange(float _low, float _high, float _step)
char * va(const char *fmt,...)
Definition: Str.cpp:1568
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
Definition: Window.cpp:709
float sizeBias
Definition: ListWindow.h:76
void DrawMaterial(float x, float y, float w, float h, const idMaterial *mat, const idVec4 &color, float scalex=1.0, float scaley=1.0)
idHashTable< const idMaterial * > iconMaterials
Definition: ListWindow.h:84
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
virtual float CursorX()
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
Definition: Window.cpp:1776
idListWindow(idUserInterfaceLocal *gui)
Definition: ListWindow.cpp:67
void CommonInit()
Definition: ListWindow.cpp:49
float GetHigh()
Definition: SliderWindow.h:44
GLuint start
Definition: glext.h:2845
void DrawRect(float x, float y, float width, float height, float size, const idVec4 &color)
idRectangle textRect
Definition: Window.h:413
idWinVec4 hoverColor
Definition: Window.h:403
idStr typed
Definition: ListWindow.h:95
void Clear(void)
Definition: List.h:184
static bool CharIsPrintable(int c)
Definition: Str.h:1003
idStr tabTypeStr
Definition: ListWindow.h:81