OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Denisko-Redisko on 20 Sep 2009, 21:11:13

Title: To set scrollbars on a html (or strucured-text)-control
Post by: Denisko-Redisko on 20 Sep 2009, 21:11:13
At first it seemed to me that arma2 scrollbar can be set for any control.
Having looked at the config i was a bit disappointed, scrollbar is set for a controls-group, it draws a scrollbar when it contains controls of larger size, than itself.
(see: configFile >> "RscDisplayDiary", or "AddOns\ui\config.cpp")

It is the same as it was before, in ArmA1. And the main problem is that when we want to have scrollable html-control or strucured-text-control we need to know it actual size that depends on volume of the loaded text (htmlLoad or ctrlSetStructuredText).

Not especially hoping for success, I tried to set scrollbar classes (Scrollbar, VScrollbar, HScrollbar), for other controls, but it didn't work.

Somebody knows, how it works ingame, or how it can be workaround? Any ideas.
Title: Re: To set scrollbars on a html (or strucured-text)-control
Post by: Mandoble on 20 Sep 2009, 22:03:46
It did fail for me too  :dry:
Title: Re: To set scrollbars on a html (or strucured-text)-control
Post by: Clayborne on 12 Nov 2011, 18:59:44
So you can't have a scrollbox with a structured text control? I've been trying to add a scrollbar to a text box and it was maddening enough without any proper documentation anywhere on how to do it. But then I find this and discover it was all for nothing anyway. Anyone ever worked this out?
Title: Re: To set scrollbars on a html (or strucured-text)-control
Post by: Denisko-Redisko on 15 Jan 2013, 01:01:19
if you only know the actual vertical size of text, you can do it
Code: [Select]
class RscYourDisplay {
    ...
    class controls {
        class ControlsGroup : RscControlsGroup {
            class VScrollbar {
                width = 0.019;
            };
            class controls {
                class YourTextControl : RscStructuredText {
                    // it vertical size of text page
                    h = 100;
                };
            };
        };
    };
};