Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Michael R. P. Ragazzon
@mikke89
Yeah, this issue has been discussed before. The easiest way really is to call Context::Update after Close. Then, it should be safe to delete your listener objects.
Marco Bortolin
@barotto
ok, thanks
Paweł
@diamondhat

Hello guys. I hope we can implement this feature https://www.w3.org/TR/css-flexbox-1/

:))

Michael R. P. Ragazzon
@mikke89
@diamondhat Already working on it in the flexbox branch :)
Ravbug
@Ravbug
I updated RmlUi to 4.2 from a dev version of 4.0 and I noticed that I'm no longer getting change events on <select> elements
Clicks on buttons and change events on sliders work
I'm adding the change events in code like this for both sliders and select elements:
element->AddEventListener(Rml::EventId::Change, new Handler(...));
Michael R. P. Ragazzon
@mikke89
@Ravbug Hm, we did make some changes to the select element, so it could be that we broke something. But it seems to work well for me in all my testing. Can you post a complete reproducible, preferably a unit test?
Ravbug
@Ravbug

@mikke89 I have very simple RML and C++ which reproduces the issue:

<rml>
    <head>
        <link type="text/rcss" href="default.rcss"></link>
        <style>
            *{
                font-size: 30dp
            }
        </style>
    </head>
    <body>
        <main>
            <p id="diag"></p>
            <br></br>
           <p>
               Select Mesh<br />
               <select id="sel">
                    <option selected>Cube</option>
                    <option>Cone</option>
                    <option>Cylinder</option>
                    <option>Sphere</option>
               </select>
           </p>
        </main>
    </body>
</rml>
struct SelectionEventListener : public Rml::EventListener{
        void ProcessEvent(Rml::Event& evt) override{
            cout << "selection event triggered" << endl;
        }
    };

    doc->GetElementById("sel")->AddEventListener(Rml::EventId::Change, new SelectionEventListener);

struct BtnEventListener : public Rml::EventListener{
        void ProcessEvent(Rml::Event& evt) override{
            cout << "button event triggered" << endl;
        }
    };
 doc->GetElementById("btn")->AddEventListener(Rml::EventId::Click, new BtnEventListener);

When run, "button event triggered" is printed while "selection event triggered" is not printed

I can try to put together a test app if necessary

Michael R. P. Ragazzon
@mikke89
Ah, I managed to reproduce with that code, thanks. I see the issue now, there are no values on the options. Thus the value of the select element doesn't actually change when a new option is selected, and there is no resulting change event. Not sure how this worked before, but I do think that the new behavior makes some sense, what do you think?
Ravbug
@Ravbug
So the options need to have value=1, value=2, ...? If so, then I think the documentation should mention that change events are not fired for options that do not have values (unless it already does and I missed that)
If options having no value is never correct, then it might also be worth logging a warning if it encounters one while loading a document
Michael R. P. Ragazzon
@mikke89
I see there might be some value to having the old behavior, I'll see if I can make it work again without too much trouble.
Ravbug
@Ravbug
I have some C++ code that generates options and added them to a select, having them automatically get ascending values (instead of needing to call SetProperty) would be helpful but not completely necessary
Michael R. P. Ragazzon
@mikke89
I think automatically giving them a value would be quite unexpected behavior in my view, not something I'd want.
Michael R. P. Ragazzon
@mikke89
@Ravbug Could you test the latest master to see if it all works as expected now? :)
Ravbug
@Ravbug
Just tried latest, it's working as expected :) @mikke89
Michael R. P. Ragazzon
@mikke89
Great!
Paweł
@diamondhat
Hello again. And it is great that you work on flexbox feature. If I have a free time I will try to implement Vulkan example.
Michael R. P. Ragazzon
@mikke89
Thanks! Sounds good, would be nice to have a Vulkan backend :)
Łukasz Nocuń
@nocun
Hi, is it possible for RmlUI to handle text selection within the layout using mouse? not in a text-box but normal HTML elements, just like in a regular browser
Michael R. P. Ragazzon
@mikke89
@nocun There is no support for this right now I'm afraid.
Łukasz Nocuń
@nocun
@mikke89 ok thank you
checked all the demos, this library looks really great
Michael R. P. Ragazzon
@mikke89
Thanks! I appreciate it, hope you find it useful :)
Łukasz Nocuń
@nocun
yeah for sure, thank you guys for all the work!
zcream
@zcream
Is there an example for converting HTML/CSS to an offscreen image buffer ? The user can then use it for further processing.
illwieckz
@illwieckz:matrix.org
[m]
Hi, is it valid in RML documents to use attribute without values?
I noticed some of our RML files does that, for example I have one file with that line:
<body id="menu_main" class="mainmenu" nohide onShow='welcome(event, document) Events.pushevent("play 2 sound/ui/heartbeat sound/ui/heartbeat1", event)'>
Notice the lone nohide
then our code just does HasAttribute( "nohide" )
but I noticed this was making some python xml parser to abort the parsing
it may be super convenient to just set attributes like that, and only check the presence of it
but are we abusing the format?
Michael R. P. Ragazzon
@mikke89
Hello. Plain attributes like that are perfectly valid, it's commonly used with some elements eg. the checked attribute. Not sure if it's strictly valid xml, but in rml (and html for that matter) it should be fine at least.
illwieckz
@illwieckz:matrix.org
[m]
ok thanks 👍
it makes easy to flag some markup without adding to add useless =""
Kolja
@pinguin999
Does RmlUi Supports Korean fonts?
Text like 계속하기 results in no text at all. :( (But I have a very old version)
Michael R. P. Ragazzon
@mikke89
@pinguin999 I haven't tested it, but I think it should work? Of course you need to load a font that supports it.
Kolja
@pinguin999
I have a font that supports it.
If you have a quick way to test it, it would be a big help.
Michael R. P. Ragazzon
@mikke89
@pinguin999 I just tested this now on my end it's working fine here for me.
image.png
Kolja
@pinguin999
Thanks a lot. Than I will update my RmlUi version.
Michael R. P. Ragazzon
@mikke89
Uhm, have any of you ever seen character escapes in CSS by forward slash? Or am I somehow misinterpreting this code: https://github.com/mikke89/RmlUi/blob/536c24b49304b9e6e1bd11b0d0f82d0452643924/Source/Core/PropertySpecification.cpp#L492
Looks like escape character logic, but that should instead be back slash right?
Quinn Romanek
@quinnromanek_gitlab
small question - is there a way to do recursion using data models? I.e. to display a tree structure or something of that kind
maybe with templates?
Michael R. P. Ragazzon
@mikke89
Hm, I don't know how we would declare something like recursion with data bindings. To me it doesn't really sound like a great idea either. You should take a look at the tree sample, that one shows you how you can do tree structures without recursion.
Quinn Romanek
@quinnromanek_gitlab
will have a look
Maximilian Stark
@Dakror
Hey @mikke89 , i want to add support for array textures. Would you rather add the array texture layer in each sprite definition or would you rather make a single spritesheet per layer basically?
Maximilian Stark
@Dakror
After starting to fiddle with the system i concluded for now to just generate sprite sheets per layer and handle the z texture component in my application render interface