(July 2019) Monthly WIP Screenshot Thread

I would like to participate this months as well.
Last time I did something I discussed the option of making my own lemur element in our forum

Finaly I found time to work on it. And here it is

edit: the brown panels are WIP, to check if the size is realy constant…

I made my own lemur “Readfield” - copy+ paste + edit of the Lemur listbox structure.
It is in the end two textfields and a slider.

The main feature is, that the element will keep the size you set it too. Even if the text is changed, the headline is hidden or the slider is attached or detached. Headline is user choice but slider comes if the element realizes its to small to show all the text.

To do so I added own Styleattributes like width and height

   @StyleAttribute(value = "setReadfieldPreferredWidth", lookupDefault = false)
    public void setReadfieldPreferredWidth(float width) {

I can now easily change the style of my “Readfield” or its subelements like headline, textfield or slider like that

ElementId id = new ElementId("readField");
...
subid = id.child("textField");
lbhg = new QuadBackgroundComponent(readfieldtxtfieldbgrcolor);
GuiGlobals.getInstance().getStyles().getSelector(subid,"OSG").set("background", lbhg.clone(),true);
...
TextField.ScrollMode.AutoadjustX);

I added my standard mouslistener (so you can click inside the text and the cursor will be set to that exact position) and slider functionality.
For slider functionality I needed to add the option to manually set the Y-Offset of the textfield in my lemur modification. This is done automatically by arrow keys but I just did not have the option to set it via code. E.g. if you need to jump 5 lines at once.

What is it good for:
Well I know you may say there is already an element in lemur that is showing text…

I needed an element, that I can reuse and set to whatever size I need it with variable text. My idea is to have something like an unit description or background information from wiki that comes via database or textfile. So you never know how much text you will have in the end.
For headline I have deleted all key mappings but for the textfield I will keep the textselect and copy function. So you will be always able to copy interessting parts from a description shown and search for it.
Maybe I will also add a spacer to show an image but I have not yet decided about it.

However I will see when I can go on and as usual I have to say, that lemur gives great opportunities.

7 Likes