[Feature Request] make SelectBox inheiritable/overrideable
See original GitHub issuechat from Discord channel
[7:04 PM] Winter: Ended up getting the SelectBox + icon working
[7:05 PM] Winter: My trick was simply to change the drawItem function in SelectBox
public GlyphLayout drawListItem(Batch batch, BitmapFont font, int index, T item, float x, float y, float width)
{
...
}
[7:05 PM] Winter: It's kinda dirty because I had to copy paste the whole SelectBox code (not heritable because of it's hidden inner class) but at least it wasn't much work
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Repeat Grid overrides / inheritance (some styles differ in an ...
When I create a repeating grid, it is possible that I can change individual entries from the content. However, it is not possible...
Read more >Cascade, specificity, and inheritance - Learn web development
An element selector is less specific; it will select all elements of that type that appear on a page, so it has less...
Read more >How to extend / inherit components? - angular - Stack Overflow
It looks like you can inherit and override whatever you want, except for templates and styles. Some references: New features in Angular 2.3....
Read more >List components that do not inherit from template - Forum
This query will list all settings which are currently overridden on application level (not inherited from template):. SELECT n.Caption as Node, a.
Read more >Dictionary overrides—what they are and how to use them
Dictionary overrides are inherited by extended tables, so it may be necessary to define additional overrides to change the value of fields on ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wouldn’t call it inconsistent. One is drawing the item in the select box, the other is drawing items in the list. The select box and the list are not the same.
This problem occurs any time you build a UI control (Widget in scene2d.ui, as much as I dislike that word, couldn’t find a better one) using multiple components.
I don’t think it’s a great design to pull the details of all those components into the UI control. It bloats the API. It limits customization to only what is exposed. That leads to exposing more, which bloats the API more. Better to keep the components doing what they do separately and also customize them separately.
We can expose creation of the components so they can be customized. It makes customization a bit verbose, but otherwise it’s pretty OK.
Knowing if an actor is a descendant of a select box scroll pane (not a descendant of the select box itself) is a separate problem. We can expose the class in SelectBox since we’ll need to do so to allow customization of the scroll pane.
at least we can agree that copy/pasting a whole class is an anti-pattern to be avoided.
let me again play “Advocatus Diaboli” here.
@WinterAlexander maybe you should propose an implementation, on the lessons you have learn so far, from your current overriding.
@NathanSweet since you seam to have had the same experience, maybe your expertise can be merged into the proposal.
from a software engineering point of view, checking if the item implements a “SelectBoxDrawer” and hence delegate the rendering/drawing to it could be a way to move forward.