-//======================= 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,
- bool working,
- int digit) :
- instr_item( x, y, width, height,
- data_source,scale_data,options, working, digit),
- 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 )
-{
- 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.
-
-}
-
-
-instr_label::~instr_label()
-{
-}
-
-
-// Copy constructor
-instr_label::instr_label(const instr_label & image) :
- instr_item((const instr_item &)image),
- pformat ( image.pformat ),
- pre_str ( image.pre_str ),
- post_str ( image.post_str ),
- blink ( image.blink ),
- lat ( image.lat ),
- lon ( image.lon ),
- lbox ( image.lbox )
-
+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))