doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EditWindow.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 "DeviceContext.h"
33 #include "Window.h"
34 #include "UserInterfaceLocal.h"
35 #include "SliderWindow.h"
36 #include "EditWindow.h"
37 
38 
39 bool idEditWindow::ParseInternalVar( const char *_name, idParser *src ) {
40  if ( idStr::Icmp( _name, "maxchars" ) == 0) {
41  maxChars = src->ParseInt();
42  return true;
43  }
44  if ( idStr::Icmp( _name, "numeric" ) == 0) {
45  numeric = src->ParseBool();
46  return true;
47  }
48  if ( idStr::Icmp( _name, "wrap" ) == 0) {
49  wrap = src->ParseBool();
50  return true;
51  }
52  if ( idStr::Icmp( _name, "readonly" ) == 0) {
53  readonly = src->ParseBool();
54  return true;
55  }
56  if ( idStr::Icmp( _name, "forceScroll" ) == 0) {
57  forceScroll = src->ParseBool();
58  return true;
59  }
60  if ( idStr::Icmp( _name, "source" ) == 0) {
61  ParseString( src, sourceFile );
62  return true;
63  }
64  if ( idStr::Icmp( _name, "password" ) == 0 ) {
65  password = src->ParseBool();
66  return true;
67  }
68  if ( idStr::Icmp( _name, "cvarMax" ) == 0) {
69  cvarMax = src->ParseInt();
70  return true;
71  }
72 
73  return idWindow::ParseInternalVar( _name, src );
74 }
75 
76 idWinVar *idEditWindow::GetWinVarByName( const char *_name, bool fixup, drawWin_t** owner ) {
77  if ( idStr::Icmp( _name, "cvar" ) == 0 ) {
78  return &cvarStr;
79  }
80  if ( idStr::Icmp( _name, "password" ) == 0 ) {
81  return &password;
82  }
83  if ( idStr::Icmp( _name, "liveUpdate" ) == 0 ) {
84  return &liveUpdate;
85  }
86  if ( idStr::Icmp( _name, "cvarGroup" ) == 0 ) {
87  return &cvarGroup;
88  }
89  return idWindow::GetWinVarByName( _name, fixup, owner );
90 }
91 
93  maxChars = 128;
94  numeric = false;
95  paintOffset = 0;
96  cursorPos = 0;
97  cursorLine = 0;
98  cvarMax = 0;
99  wrap = false;
100  sourceFile = "";
101  scroller = NULL;
102  sizeBias = 0;
103  lastTextLength = 0;
104  forceScroll = false;
105  password = false;
106  cvar = NULL;
107  liveUpdate = true;
108  readonly = false;
109 
110  scroller = new idSliderWindow(dc, gui);
111 }
112 
113 
115  dc = d;
116  gui = g;
117  CommonInit();
118 }
119 
121  gui = g;
122  CommonInit();
123 }
124 
126 
127 }
128 
130  cursorPos = text.Length();
132 }
133 
134 void idEditWindow::Draw( int time, float x, float y ) {
136 
137  UpdateCvar( true );
138 
139  int len = text.Length();
140  if ( len != lastTextLength ) {
141  scroller->SetValue( 0.0f );
144  }
145  float scale = textScale;
146 
147  idStr pass;
148  const char* buffer;
149  if ( password ) {
150  const char* temp = text;
151  for ( ; *temp; temp++ ) {
152  pass += "*";
153  }
154  buffer = pass;
155  } else {
156  buffer = text;
157  }
158 
159  if ( cursorPos > len ) {
160  cursorPos = len;
161  }
162 
164 
165  rect.x -= paintOffset;
166  rect.w += paintOffset;
167 
168  if ( wrap && scroller->GetHigh() > 0.0f ) {
169  float lineHeight = GetMaxCharHeight( ) + 5;
170  rect.y -= scroller->GetValue() * lineHeight;
171  rect.w -= sizeBias;
172  rect.h = ( breaks.Num() + 1 ) * lineHeight;
173  }
174 
175  if ( hover && !noEvents && Contains(gui->CursorX(), gui->CursorY()) ) {
176  color = hoverColor;
177  } else {
178  hover = false;
179  }
180  if ( flags & WIN_FOCUS ) {
181  color = hoverColor;
182  }
183 
184  dc->DrawText( buffer, scale, 0, color, rect, wrap, (flags & WIN_FOCUS) ? cursorPos : -1);
185 }
186 
187 /*
188 =============
189 idEditWindow::HandleEvent
190 =============
191 */
192 const char *idEditWindow::HandleEvent(const sysEvent_t *event, bool *updateVisuals) {
193  static char buffer[ MAX_EDITFIELD ];
194  const char *ret = "";
195 
196  if ( wrap ) {
197  // need to call this to allow proper focus and capturing on embedded children
198  ret = idWindow::HandleEvent( event, updateVisuals );
199  if ( ret && *ret ) {
200  return ret;
201  }
202  }
203 
204  if ( ( event->evType != SE_CHAR && event->evType != SE_KEY ) ) {
205  return ret;
206  }
207 
208  idStr::Copynz( buffer, text.c_str(), sizeof( buffer ) );
209  int key = event->evValue;
210  int len = text.Length();
211 
212  if ( event->evType == SE_CHAR ) {
213  if ( event->evValue == Sys_GetConsoleKey( false ) || event->evValue == Sys_GetConsoleKey( true ) ) {
214  return "";
215  }
216 
217  if ( updateVisuals ) {
218  *updateVisuals = true;
219  }
220 
221  if ( maxChars && len > maxChars ) {
222  len = maxChars;
223  }
224 
225  if ( ( key == K_ENTER || key == K_KP_ENTER ) && event->evValue2 ) {
226  RunScript( ON_ACTION );
227  RunScript( ON_ENTER );
228  return cmd;
229  }
230 
231  if ( key == K_ESCAPE ) {
232  RunScript( ON_ESC );
233  return cmd;
234  }
235 
236  if ( readonly ) {
237  return "";
238  }
239 
240  if ( key == 'h' - 'a' + 1 || key == K_BACKSPACE ) { // ctrl-h is backspace
241  if ( cursorPos > 0 ) {
242  if ( cursorPos >= len ) {
243  buffer[len - 1] = 0;
244  cursorPos = len - 1;
245  } else {
246  memmove( &buffer[ cursorPos - 1 ], &buffer[ cursorPos ], len + 1 - cursorPos);
247  cursorPos--;
248  }
249 
250  text = buffer;
251  UpdateCvar( false );
252  RunScript( ON_ACTION );
253  }
254 
255  return "";
256  }
257 
258  //
259  // ignore any non printable chars (except enter when wrap is enabled)
260  //
261  if ( wrap && (key == K_ENTER || key == K_KP_ENTER) ) {
262  } else if ( !idStr::CharIsPrintable( key ) ) {
263  return "";
264  }
265 
266  if ( numeric ) {
267  if ( ( key < '0' || key > '9' ) && key != '.' ) {
268  return "";
269  }
270  }
271 
272  if ( dc->GetOverStrike() ) {
273  if ( maxChars && cursorPos >= maxChars ) {
274  return "";
275  }
276  } else {
277  if ( ( len == MAX_EDITFIELD - 1 ) || ( maxChars && len >= maxChars ) ) {
278  return "";
279  }
280  memmove( &buffer[ cursorPos + 1 ], &buffer[ cursorPos ], len + 1 - cursorPos );
281  }
282 
283  buffer[ cursorPos ] = key;
284 
285  text = buffer;
286  UpdateCvar( false );
287  RunScript( ON_ACTION );
288 
289  if ( cursorPos < len + 1 ) {
290  cursorPos++;
291  }
293 
294  } else if ( event->evType == SE_KEY && event->evValue2 ) {
295 
296  if ( updateVisuals ) {
297  *updateVisuals = true;
298  }
299 
300  if ( key == K_DEL ) {
301  if ( readonly ) {
302  return ret;
303  }
304  if ( cursorPos < len ) {
305  memmove( &buffer[cursorPos], &buffer[cursorPos + 1], len - cursorPos);
306  text = buffer;
307  UpdateCvar( false );
308  RunScript( ON_ACTION );
309  }
310  return ret;
311  }
312 
313  if ( key == K_RIGHTARROW ) {
314  if ( cursorPos < len ) {
315  if ( idKeyInput::IsDown( K_CTRL ) ) {
316  // skip to next word
317  while( ( cursorPos < len ) && ( buffer[ cursorPos ] != ' ' ) ) {
318  cursorPos++;
319  }
320 
321  while( ( cursorPos < len ) && ( buffer[ cursorPos ] == ' ' ) ) {
322  cursorPos++;
323  }
324  } else {
325  if ( cursorPos < len ) {
326  cursorPos++;
327  }
328  }
329  }
330 
332 
333  return ret;
334  }
335 
336  if ( key == K_LEFTARROW ) {
337  if ( idKeyInput::IsDown( K_CTRL ) ) {
338  // skip to previous word
339  while( ( cursorPos > 0 ) && ( buffer[ cursorPos - 1 ] == ' ' ) ) {
340  cursorPos--;
341  }
342 
343  while( ( cursorPos > 0 ) && ( buffer[ cursorPos - 1 ] != ' ' ) ) {
344  cursorPos--;
345  }
346  } else {
347  if ( cursorPos > 0 ) {
348  cursorPos--;
349  }
350  }
351 
353 
354  return ret;
355  }
356 
357  if ( key == K_HOME ) {
358  if ( idKeyInput::IsDown( K_CTRL ) || cursorLine <= 0 || ( cursorLine >= breaks.Num() ) ) {
359  cursorPos = 0;
360  } else {
362  }
364  return ret;
365  }
366 
367  if ( key == K_END ) {
368  if ( idKeyInput::IsDown( K_CTRL ) || (cursorLine < -1) || ( cursorLine >= breaks.Num() - 1 ) ) {
369  cursorPos = len;
370  } else {
371  cursorPos = breaks[cursorLine + 1] - 1;
372  }
374  return ret;
375  }
376 
377  if ( key == K_INS ) {
378  if ( !readonly ) {
380  }
381  return ret;
382  }
383 
384  if ( key == K_DOWNARROW ) {
385  if ( idKeyInput::IsDown( K_CTRL ) ) {
386  scroller->SetValue( scroller->GetValue() + 1.0f );
387  } else {
388  if ( cursorLine < breaks.Num() - 1 ) {
390  cursorPos = breaks[cursorLine + 1] + offset;
392  }
393  }
394  }
395 
396  if (key == K_UPARROW ) {
397  if ( idKeyInput::IsDown( K_CTRL ) ) {
398  scroller->SetValue( scroller->GetValue() - 1.0f );
399  } else {
400  if ( cursorLine > 0 ) {
402  cursorPos = breaks[cursorLine - 1] + offset;
404  }
405  }
406  }
407 
408  if ( key == K_ENTER || key == K_KP_ENTER ) {
409  RunScript( ON_ACTION );
410  RunScript( ON_ENTER );
411  return cmd;
412  }
413 
414  if ( key == K_ESCAPE ) {
415  RunScript( ON_ESC );
416  return cmd;
417  }
418 
419  } else if ( event->evType == SE_KEY && !event->evValue2 ) {
420  if ( key == K_ENTER || key == K_KP_ENTER ) {
422  return cmd;
423  } else {
425  }
426  }
427 
428  return ret;
429 }
430 
433 
434  if ( maxChars == 0 ) {
435  maxChars = 10;
436  }
437  if ( sourceFile.Length() ) {
438  void *buffer;
439  fileSystem->ReadFile( sourceFile, &buffer );
440  text = (char *) buffer;
441  fileSystem->FreeFile( buffer );
442  }
443 
444  InitCvar();
445  InitScroller(false);
446 
448 
449  flags |= WIN_CANFOCUS;
450 }
451 
452 /*
453 ================
454 idEditWindow::InitScroller
455 
456 This is the same as in idListWindow
457 ================
458 */
459 void idEditWindow::InitScroller( bool horizontal )
460 {
461  const char *thumbImage = "guis/assets/scrollbar_thumb.tga";
462  const char *barImage = "guis/assets/scrollbarv.tga";
463  const char *scrollerName = "_scrollerWinV";
464 
465  if (horizontal) {
466  barImage = "guis/assets/scrollbarh.tga";
467  scrollerName = "_scrollerWinH";
468  }
469 
470  const idMaterial *mat = declManager->FindMaterial( barImage );
471  mat->SetSort( SS_GUI );
472  sizeBias = mat->GetImageWidth();
473 
474  idRectangle scrollRect;
475  if (horizontal) {
476  sizeBias = mat->GetImageHeight();
477  scrollRect.x = 0;
478  scrollRect.y = (clientRect.h - sizeBias);
479  scrollRect.w = clientRect.w;
480  scrollRect.h = sizeBias;
481  } else {
482  scrollRect.x = (clientRect.w - sizeBias);
483  scrollRect.y = 0;
484  scrollRect.w = sizeBias;
485  scrollRect.h = clientRect.h;
486  }
487 
488  scroller->InitWithDefaults(scrollerName, scrollRect, foreColor, matColor, mat->GetName(), thumbImage, !horizontal, true);
490  scroller->SetBuddy(this);
491 }
492 
494 }
495 
497 {
498  if ( readonly ) {
499  cursorPos = -1;
500  } else if ( maxChars == 1 ) {
501  cursorPos = 0;
502  }
503 
504  if ( !dc ) {
505  return;
506  }
507 
508  SetFont();
509  if ( !wrap ) {
510  int cursorX = 0;
511  if ( password ) {
512  cursorX = cursorPos * dc->CharWidth( '*', textScale );
513  } else {
514  int i = 0;
515  while ( i < text.Length() && i < cursorPos ) {
516  if ( idStr::IsColor( &text[i] ) ) {
517  i += 2;
518  } else {
519  cursorX += dc->CharWidth( text[i], textScale );
520  i++;
521  }
522  }
523  }
524  int maxWidth = GetMaxCharWidth( );
525  int left = cursorX - maxWidth;
526  int right = ( cursorX - textRect.w ) + maxWidth;
527 
528  if ( paintOffset > left ) {
529  // When we go past the left side, we want the text to jump 6 characters
530  paintOffset = left - maxWidth * 6;
531  }
532  if ( paintOffset < right) {
533  paintOffset = right;
534  }
535  if ( paintOffset < 0 ) {
536  paintOffset = 0;
537  }
538  scroller->SetRange(0.0f, 0.0f, 1.0f);
539 
540  } else {
541  // Word wrap
542 
543  breaks.Clear();
545  rect.w -= sizeBias;
546  dc->DrawText(text, textScale, textAlign, colorWhite, rect, true, (flags & WIN_FOCUS) ? cursorPos : -1, true, &breaks );
547 
548  int fit = textRect.h / (GetMaxCharHeight() + 5);
549  if ( fit < breaks.Num() + 1 ) {
550  scroller->SetRange(0, breaks.Num() + 1 - fit, 1);
551  } else {
552  // The text fits completely in the box
553  scroller->SetRange(0.0f, 0.0f, 1.0f);
554  }
555 
556  if ( forceScroll ) {
557  scroller->SetValue( breaks.Num() - fit );
558  } else if ( readonly ) {
559  } else {
560  cursorLine = 0;
561  for ( int i = 1; i < breaks.Num(); i++ ) {
562  if ( cursorPos >= breaks[i] ) {
563  cursorLine = i;
564  } else {
565  break;
566  }
567  }
568  int topLine = idMath::FtoiFast( scroller->GetValue() );
569  if ( cursorLine < topLine ) {
571  } else if ( cursorLine >= topLine + fit) {
572  scroller->SetValue( ( cursorLine - fit ) + 1 );
573  }
574  }
575  }
576 }
577 
578 void idEditWindow::Activate(bool activate, idStr &act) {
579  idWindow::Activate(activate, act);
580  if ( activate ) {
581  UpdateCvar( true, true );
583  }
584 }
585 
586 /*
587 ============
588 idEditWindow::InitCvar
589 ============
590 */
592  if ( cvarStr[0] == '\0' ) {
593  if ( text.GetName() == NULL ) {
594  common->Warning( "idEditWindow::InitCvar: gui '%s' window '%s' has an empty cvar string", gui->GetSourceFile(), name.c_str() );
595  }
596  cvar = NULL;
597  return;
598  }
599 
600  cvar = cvarSystem->Find( cvarStr );
601  if ( !cvar ) {
602  common->Warning( "idEditWindow::InitCvar: gui '%s' window '%s' references undefined cvar '%s'", gui->GetSourceFile(), name.c_str(), cvarStr.c_str() );
603  return;
604  }
605 }
606 
607 /*
608 ============
609 idEditWindow::UpdateCvar
610 ============
611 */
612 void idEditWindow::UpdateCvar( bool read, bool force ) {
613  if ( force || liveUpdate ) {
614  if ( cvar ) {
615  if ( read ) {
616  text = cvar->GetString();
617  } else {
618  cvar->SetString( text );
619  if ( cvarMax && ( cvar->GetInteger() > cvarMax ) ) {
620  cvar->SetInteger( cvarMax );
621  }
622  }
623  }
624  }
625 }
626 
627 /*
628 ============
629 idEditWindow::RunNamedEvent
630 ============
631 */
632 void idEditWindow::RunNamedEvent( const char* eventName ) {
633  idStr event, group;
634 
635  if ( !idStr::Cmpn( eventName, "cvar read ", 10 ) ) {
636  event = eventName;
637  group = event.Mid( 10, event.Length() - 10 );
638  if ( !group.Cmp( cvarGroup ) ) {
639  UpdateCvar( true, true );
640  }
641  } else if ( !idStr::Cmpn( eventName, "cvar write ", 11 ) ) {
642  event = eventName;
643  group = event.Mid( 11, event.Length() - 11 );
644  if ( !group.Cmp( cvarGroup ) ) {
645  UpdateCvar( false, true );
646  }
647  }
648 }
static bool IsDown(int keyNum)
Definition: KeyInput.cpp:271
GLubyte g
Definition: glext.h:4662
bool readonly
Definition: EditWindow.h:78
byte color[4]
Definition: MegaTexture.cpp:54
idWinStr cvarStr
Definition: EditWindow.h:89
Definition: KeyInput.h:78
idStr sourceFile
Definition: EditWindow.h:80
float GetMaxCharHeight()
Definition: Window.cpp:303
idWinFloat textScale
Definition: Window.h:405
int Length()
Definition: Winvar.h:192
void UpdateCvar(bool read, bool force=false)
Definition: EditWindow.cpp:612
int Cmp(const char *text) const
Definition: Str.h:652
idCVarSystem * cvarSystem
Definition: CVarSystem.cpp:487
bool Contains(float x, float y)
Definition: Window.cpp:681
idVec4 colorWhite
Definition: Lib.cpp:116
virtual bool ParseInternalVar(const char *name, idParser *src)
Definition: EditWindow.cpp:39
const int MAX_EDITFIELD
Definition: EditWindow.h:34
unsigned int flags
Definition: Window.h:371
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:4804
Definition: KeyInput.h:74
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)
idWinBool noEvents
Definition: Window.h:398
virtual bool ParseInternalVar(const char *name, idParser *src)
Definition: Window.cpp:1915
void InitScroller(bool horizontal)
Definition: EditWindow.cpp:459
GLenum GLint GLint y
Definition: glext.h:2849
idWinVec4 matColor
Definition: Window.h:401
signed char textAlign
Definition: Window.h:394
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
Definition: EditWindow.cpp:192
idFileSystem * fileSystem
Definition: FileSystem.cpp:500
const int WIN_FOCUS
Definition: Window.h:44
void ParseString(idParser *src, idStr &out)
Definition: Window.cpp:1883
idWinStr cvarGroup
Definition: EditWindow.h:93
void SetFont()
Definition: Window.cpp:294
const char * GetName(void) const
Definition: DeclManager.h:140
void EnsureCursorVisible()
Definition: EditWindow.cpp:496
int GetImageHeight(void) const
Definition: Material.cpp:2526
idWinBool password
Definition: EditWindow.h:87
idDeviceContext * dc
Definition: Window.h:425
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
GLuint src
Definition: glext.h:5390
GLenum GLsizei len
Definition: glext.h:3472
GLdouble right
Definition: qgl.h:273
GLenum GLint x
Definition: glext.h:2849
int i
Definition: process.py:33
virtual void FreeFile(void *buffer)=0
int Cmpn(const char *text, int n) const
Definition: Str.h:657
GLintptr offset
Definition: glext.h:3113
void RunNamedEvent(const char *eventName)
Definition: EditWindow.cpp:632
int Icmp(const char *text) const
Definition: Str.h:667
void SetValue(float _value)
float sizeBias
Definition: EditWindow.h:83
virtual idCVar * Find(const char *name)=0
idRectangle clientRect
Definition: Window.h:374
bool ParseBool(void)
Definition: Parser.cpp:2797
virtual void Activate(bool activate, idStr &act)
Definition: Window.cpp:481
float GetValue()
Definition: SliderWindow.h:47
void SetString(const char *value)
Definition: CVarSystem.h:146
Definition: KeyInput.h:73
virtual void PostParse()
Definition: Window.cpp:1709
int ParseInt(void)
Definition: Parser.cpp:2775
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)
Definition: Vector.h:808
static int FtoiFast(float f)
Definition: Math.h:801
virtual void SetBuddy(idWindow *buddy)
unsigned char Sys_GetConsoleKey(bool shifted)
Definition: main.cpp:189
virtual void Draw(int time, float x, float y)
Definition: EditWindow.cpp:134
float y
Definition: Rectangle.h:37
idCommon * common
Definition: Common.cpp:206
bool numeric
Definition: EditWindow.h:79
#define NULL
Definition: Lib.h:88
idWinBool liveUpdate
Definition: EditWindow.h:92
virtual void HandleBuddyUpdate(idWindow *buddy)
Definition: EditWindow.cpp:493
void SetInteger(const int value)
Definition: CVarSystem.h:148
int evValue2
Definition: sys_public.h:218
GLuint buffer
Definition: glext.h:3108
int GetInteger(void) const
Definition: CVarSystem.h:143
virtual float CursorY()
const char * GetSourceFile(void) const
idWinVec4 foreColor
Definition: Window.h:402
static void Copynz(char *dest, const char *src, int destsize)
Definition: Str.cpp:1376
const int WIN_CANFOCUS
Definition: Window.h:50
float GetMaxCharWidth()
Definition: Window.cpp:313
virtual void PostParse()
Definition: EditWindow.cpp:431
virtual void Activate(bool activate, idStr &act)
Definition: EditWindow.cpp:578
void SetOverStrike(bool b)
Definition: DeviceContext.h:93
idWinStr text
Definition: Window.h:407
sysEventType_t evType
Definition: sys_public.h:216
idStr cmd
Definition: Window.h:316
idWinRectangle rect
Definition: Window.h:399
float x
Definition: Rectangle.h:36
idDeclManager * declManager
int cursorLine
Definition: EditWindow.h:75
int CharWidth(const char c, float scale)
const char * GetString(void) const
Definition: CVarSystem.h:141
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
Definition: EditWindow.cpp:76
const char * Mid(int start, int len, idStr &result) const
Definition: Str.cpp:603
bool GetOverStrike()
Definition: DeviceContext.h:95
idEditWindow(idUserInterfaceLocal *gui)
Definition: EditWindow.cpp:120
idUserInterfaceLocal * gui
Definition: Window.h:427
tuple f
Definition: idal.py:89
bool forceScroll
Definition: EditWindow.h:86
int lastTextLength
Definition: EditWindow.h:85
int paintOffset
Definition: EditWindow.h:73
int Num(void) const
Definition: List.h:265
const GLcharARB * name
Definition: glext.h:3629
Definition: Str.h:116
virtual void GainFocus()
Definition: EditWindow.cpp:129
int GetImageWidth(void) const
Definition: Material.cpp:2516
float w
Definition: Rectangle.h:38
virtual ~idEditWindow()
Definition: EditWindow.cpp:125
virtual const char * c_str() const
Definition: Winvar.h:204
bool InsertChild(idWindow *win, idWindow *before)
Definition: Window.cpp:4089
void SetSort(float s) const
Definition: Material.h:513
float h
Definition: Rectangle.h:39
void CommonInit()
Definition: EditWindow.cpp:92
idSliderWindow * scroller
Definition: EditWindow.h:81
bool RunScript(int n)
Definition: Window.cpp:2690
void InitCvar()
Definition: EditWindow.cpp:591
bool hover
Definition: Window.h:423
void SetRange(float _low, float _high, float _step)
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
Definition: Window.cpp:709
const char * GetName() const
Definition: Winvar.h:44
idCVar * cvar
Definition: EditWindow.h:90
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
idList< int > breaks
Definition: EditWindow.h:82
float GetHigh()
Definition: SliderWindow.h:44
bool IsColor(void) const
Definition: Str.h:837
idRectangle textRect
Definition: Window.h:413
idWinVec4 hoverColor
Definition: Window.h:403
void Clear(void)
Definition: List.h:184
static bool CharIsPrintable(int c)
Definition: Str.h:1003