DialogControls-Sliders: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (disamb)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{SideTOC}}
{{Wiki|disamb}}
==General==
{{Informative|TokenNames common to most controls, such as x, y, w, h, text, idc... are not listed here.}}


*'Sliders' and 'ScrollBars' are synonymous.
* [[CT_XSLIDER]]
*Default scrollbars are vertical. Use ST_HORZ to change orientation.
* [[CT_SLIDER]]
*Embedded child scrollbars are created by the engine as and when required for various control types. (CT_LISTBOX e.g.). The engine generates it's own idc for them. In most cases you can alter characteristics of that auto-generated scrollbar via class ScrollBar
{{Important|It makes no sense to create 'independent' scrollbars without an idc.}}
 
==CT_SLIDER=3 (deprecated)==
{|class="wikitable" width="40%" border="1" align="left" cellpadding="3" cellspacing="0" |
! colspan="3" bgcolor="#bbbbff" | Properties
|-
! bgcolor="#ddddff" | Name
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
|-
| '''coloractive'''
| color array
| color of the arrows.
|-
|}<br clear="all">
 
==CT_XSLIDER=43 or Embedded Scrollbar Class==
 
Embedded scrollbar classes (such as those in listboxes e.g.) use the xbox properties as per a CT_XSLIDER
 
{|class="wikitable" width="40%" border="1" align="left" cellpadding="3" cellspacing="0" |
! colspan="3" bgcolor="#bbbbff" | Properties
|-
! bgcolor="#ddddff" | Name
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
|-
| '''arrowEmpty'''
| textures
| Texture shown when the left or right arrow is not pressed
|-
| '''arrowFull'''
| textures
| Texture shown when the left or right arrow is pressed
|-
| '''border'''
| texture
|
|-
| '''colorActive'''
| color
| color of the arrows.
|-
| '''colorDisabled'''
| color
|
|-
| '''thumb'''
| texture
| Texture of the part that can be dragged
|-
| '''vspacing'''
| float
|
|-
|}<br clear="all">
 
[[Image:ControlSlider.JPG|thumb|200px|A Slider Control]]
* '''Example Config:'''
<syntaxhighlight lang="cpp">class MySlider
{
  idc = -1;
  type = CT_SLIDER;
  style = SL_HORZ;
  x = 0.4;
  y = 0.2;
  w = 0.3;
  h = 0.025;
  color[] = { 1, 1, 1, 1 };
  coloractive[] = { 1, 0, 0, 0.5 };
  // This is an ctrlEventHandler to show you some response if you move the sliderpointer.
  onSliderPosChanged = "hint format[""%1"",_this];";
  sliderPosition = 500;//Initial position when slider is created
  sliderRange[] = {50,2000};//Min and max value of the slider
  sliderStep = 1;//Size of step when dragging
};</syntaxhighlight>
 
=Helpful Script Commands=
'''[[sliderPosition]], [[sliderRange]], [[sliderSetPosition]], [[sliderSetRange]], [[sliderSetSpeed]], [[sliderSpeed]]'''
[[Category: Dialogs|Sliders]]

Latest revision as of 14:39, 7 February 2021

Disambiguation
This disambiguation page lists articles associated with the same title.