[GUI] search widget?
Moderator: Forum Moderators
-
- Posts: 1257
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
[GUI] search widget?
Is there a widget that provides text search, and maybe some docs/examples?
I'm looking at data/gui/window/unit_recruit.cfg. It has a text_box, with that promising FILTER_TEXT_BOX_HINT. But I can't find the stuff that actually acts on said text.
I guess I could roll my own based on text_box:on_modified, but I don't want to and I suspect performance may not be all that great.
TIA
I'm looking at data/gui/window/unit_recruit.cfg. It has a text_box, with that promising FILTER_TEXT_BOX_HINT. But I can't find the stuff that actually acts on said text.
I guess I could roll my own based on text_box:on_modified, but I don't want to and I suspect performance may not be all that great.
TIA
Speak softly, and carry Doombringer.
- Pentarctagon
- Project Manager
- Posts: 5586
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: [GUI] search widget?
For mainline, those sorts of UI functions are usually implemented in C++, so that wouldn't be something that'd be useful as an example for UMC.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
-
- Posts: 1257
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: [GUI] search widget?
Any idea how hard it would be to take what exists for recall and turn it into a widget? I think it would be quite useful, though ATM I'm having a hard time figuring out how the search would be scoped.
Speak softly, and carry Doombringer.
- Pentarctagon
- Project Manager
- Posts: 5586
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: [GUI] search widget?
Probably either pretty hard or not really generally applicable, since each dialog tends to structure the data it's using differently and a search of course needs to know what parts of the data structure to look in.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- Celtic_Minstrel
- Developer
- Posts: 2260
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [GUI] search widget?
I went looking, thinking there should be something that at least allows you to write
definition=search
or definition=filter
to get the appearance of a search box, but sadly that seems to be missing. While I'm not sure if the search functionality is worth adding to core, I think the appearance would be.-
- Posts: 1257
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: [GUI] search widget?
Copying from gui/window/lobby_main.cfg and gui/macros/_initial.cfg:
T.text_box {definition = "default",id = "filter_text",hint_text = _ "Search",hint_image = "icons/action/zoomdefault_25.png~FL(horiz)" }
gives me a text_box that looks like a search box.
And now I have something new to document. Great.
T.text_box {definition = "default",id = "filter_text",hint_text = _ "Search",hint_image = "icons/action/zoomdefault_25.png~FL(horiz)" }
gives me a text_box that looks like a search box.
And now I have something new to document. Great.
Speak softly, and carry Doombringer.