29 #include "../idlib/precompiled.h"
150 const char* temp =
text;
151 for ( ; *temp; temp++ ) {
194 const char *ret =
"";
209 int key =
event->evValue;
217 if ( updateVisuals ) {
218 *updateVisuals =
true;
240 if ( key ==
'h' -
'a' + 1 || key ==
K_BACKSPACE ) {
267 if ( ( key < '0' || key >
'9' ) && key !=
'.' ) {
296 if ( updateVisuals ) {
297 *updateVisuals =
true;
300 if ( key ==
K_DEL ) {
305 memmove( &buffer[
cursorPos], &buffer[cursorPos + 1], len - cursorPos);
367 if ( key ==
K_END ) {
377 if ( key ==
K_INS ) {
440 text = (
char *) buffer;
461 const char *thumbImage =
"guis/assets/scrollbar_thumb.tga";
462 const char *barImage =
"guis/assets/scrollbarv.tga";
463 const char *scrollerName =
"_scrollerWinV";
466 barImage =
"guis/assets/scrollbarh.tga";
467 scrollerName =
"_scrollerWinH";
525 int left = cursorX - maxWidth;
635 if ( !
idStr::Cmpn( eventName,
"cvar read ", 10 ) ) {
637 group =
event.
Mid( 10, event.
Length() - 10 );
641 }
else if ( !
idStr::Cmpn( eventName,
"cvar write ", 11 ) ) {
643 group =
event.
Mid( 11, event.
Length() - 11 );
void UpdateCvar(bool read, bool force=false)
int Cmp(const char *text) const
idCVarSystem * cvarSystem
bool Contains(float x, float y)
virtual bool ParseInternalVar(const char *name, idParser *src)
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
GLenum GLenum GLenum GLenum GLenum scale
void InitWithDefaults(const char *_name, const idRectangle &rect, const idVec4 &foreColor, const idVec4 &matColor, const char *_background, const char *thumbShader, bool _vertical, bool _scrollbar)
virtual bool ParseInternalVar(const char *name, idParser *src)
void InitScroller(bool horizontal)
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
idFileSystem * fileSystem
void ParseString(idParser *src, idStr &out)
const char * GetName(void) const
void EnsureCursorVisible()
int GetImageHeight(void) const
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
virtual void FreeFile(void *buffer)=0
int Cmpn(const char *text, int n) const
void RunNamedEvent(const char *eventName)
int Icmp(const char *text) const
void SetValue(float _value)
virtual idCVar * Find(const char *name)=0
virtual void Activate(bool activate, idStr &act)
void SetString(const char *value)
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)
static int FtoiFast(float f)
virtual void SetBuddy(idWindow *buddy)
unsigned char Sys_GetConsoleKey(bool shifted)
virtual void Draw(int time, float x, float y)
virtual void HandleBuddyUpdate(idWindow *buddy)
void SetInteger(const int value)
int GetInteger(void) const
const char * GetSourceFile(void) const
static void Copynz(char *dest, const char *src, int destsize)
virtual void Activate(bool activate, idStr &act)
void SetOverStrike(bool b)
idDeclManager * declManager
int CharWidth(const char c, float scale)
const char * GetString(void) const
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
const char * Mid(int start, int len, idStr &result) const
idEditWindow(idUserInterfaceLocal *gui)
idUserInterfaceLocal * gui
int GetImageWidth(void) const
virtual const char * c_str() const
bool InsertChild(idWindow *win, idWindow *before)
void SetSort(float s) const
idSliderWindow * scroller
void SetRange(float _low, float _high, float _step)
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
const char * GetName() const
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
static bool CharIsPrintable(int c)