Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
TextSlider Class Reference
Inheritance diagram for TextSlider:
Collaboration diagram for TextSlider:

Public Member Functions

virtual void addValue ()
 ATTRIB (Label, currentText, string)
 ATTRIB (Label, text, string)
 ATTRIB (Label, textEntity, entity)
 ATTRIB (MenuItem, parent, entity)
 ATTRIB (MenuItem, tooltip, string)
 ATTRIB (Slider, sliderAnim, entity)
 ATTRIB (Slider, src, string)
virtual void clearValues ()
virtual void configureLabel ()
virtual void configureSliderValues ()
virtual void configureSliderVisuals ()
virtual void configureTextSliderValues ()
virtual void destroy ()
virtual void draw ()
virtual void focusEnter ()
virtual void focusLeave ()
virtual void getIdentifier ()
virtual void hideNotify ()
virtual void insertValue ()
virtual void keyDown ()
virtual void keyUp ()
virtual void mouseDrag ()
virtual void mouseMove ()
virtual void mousePress ()
virtual void mouseRelease ()
virtual void recalcPositionWithText ()
virtual void relinquishFocus ()
virtual void resizeNotify ()
virtual void setSliderValue ()
virtual void setText ()
virtual void setValue ()
virtual void setValueFromIdentifier ()
virtual void showNotify ()
virtual void toString ()
virtual void valueToIdentifier ()
virtual void valueToText ()

Public Attributes

float align = 0.5
bool allowColors = false
bool allowCut = false
bool allowFocusSound = true
bool allowWrap = false
float allowWrap_spacing = 0
float alpha = 0.7
bool animated = true
vector color = '1 1 1'
vector color2 = '1 1 1'
vector colorC = '1 1 1'
vector colorD = '1 1 1'
vector colorF = '1 1 1'
vector colorL = SKINCOLOR_TEXT
float condenseFactor = 1
float controlWidth = 0
float disabled = 0
float disabledAlpha = 0.3
bool focusable = true
bool focused = false
float fontSize = 8
string formatString = ""
bool isBold = false
float keepspaceLeft = 0
float keepspaceRight = 0
float marginLeft = 0
float marginRight = 0
int nValues = 0
vector origin = '0 0 0'
bool overrideCondenseFactor = false
vector overrideRealOrigin = '0 0 0'
float preferredFocusPriority = 0
float pressed = 0
float pressOffset = 0
float previousValue = 0
vector realFontSize = '0 0 0'
vector realOrigin = '0 0 0'
bool recalcPos = false
vector size = '0 0 0'
float sliderValue = 0
vector tolerance = '0 0 0'
float value = 0
float valueDigits = 0
float valueDisplayMultiplier = 1.0
string valueIdentifiers [256]
float valueKeyStep = 0
float valueMax = 0
float valueMin = 0
float valuePageStep = 0
float valueSpace = 0
float valueStep = 0
string valueStrings [256]

Detailed Description

Definition at line 7 of file textslider.qh.

Member Function Documentation

◆ addValue()

virtual void TextSlider::addValue ( )
virtual

References addValue(), entity(), and METHOD.

Referenced by addValue().

◆ ATTRIB() [1/7]

Label::ATTRIB ( Label ,
currentText ,
string  )
inherited

References ATTRIB().

◆ ATTRIB() [2/7]

Label::ATTRIB ( Label ,
text ,
string  )
inherited

References ATTRIB().

Referenced by ATTRIB(), ATTRIB(), and ATTRIB().

◆ ATTRIB() [3/7]

Label::ATTRIB ( Label ,
textEntity ,
entity  )
inherited

References ATTRIB(), and entity().

◆ ATTRIB() [4/7]

MenuItem::ATTRIB ( MenuItem ,
parent ,
entity  )
inherited

References entity(), and parent.

◆ ATTRIB() [5/7]

MenuItem::ATTRIB ( MenuItem ,
tooltip ,
string  )
inherited

◆ ATTRIB() [6/7]

Slider::ATTRIB ( Slider ,
sliderAnim ,
entity  )
inherited

References ATTRIB(), and entity().

◆ ATTRIB() [7/7]

Slider::ATTRIB ( Slider ,
src ,
string  )
inherited

References ATTRIB().

Referenced by ATTRIB(), and ATTRIB().

◆ clearValues()

virtual void TextSlider::clearValues ( )
virtual

References clearValues(), entity(), and METHOD.

Referenced by clearValues().

◆ configureLabel()

virtual void Label::configureLabel ( )
virtualinherited

References configureLabel(), entity(), and METHOD.

Referenced by configureLabel().

◆ configureSliderValues()

virtual void Slider::configureSliderValues ( )
virtualinherited

◆ configureSliderVisuals()

virtual void Slider::configureSliderVisuals ( )
virtualinherited

◆ configureTextSliderValues()

virtual void TextSlider::configureTextSliderValues ( )
virtual

◆ destroy()

◆ draw()

virtual void Slider::draw ( )
virtualinherited

Reimplemented from Label.

Reimplemented in XonoticPicmipSlider, and XonoticResolutionSlider.

References draw(), entity(), and METHOD.

Referenced by draw().

◆ focusEnter()

void MenuItem::focusEnter ( )
virtualinherited

Reimplemented in Nexposee, XonoticCreditsDialog, XonoticServerList, and XonoticWinnerDialog.

Definition at line 94 of file item.qc.

95 {
97 }
bool allowFocusSound
Definition item.qh:26
void m_play_focus_sound()
Definition menu.qc:1097

References allowFocusSound, focusEnter(), and m_play_focus_sound().

Referenced by focusEnter().

◆ focusLeave()

void MenuItem::focusLeave ( )
virtualinherited

Reimplemented in Container, InputContainer, ListBox, XonoticCharmap, XonoticColorpicker, and XonoticInputBox.

Definition at line 99 of file item.qc.

100 {}

References focusLeave().

Referenced by focusLeave().

◆ getIdentifier()

virtual void TextSlider::getIdentifier ( )
virtual

References entity(), getIdentifier(), and METHOD.

Referenced by getIdentifier().

◆ hideNotify()

void MenuItem::hideNotify ( )
virtualinherited

Reimplemented in Container, and XonoticCvarList.

Definition at line 59 of file item.qc.

60 {}

References hideNotify().

Referenced by hideNotify().

◆ insertValue()

virtual void TextSlider::insertValue ( )
virtual

References entity(), insertValue(), and METHOD.

Referenced by insertValue().

◆ keyDown()

virtual void Slider::keyDown ( )
virtualinherited

Reimplemented from MenuItem.

References entity(), keyDown(), and METHOD.

Referenced by keyDown().

◆ keyUp()

virtual void Slider::keyUp ( )
virtualinherited

Reimplemented from MenuItem.

References entity(), keyUp(), METHOD, mousePress(), this, and vector.

Referenced by keyUp().

◆ mouseDrag()

virtual void Slider::mouseDrag ( )
virtualinherited

Reimplemented from MenuItem.

References entity(), METHOD, mouseDrag(), and vector.

Referenced by mouseDrag().

◆ mouseMove()

void MenuItem::mouseMove ( )
virtualinherited

Reimplemented in Container, InputBox, InputContainer, ListBox, Nexposee, XonoticPicker, XonoticScreenshotImage, and XonoticServerList.

Definition at line 72 of file item.qc.

73 {
74 return 0; // unhandled
75 }

References mouseMove(), and vector.

Referenced by mouseMove().

◆ mousePress()

void Slider::mousePress ( )
virtualinherited

Reimplemented from MenuItem.

Definition at line 195 of file slider.qc.

196 {
197 float controlCenter;
198 if (this.disabled) return false;
199 if (pos.x < 0) return false;
200 if (pos.y < 0) return false;
201 if (pos.x >= 1 - this.valueSpace) return false;
202 if (pos.y >= 1) return false;
203 controlCenter = (this.value - this.valueMin) / (this.valueMax - this.valueMin) * (1 - this.valueSpace - this.controlWidth) + 0.5 * this.controlWidth;
204 if (fabs(pos.x - controlCenter) <= 0.5 * this.controlWidth)
205 {
206 this.pressed = 1;
207 this.pressOffset = pos.x - controlCenter;
208 this.previousValue = this.value;
209 // this.mouseDrag(this, pos);
210 }
211 else
212 {
213 float clickValue, pageValue, inRange;
214 clickValue = median(0, (pos.x - this.pressOffset - 0.5 * this.controlWidth) / (1 - this.valueSpace - this.controlWidth), 1) * (this.valueMax - this.valueMin) + this.valueMin;
215 inRange = (almost_in_bounds(this.valueMin, this.value, this.valueMax));
216 if (pos.x < controlCenter)
217 {
218 pageValue = this.value - this.valuePageStep;
219 if (this.valueStep) clickValue = floor(clickValue / this.valueStep) * this.valueStep;
220 pageValue = max(pageValue, clickValue);
221 }
222 else
223 {
224 pageValue = this.value + this.valuePageStep;
225 if (this.valueStep) clickValue = ceil(clickValue / this.valueStep) * this.valueStep;
226 pageValue = min(pageValue, clickValue);
227 }
228 if (inRange) this.setValue(this, median(this.valueMin, pageValue, this.valueMax), autocvar_menu_animations > 0);
229 else this.setValue(this, this.valueMax, autocvar_menu_animations > 0);
230 if(this.applyButton)
231 this.applyButton.disabled = false;
232 if (pageValue == clickValue)
233 {
234 controlCenter = (this.value - this.valueMin) / (this.valueMax - this.valueMin) * (1 - this.valueSpace - this.controlWidth) + 0.5 * this.controlWidth;
235 this.pressed = 1;
236 this.pressOffset = pos.x - controlCenter;
237 this.previousValue = this.value;
238 // this.mouseDrag(this, pos);
239 }
240 }
241 return true;
242 }
float autocvar_menu_animations
Definition animation.qh:3
float disabled
Definition slider.qh:43
float controlWidth
Definition slider.qh:38
float pressOffset
Definition slider.qh:40
virtual void setValue()
float valueStep
Definition slider.qh:31
float valueMax
Definition slider.qh:30
float valueSpace
Definition slider.qh:37
float previousValue
Definition slider.qh:41
float pressed
Definition slider.qh:39
float valuePageStep
Definition slider.qh:34
float valueMin
Definition slider.qh:29
float value
Definition slider.qh:25
entity applyButton
Definition slider.qc:38
ERASEABLE float median(float a, float b, float c)
Definition math.qh:213
ERASEABLE float almost_in_bounds(float a, float b, float c)
Definition math.qh:233
float ceil(float f)
float min(float f,...)
float fabs(float f)
float floor(float f)
float max(float f,...)

References almost_in_bounds(), applyButton, autocvar_menu_animations, ceil(), controlWidth, disabled, fabs(), floor(), max(), median(), min(), mousePress(), pressed, pressOffset, previousValue, setValue(), value, valueMax, valueMin, valuePageStep, valueSpace, valueStep, and vector.

Referenced by keyUp(), and mousePress().

◆ mouseRelease()

virtual void Slider::mouseRelease ( )
virtualinherited

Reimplemented from MenuItem.

References entity(), METHOD, mouseRelease(), and vector.

Referenced by mouseRelease().

◆ recalcPositionWithText()

virtual void Label::recalcPositionWithText ( )
virtualinherited

Reimplemented in BorderImage.

References entity(), METHOD, and recalcPositionWithText().

Referenced by recalcPositionWithText().

◆ relinquishFocus()

void MenuItem::relinquishFocus ( )
virtualinherited

Definition at line 11 of file item.qc.

12 {
13 entity par = this.parent;
14 if (!par) return;
15 if (par.instanceOfContainer) par.setFocus(par, NULL);
16 }
entity parent
Definition animhost.qc:7
entity() spawn
#define NULL
Definition post.qh:14

References entity(), NULL, parent, and relinquishFocus().

Referenced by relinquishFocus().

◆ resizeNotify()

virtual void Slider::resizeNotify ( )
virtualinherited

Reimplemented from Label.

References entity(), METHOD, resizeNotify(), and vector.

Referenced by resizeNotify().

◆ setSliderValue()

virtual void Slider::setSliderValue ( )
virtualinherited

References entity(), METHOD, and setSliderValue().

Referenced by setSliderValue().

◆ setText()

virtual void Label::setText ( )
virtualinherited

Reimplemented in InputBox, and XonoticInputBox.

References entity(), METHOD, and setText().

Referenced by setText().

◆ setValue()

virtual void Slider::setValue ( )
virtualinherited

Reimplemented in XonoticMixedSlider, XonoticSlider, and XonoticTextSlider.

References entity(), METHOD, and setValue().

Referenced by mousePress(), and setValue().

◆ setValueFromIdentifier()

virtual void TextSlider::setValueFromIdentifier ( )
virtual

◆ showNotify()

virtual void Slider::showNotify ( )
virtualinherited

Reimplemented from MenuItem.

References entity(), METHOD, and showNotify().

Referenced by showNotify().

◆ toString()

virtual void Slider::toString ( )
virtualinherited

Reimplemented from Label.

References entity(), METHOD, and toString().

Referenced by toString().

◆ valueToIdentifier()

virtual void TextSlider::valueToIdentifier ( )
virtual

References entity(), METHOD, and valueToIdentifier().

Referenced by valueToIdentifier().

◆ valueToText()

virtual void TextSlider::valueToText ( )
virtual

Reimplemented from Slider.

References entity(), METHOD, and valueToText().

Referenced by valueToText().

Member Data Documentation

◆ align

float Label::align = 0.5
inherited

Definition at line 15 of file label.qh.

◆ allowColors

bool Label::allowColors = false
inherited

Definition at line 17 of file label.qh.

◆ allowCut

bool Label::allowCut = false
inherited

Definition at line 16 of file label.qh.

◆ allowFocusSound

bool Slider::allowFocusSound = true
inherited

Definition at line 24 of file slider.qh.

◆ allowWrap

bool Label::allowWrap = false
inherited

Definition at line 32 of file label.qh.

◆ allowWrap_spacing

float Label::allowWrap_spacing = 0
inherited

Definition at line 33 of file label.qh.

◆ alpha

float Label::alpha = 0.7
inherited

Definition at line 24 of file label.qh.

◆ animated

bool Slider::animated = true
inherited

Definition at line 26 of file slider.qh.

◆ color

vector Slider::color = '1 1 1'
inherited

Definition at line 44 of file slider.qh.

◆ color2

vector Slider::color2 = '1 1 1'
inherited

Definition at line 45 of file slider.qh.

◆ colorC

vector Slider::colorC = '1 1 1'
inherited

Definition at line 47 of file slider.qh.

◆ colorD

vector Slider::colorD = '1 1 1'
inherited

Definition at line 46 of file slider.qh.

◆ colorF

vector Slider::colorF = '1 1 1'
inherited

Definition at line 48 of file slider.qh.

◆ colorL

vector Label::colorL = SKINCOLOR_TEXT
inherited

Definition at line 25 of file label.qh.

◆ condenseFactor

float Label::condenseFactor = 1
inherited

Definition at line 35 of file label.qh.

◆ controlWidth

float Slider::controlWidth = 0
inherited

Definition at line 38 of file slider.qh.

Referenced by mousePress().

◆ disabled

float Slider::disabled = 0
inherited

Definition at line 43 of file slider.qh.

Referenced by mousePress().

◆ disabledAlpha

float Slider::disabledAlpha = 0.3
inherited

Definition at line 49 of file slider.qh.

◆ focusable

bool Slider::focusable = true
inherited

Definition at line 23 of file slider.qh.

◆ focused

bool MenuItem::focused = false
inherited

Definition at line 24 of file item.qh.

◆ fontSize

float Label::fontSize = 8
inherited

Definition at line 14 of file label.qh.

◆ formatString

string Slider::formatString = ""
inherited

Definition at line 36 of file slider.qh.

◆ isBold

bool Label::isBold = false
inherited

Definition at line 11 of file label.qh.

◆ keepspaceLeft

float Label::keepspaceLeft = 0
inherited

Definition at line 18 of file label.qh.

◆ keepspaceRight

float Label::keepspaceRight = 0
inherited

Definition at line 19 of file label.qh.

◆ marginLeft

float Label::marginLeft = 0
inherited

Definition at line 20 of file label.qh.

◆ marginRight

float Label::marginRight = 0
inherited

Definition at line 21 of file label.qh.

◆ nValues

int TextSlider::nValues = 0

Definition at line 18 of file textslider.qh.

◆ origin

vector MenuItem::origin = '0 0 0'
inherited

Definition at line 29 of file item.qh.

Referenced by resizeNotify().

◆ overrideCondenseFactor

bool Label::overrideCondenseFactor = false
inherited

Definition at line 37 of file label.qh.

◆ overrideRealOrigin

vector Label::overrideRealOrigin = '0 0 0'
inherited

Definition at line 36 of file label.qh.

◆ preferredFocusPriority

float MenuItem::preferredFocusPriority = 0
inherited

Definition at line 28 of file item.qh.

◆ pressed

float Slider::pressed = 0
inherited

Definition at line 39 of file slider.qh.

Referenced by mousePress().

◆ pressOffset

float Slider::pressOffset = 0
inherited

Definition at line 40 of file slider.qh.

Referenced by mousePress().

◆ previousValue

float Slider::previousValue = 0
inherited

Definition at line 41 of file slider.qh.

Referenced by mousePress().

◆ realFontSize

vector Label::realFontSize = '0 0 0'
inherited

Definition at line 22 of file label.qh.

◆ realOrigin

vector Label::realOrigin = '0 0 0'
inherited

Definition at line 23 of file label.qh.

◆ recalcPos

bool Label::recalcPos = false
inherited

Definition at line 34 of file label.qh.

◆ size

vector MenuItem::size = '0 0 0'
inherited

Definition at line 30 of file item.qh.

Referenced by resizeNotify().

◆ sliderValue

float Slider::sliderValue = 0
inherited

Definition at line 27 of file slider.qh.

◆ tolerance

vector Slider::tolerance = '0 0 0'
inherited

Definition at line 42 of file slider.qh.

◆ value

float Slider::value = 0
inherited

Definition at line 25 of file slider.qh.

Referenced by mousePress().

◆ valueDigits

float Slider::valueDigits = 0
inherited

Definition at line 32 of file slider.qh.

◆ valueDisplayMultiplier

float Slider::valueDisplayMultiplier = 1.0
inherited

Definition at line 35 of file slider.qh.

◆ valueIdentifiers

string TextSlider::valueIdentifiers[256]

Definition at line 17 of file textslider.qh.

◆ valueKeyStep

float Slider::valueKeyStep = 0
inherited

Definition at line 33 of file slider.qh.

◆ valueMax

float Slider::valueMax = 0
inherited

Definition at line 30 of file slider.qh.

Referenced by mousePress().

◆ valueMin

float Slider::valueMin = 0
inherited

Definition at line 29 of file slider.qh.

Referenced by mousePress().

◆ valuePageStep

float Slider::valuePageStep = 0
inherited

Definition at line 34 of file slider.qh.

Referenced by mousePress().

◆ valueSpace

float Slider::valueSpace = 0
inherited

Definition at line 37 of file slider.qh.

Referenced by mousePress().

◆ valueStep

float Slider::valueStep = 0
inherited

Definition at line 31 of file slider.qh.

Referenced by mousePress().

◆ valueStrings

string TextSlider::valueStrings[256]

Definition at line 16 of file textslider.qh.


The documentation for this class was generated from the following file: