-}
-
-// 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 )
-{
- 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 );
- }
+ char label_buffer[80];
+ int posincr;
+ int lenstr;
+ RECT scrn_rect = get_location();
+
+ memset( label_buffer, 0, sizeof( label_buffer));
+ if (data_available()) {
+ if (lat)
+ snprintf(label_buffer, sizeof( label_buffer)-1, format_buffer.c_str(), lat_node->getStringValue());
+ else if (lon)
+ snprintf(label_buffer, sizeof( label_buffer)-1, format_buffer.c_str(), lon_node->getStringValue());
+ else {
+ if (lbox) {// Box for label
+ float x = scrn_rect.left;
+ float y = scrn_rect.top;
+ float w = scrn_rect.right;
+ float h = HUD_TextSize;
+
+ glPushMatrix();
+ glLoadIdentity();
+
+ glBegin(GL_LINES);
+ glVertex2f(x - 2.0, y - 2.0);
+ glVertex2f(x + w + 2.0, y - 2.0);
+ glVertex2f(x + w + 2.0, y + h + 2.0);
+ glVertex2f(x - 2.0, y + h + 2.0);
+ glEnd();
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple(1, 0xAAAA);
+
+ glBegin(GL_LINES);
+ glVertex2f(x + w + 2.0, y - 2.0);
+ glVertex2f(x + w + 2.0, y + h + 2.0);
+ glVertex2f(x - 2.0, y + h + 2.0);
+ glVertex2f(x - 2.0, y - 2.0);
+ glEnd();
+
+ glDisable(GL_LINE_STIPPLE);
+ glPopMatrix();
+ }
+ snprintf(label_buffer, sizeof(label_buffer)-1, format_buffer.c_str(), get_value() * data_scaling());
+ }
+
+ } else {
+ snprintf(label_buffer, sizeof( label_buffer)-1, format_buffer.c_str(), 0);