Board index FlightGear Development

GUI Combo: How to control so it drops down not up  Topic is solved

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

GUI Combo: How to control so it drops down not up

Postby mhab » Tue Nov 19, 2013 12:45 am

Hello

I have searched all kinds of GUI combo examples but could not find a TAG which controls if it drops UP or DOWN ...
I have checked dialogs which have drop-downs and couldn't find why.
I created one which drops up unwantedly ...
How can I make it drop down ?

Thanks for any hint
Mike-DE
mhab
 
Posts: 418
Joined: Thu Apr 18, 2013 11:59 pm
Callsign: D-MIKE
Version: 2020.3.4
OS: Win10

Re: GUI Combo: How to control so it drops down not up  

Postby mhab » Mon Jan 02, 2017 8:48 pm

Hello

As nobody ever replied to this, here is what I found out.
The GUI I refer to here is PUI and in PUI it says that combo boxes are controlled automatically for the direction they popup to.

Well sad to say but the "automatic" in the combo boxes is 90%-100% wrong as I experienced it.

Mike-DE
mhab
 
Posts: 418
Joined: Thu Apr 18, 2013 11:59 pm
Callsign: D-MIKE
Version: 2020.3.4
OS: Win10

Re: GUI Combo: How to control so it drops down not up

Postby Thorsten » Tue Jan 03, 2017 8:24 am

Yeah, the combo isn't the strongest PUI widget...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: GUI Combo: How to control so it drops down not up

Postby Hooray » Wed Jan 04, 2017 8:08 pm

See $FG_ROOT/Docs/README.gui - for instance, you could use a select widget instead of the combo if the combo turns out to be problematic.
Apart from that, the pui2canvas effort is using Canvas to parse/render a subset of the PUI/XML markup used by FlightGear to render a handful of widgets - and given that a combo box is really just an input field (possibly readonly) with a corresponding button, it should be relatively straightforward to create a full combo widget - in fact, a few months ago I created a simple combo-equivalent by using the existing ScrollArea widget, adding one button widget to the scrollArea for each combo item - ultimately, this turned out to be working well enough actually:

http://wiki.flightgear.org/Howto:Proces ... ing_Canvas
Image

It would be trivial to tell the Canvas widget to align/layout this according to what people need.

In addition, it is worth noting that we don't really need a 1:1 mapping between PUI and Canvas, because we can usually emulate/approximate most PUI widgets rather easily using similar workarounds - as a matter of fact, the whole PUI widget set is rather archaic, and we really only need 2-3 widgets to approximate the full set of supported widgets without much of an effort.

For instance, there are a number of hard-coded widgets, such as the airport-list, waypoint.list or the property browser - under the hood however, all of these end up just being combo/select boxes with items that respond to clicks - the screenshow below is using the pui2/canvas "combo-workaround" (shown above) to simply turn the airport-list logic into a crude property-browser equivalent:

Image

Also note that these screenshots don't just show "static" buttons, but instead use the corresponding Nasal APIs to dynamically populate the ScrollArea with the proper widgets.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Development

Who is online

Users browsing this forum: No registered users and 8 guests