That's the sort of stuff that's defined by the GUI library used by FlightGear:
PLIB's PUI.
In the description of each widget class below, there is a small screenshot of one example of that widget. You can see the code used to generate those screenshots in the PLIB example program widget_list.cxx. However, by changing the rendering style, you can make them look considerably different from this.
When the widget is drawn, the application has control of the drawing style and the colours in which the widget is drawn. Reasonable defaults are provided by PUI if you don't set them:
void puObject::setStyle ( int style ) ;
int puObject::getStyle ( void ) const ;
'style' is one of:
PUSTYLE_NONE
PUSTYLE_PLAIN
PUSTYLE_SHADED -- This is the Default.
PUSTYLE_SMALL_SHADED
PUSTYLE_BEVELLED
PUSTYLE_SMALL_BEVELLED
PUSTYLE_BOXED
PUSTYLE_SPECIAL_UNDERLINED
PUSTYLE_DROPSHADOW
PUSTYLE_RADIO
The various styles are interpreted as follows:
PUSTYLE_NONE - No background is drawn for the widget - just the legend and the label.
PUSTYLE_PLAIN - Just a plain solid-coloured rectangle.
PUSTYLE_BEVELLED - The widget is drawn with a three-dimensional-looking bevelled edge around it - with the 'light' shining on it from the top left.
PUSTYLE_SMALL_BEVELLED - Same as for PUSTYLE_BEVELLED but with a smaller border.
PUSTYLE_SHADED - Similar to PUSTYLE_BEVELLED - but with the main rectangle counter-shaded.
PUSTYLE_SMALL_SHADED - Same as for PUSTYLE_SHADED but with a smaller border.
PUSTYLE_BOXED - A simple rectangle with a line around the outside.
PUSTYLE_SPECIAL_UNDERLINED - A simple rectangle drawn with a thin line at the bottom, giving an "underlined" effect like you can see in the puMenuBar and puVerticalMenu widgets.
PUSTYLE_DROPSHADOW - A simple rectangle - but drawn with a shadow below and to the right to make it look like it has been raised off of the page.
PUSTYLE_RADIO - The bounding rectangle and the legend text isn't drawn at all - the widget is drawn as a small diamond shape which is filled in when the object has a non-zero value. This is only useful for puButton widgets.
In case of PUSTYLE_BOXED and PUSTYLE_SPECIAL_UNDERLINED, you can alter the thickness of the border around the widget / the width of the line at the bottom of the widget or retrieve the current value:
void puObject::setBorderThickness ( int t ) ;
int puObject::getBorderThickness ( void ) const ;
You should be careful to call the "setBorderThickness" routine after you have specified the widget style. The "setStyle" function sets the border thickness automatically and will overwrite any previous border thickness you may have set.
By default, a border thickness of two pixels is used in PUSTYLE_BOXED. For PUSTYLE_SPECIAL_UNDERLINED, a one pixel wide line is drawn.
In addition, you can use the negation of the style to swap the appearance of the selected and deselected versions of an object. Hence, using a style of -PUSTYLE_BEVELLED will produce a widget that appears to be pressed in when its value is zero and popped out when it's value is non-zero.
While most widgets default to a style of PUSTYLE_SHADED, some of the more complex types such as sliders and menus pick more complex defaults in order to look 'reasonable'. You can still override those defaults - but the results can often be less than desirable.
void puObject::setColour ( int which, float r, float g, float b, float a = 1.0f ) ;
void puObject::getColour ( int which, float *r, float *g, float *b, float *a = NULL ) const ;
'which' is one of:
PUCOL_FOREGROUND
PUCOL_BACKGROUND
PUCOL_HIGHLIGHT
PUCOL_LABEL
PUCOL_LEGEND
PUCOL_MISC
Here is a description of each colour's meaning:
PUCOL_FOREGROUND, PUCOL_BACKGROUND, PUCOL_HIGHLIGHT - Depending on the style which you have set, these colours are used for different purposes while drawing the widget's ABOX.
PUCOL_LABEL - Obviously, this is the colour which is used when drawing the label of a widget.
PUCOL_LEGEND - The colour that is used when the legend string is drawn. For the puInput, puLargeInput and puListBox classes, which don't have a legend, PUCOL_LEGEND is the colour of other kind of text inside the widget.
PUCOL_MISC - This colour is used for miscellaneous things in some classes. Currently, it indicates the colour of the arrow inside a puArrowButton, and it is used while drawing the circle that is inscribed in a puDial or the text cursor in the puInput and puLargeInput widgets.
Picking all of the individual colours for each widget can be tedious, so there is a handy function that sets a 'theme' colour for the widget and then picks suitable colours near to that theme for the other colours of the widget. This function works well enough that you will almost never need to set the colours individually.
void puObject::setColourScheme ( float r, float g, float b, float a = 1.0f ) ;
Please note that these routines only affect the appearance of the widget itself in case of classes that contain subwidgets and are not menu widgets (currently puFileSelector, puLargeInput, puComboBox, puSelectBox and the obsolete puFilePicker class).
However, these classes are all derived directly or indirectly from puGroup, and thus you can use the appropriate puGroup functions in order to change the styles, colours or border thicknesses of the subwidgets.
In addition to the pre-defined styles, PUI allows you to create your own drawing function and save the related drawing data. This is done by means of the "render data" and "render callback." A render callback is a user-defined function that has the following definition:
typedef void (*puRenderCallback)(class puObject *, int dx, int dy, void *) ;
The function takes four parameters: a pointer to the object whose render callback this is, the x- and y-coordinates of the lower left-hand of the widget, and a pointer to your render data. The user tells PUI to use his rendering callback instead of the usual drawing function by invoking the following function:
void puObject::setRenderCallback ( puRenderCallback *c, void *d = NULL ) ;
The two arguments are the name of the render callback and an optional pointer to the user-defined render data. If a render callback exists, the widget's draw function renders only the activity box (unless PUSTYLE_NONE is used) and the label (if you specified one) and calls the render callback afterwards instead of executing the code which would normally be used to draw the widget.
PUI also has functions to allow the user to retrieve and invoke the render callback:
puRenderCallback puObject::getRenderCallback ( void ) const ;
void *puObject::getRenderCallbackData ( void ) const ;
void puObject::invokeRenderCallback ( int dx, int dy ) ;