DialogControls-ControlsGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (merged tables)
m (redirect)
Tag: New redirect
Line 1: Line 1:
{{SideTOC}}
#redirect [[CT_CONTROLS_GROUP]]
==CT_CONTROLS_GROUP Type=15==
{{Informative|TokenNames common to most controls, such as x, y, w, h, text, idc... can be found [[Arma:_GUI_Configuration#Common_Properties|'''here''']].}}
 
*Any child controls need to be defined in the controlsGroup's subclass Controls {};
*The x and y coords of any child controls are relative to the controlsGroups position. The height and width are not and are in [[GUI_Coordinates|screen space dimensions]].
*If the position or height/width of any child controls cause any part of the child control to fall outside the dimensions of the controlsGroup then scrollbars will be seen
**This allows the creation of scrollable active text controls etc
<br>
{|class="wikitable" border="1" align="left" cellpadding="3" cellspacing="0" |
! colspan="3" bgcolor="#bbbbff" | Classes
|-
! bgcolor="#ddddff" | Name
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
|-
| '''ScrollBar'''
| class
| Default parent class for all scrollbar settings
|-
| '''VScrollbar'''
| class
| Settings relating to Vertical scrollbar
|-
| '''HScrollbar'''
| class
| Settings relating to Horizontal scrollbar
|-
| '''Controls'''
| class
| Any user added [[Arma: GUI Configuration#Controls|controls]] to be contained within the controlsGroup
|-
|}<br clear="all">
<br>
===class Scrollbar, VScrollbar, HScrollbar===
Parent class used to define all available properties of '''VScrollbar''' and '''HScrollbar'''. Not all available properties make sense for each of these as outlined below.
{|class="wikitable" width="100%" border="1" align="left" cellpadding="3" cellspacing="0" |
! colspan="6" bgcolor="#bbbbff" | Properties
|-
! bgcolor="#ddddff" | Name
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
! bgcolor="#ddddff" | Scrollbar
! bgcolor="#ddddff" | VScrollbar
! bgcolor="#ddddff" | HScrollbar
 
|-
| '''color'''
| [[Color|color array]]
| Color of thumb and arrow heads, also arrow backgrounds when pressed.
| <center>x</center>
| <center>x</center>
| <center>x</center>
|-
| '''colorActive'''
| [[Color|color array]]
| Color when the scrollbar is focused.
| <center>x</center>
| <center>x</center>
| <center>x</center>
|-
| '''colorDisabled'''
| [[Color|color array]]
| Color when the scrollbar is deactivated.
| <center>x</center>
| <center>x</center>
| <center>x</center>
|-
| '''width'''
| [[Number]]
| Width of the controlsGroup's scroll bars  in [[GUI_Coordinates|screen space dimensions]]. Setting to 0 will cause no scrollbar to be shown even if a child falls outside the controlsGroup's dimensions
| <center>x</center>
| <center>x</center>
|
|-
| '''height'''
| [[Number]]
| Height of the controlsGroup's scroll bars  in [[GUI_Coordinates|screen space dimensions]]. Setting to 0 will cause no scrollbar to be shown even if a child falls outside the controlsGroup's dimensions
| <center>x</center>
|
| <center>x</center>
|-
| '''autoScrollEnabled'''
| [[Number]]
| 1 - enabled, 0 - disabled, Does not work if there a interactive controls within the controlsGroup e.g Buttons
| <center>x</center>
| <center>x</center>
|
|-
| '''autoScrollSpeed'''
| [[Number]]
| Default -1, smaller numbers scroll faster, '''cannot''' be forced to scroll backwards by supplying negative numbers
| <center>x</center>
| <center>x</center>
|
|-
| '''autoScrollDelay'''
| [[Number]]
| Time in seconds before autoScroll starts, restarts after user input and time before rewind happens when the end has been reached
| <center>x</center>
| <center>x</center>
|
|-
| '''autoScrollRewind'''
| [[Number]]
| 0 - disable, 1 - enabled : If autoScroll reaches the bottom of the controlsGroup it will wait '''autoScrollDelay''' then fade out, scroll back to the top, fade back in, wait '''autoScrollDelay''' before proceeding to start auto scrolling again.
| <center>x</center>
| <center>x</center>
|
|-
| '''thumb'''
| [[String]]
| Path to texture or [[Procedural_Textures#color|Procedural Texture]] "#(argb,8,8,3)color(1,1,1,1)";
| <center>x</center>
| <center>x</center>
| <center>x</center>
|-
| '''arrowEmpty/Full'''
| [[String]]
| Path to texture or [[Procedural_Textures#color|Procedural Texture]] "#(argb,8,8,3)color(1,1,1,1)";
| <center>x</center>
| <center>x</center>
| <center>x</center>
|-
| '''border'''
| [[String]]
| Path to texture or [[Procedural_Textures#color|Procedural Texture]] "#(argb,8,8,3)color(1,1,1,1)";
| <center>x</center>
| <center>x</center>
| <center>x</center>
|-
| '''shadow'''
| [[Number]]
|
| <center>x</center>
| <center>x</center>
| <center>x</center>
|-
| '''scrollSpeed'''
| [[Number]]
| Default 0.06 : Speed of user vertical scroll input when using the mouse wheel, can be set to 0 to disable the user from being able to scroll, can be set to negative number to reverse scroll direction.
| <center>x</center>
| <center>x</center>
| <center>x</center>
|-
|}<br clear="all">
 
===class Controls===
*Additional user added controls of any type can be added in a derived class. The base is empty because the engine looks for it regardless.
 
==Example Config==
{{Informative|*If the h value of a child control inside the controls class is larger than the h value of the controls group, a vertical scroll bar will be created. The same applies to the horizontal scroll bar.
*Positioning of controls inside control groups is relative to controls group's position}}
 
{{Important|*A generalised screw-up occurs in Arrowhead rscControlGroup where color is not specified for V and H scrollbars and shadow should not have been specified. As a result any deriving class:
**a) cannot inherit the existing scrollbar
**b) must repeat the entire thing with the addition of color.}}
 
 
<syntaxhighlight lang="cpp">class Dialog
{
    idd = -1;
    class Controls
    {
        class _CT_CONTROLS_GROUP
        {
            type = 15;
            idc = -1;
            style = 16;
            x = 0;
            y = 0;
            w = 1;
            h = 1;
            shadow = 0;
            class ScrollBar
            {
                color[] = {1,1,1,0.6};
                colorActive[] = {1,1,1,1};
                colorDisabled[] = {1,1,1,0.3};
                thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
            };
            class VScrollbar: ScrollBar
            {
                width = 0.021;
                autoScrollSpeed = -1;
                autoScrollDelay = 5;
                autoScrollRewind = 0;
                shadow = 0;
            };
            class HScrollbar: ScrollBar
            {
                height = 0.028;
                shadow = 0;
            };
            class Controls
            {
                class _CT_EDIT
                {
                    idc = -1;
                    onLoad = "params ['_ctrl']; _ctrl ctrlSetText loadFile 'A3\functions_f\Actions\fn_packStaticWeapon.sqf'";
                    type = 2;
                    style = 16;
                    autocomplete = "";
                    canModify = 1;
                    colorBackground[] = {0,0,0,0.5};
                    colorText[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.25};
                    colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",1};
                    text = "";
                    x = 0;
                    y = 0;
                    w = 2;
                    h = 2;
                    sizeEx = 0.05;
                    font = "RobotoCondensedLight";
                };
            };
        };
    };
};</syntaxhighlight>
[[Category: Dialogs|Controls Group]]

Revision as of 15:30, 29 November 2020

Redirect to: