-//======================= Top of instr_label class =========================
-instr_label ::
- instr_label( int x,
- int y,
- UINT width,
- UINT height,
- FLTFNPTR data_source,
- const char *label_format,
- const char *pre_label_string,
- const char *post_label_string,
- float scale_data,
- UINT options,
- fgLabelJust justification,
- int font_size,
- int blinking,
- bool latitude,
- bool longitude,
- bool label_box,//hud
- bool working,
- int digit): //suma
- instr_item( x, y, width, height,
- data_source,scale_data,options, working, digit), //suma
- pformat ( label_format ),
- pre_str ( pre_label_string ),
- post_str ( post_label_string ),
- justify ( justification ),
- fontSize ( font_size ),
- blink ( blinking ),
- lat ( latitude ),
- lon ( longitude ),
- lbox ( label_box ) //hud
-
-{
- if( pre_str != NULL) {
- if( post_str != NULL ) {
- sprintf( format_buffer, "%s%s%s", pre_str, pformat, post_str );
- }
- else {
- sprintf( format_buffer, "%s%s", pre_str, pformat );
- }
- }
- else {
- if( post_str != NULL ) {
- sprintf( format_buffer, "%s%s", pformat, post_str );
- }
- } // else do nothing if both pre and post strings are nulls. Interesting.
-
-}
-
-// I put this in to make it easy to construct a class member using the current
-// C code.
-
-
-instr_label :: ~instr_label()
+FLTFNPTR get_func(const char *name); // FIXME
+
+instr_label::instr_label(const SGPropertyNode *node) :
+ instr_item(
+ node->getIntValue("x"),
+ node->getIntValue("y"),
+ node->getIntValue("width"),
+ node->getIntValue("height"),
+ NULL /* node->getStringValue("data_source") */, // FIXME
+ node->getFloatValue("scale_data"),
+ node->getIntValue("options"),
+ node->getBoolValue("working", true),
+ node->getIntValue("digits")),
+ pformat(node->getStringValue("label_format")),
+ fontSize(fgGetInt("/sim/startup/xsize") > 1000 ? HUD_FONT_LARGE : HUD_FONT_SMALL), // FIXME
+ blink(node->getIntValue("blinking")),
+ lat(node->getBoolValue("latitude", false)),
+ lon(node->getBoolValue("longitude", false)),
+ lbox(node->getBoolValue("label_box", false)),
+ lon_node(fgGetNode("/position/longitude-string", true)),
+ lat_node(fgGetNode("/position/latitude-string", true))