1st Issue (Default controls height)
In this attribute control, the control DescriptionDeco has an incorrect height. It should be as high as the control Description.
This causes this attribute control to be scroll able, which is undesired when used as attribute in Eden Editor. (See the comments in the code below)
class SubCategoryNoHeader2: SubCategoryNoHeader1 { h = "(0.5 * 5 * (pixelH * pixelGrid * 0.50)) + (2 * 4.5 * (pixelH * pixelGrid * 0.50))"; class Controls: Controls { class Group: Group { h = "2 * 4.5 * (pixelH * pixelGrid * 0.50)"; class Controls: Controls { class Title: Title { }; class DescriptionDeco: ctrlStatic { w = "5 * pixelW"; h = "2 * 5 * (pixelH * pixelGrid * 0.50)"; This control is too high. It should be h = "2 * 4.5 * (pixelH * pixelGrid * 0.50)"; colorBackground[] = {1,1,1,0.05}; }; class Description: Description { h = "2 * 4.5 * (pixelH * pixelGrid * 0.50)"; }; }; }; }; };
In the first video, the user should not be able to scroll since the text height does not exceed the height of the controls group.
2nd Issue (If text height exceeds controls height. Controls height is not adjusted)
Here the text height exceeds the controls height. According to the code "onAttributeLoad" the control height should be adjusted to the text height, but that doesn't seem to work properly.
Code used to set control height according to text. Does not seem to work properly (See 2nd Video)
attributeLoad:
_control = (_this controlsGroupCtrl 101) controlsGroupCtrl 100; _control ctrlSetText gettext (_config >> 'title'); _control ctrlcommit 0; _control = (_this controlsGroupCtrl 101) controlsGroupCtrl 102; _control ctrlSetStructuredText parseText gettext (_config >> 'description'); _controlPos = ctrlposition _control; _controlPos set [3,(_controlPos select 3) max (ctrltextheight _control)]; _control ctrlsetposition _controlPos; _control ctrlcommit 0;
3rd Issue (Structured text provided in description property is not correctly parsed)
Out of the box this control should support structured text but it doesn't seem to properly parse the text.
If I set the following text into the attribute config as description property like so:
//configFile >> "Cfg3DEN" >> "Mission" >> "Preferences" >> "AttributeCategories" >> "Test" class Test { collapsed = 1; displayName = "Test"; class Attributes { class Test { description = "Disable AI Features. See <a href='https://community.bistudio.com/wiki/disableAI'>disable AI command documentation</a> to learn more."; data = "AttributeSystemSubcategory"; control = "SubCategoryNoHeader2"; }; class Test2 { displayName = "Test Attribute"; property = "Test"; control = "Edit"; defaultValue = "Test"; }; }; };
It will not parse the text. E.g, the link will not be formatted correctly. However, this properly displays the text:
hint parseText "Various AI Skill Settings. See <a href='https://community.bistudio.com/wiki/Arma 3 AI Skill'>Arma 3 AI Skill</a> to learn more."
_display = findDisplay 46 createDisplay "RscDisplayEmpty"; _text = _display ctrlCreate ["RscStructuredText", -1]; _text ctrlSetPosition [0,0,1,0.1]; _text ctrlSetBackgroundColor [0,0,0,1]; _text ctrlCommit 0; _text ctrlSetStructuredText parseText "Disable AI Features. See <a href='https://community.bistudio.com/wiki/disableAI'>disable AI command documentation</a> to learn more.";