<?php 

$tab_index = "";
  
function create_label( $label,
                       $label_Conf )
{
  writeTO( '    <label id="' . $label . '_caption">' );
  writeTO( '      ' . $label_Conf['texto'] );
  writeTO( '    </label>' );
}// End create_label()


function create_label_css( $label,
                           $label_Global,
                           $label_Conf)
{
  global $projeto,
         $esquema,
         $modo_RAD;
         
  if( $modo_RAD )
  {
    $visible = 'inherit';
  }else
  {
    $visible = ( $label_Global['visibility'] == 'true' ) ? 'inherit':'hidden';
  }// End
    
  if( $label_Conf['font_family'] )
  {
    $font_family = $esquema[$projeto['esquema']]['FontFamily'];
  }else
  {
    $font_family = $label_Conf['font_family'];
  }// End if( $label_Conf['font_family'] )

  if( $label_Conf['font_size'] == 'auto' )
  {
    $font_size = $esquema[$projeto['esquema']]['FontSize'];
  }else
  {
    $font_size = $label_Conf['font_size'];
  }// End if( $label_Conf['font_size'] == 'auto' )
  
  if( $label_Conf['font_color'] == 'auto' )
  {
    $font_color = $esquema[$projeto['esquema']]['WindowText'];
  }else
  {
    $font_color = '#' . $label_Conf['font_color'];
  }// End if( $label_Conf['font_color'] == 'auto' )
  
  if( $label_Conf['back_ground'] == 'auto' )
  {
    $bg_color = $esquema[$projeto['esquema']]['ThreeDFace'];
  }else
  {
    $bg_color = $label_Conf['back_ground'];
  }// End if( $label_Conf['back_ground'] == 'auto' )

  if( $label_Conf['bold'] == 'true' )
  {
    $bold = 'bold';
  }else
  {
    $bold = 'normal';
  }// End if( $label_Conf['back_ground'] == 'auto' )

  writeTO( '  #' . $label . '{ '                                   );
  writeTO( '  position:absolute;'                                  );
  writeTO( '  top:'  . $label_Global['top'] . 'px;'                );
  writeTO( '  left:' . $label_Global['left'] . 'px;'               );
  writeTO( '  '                                                    );
  writeTO( '  z-index:10;'                                         );
  writeTO( '  '                                                    );
  writeTO( '  width:'  . $label_Global['width'] . 'px;'            );
  writeTO( '  height:' . $label_Global['height'] . 'px;'           );
  writeTO( '  '                                                    );
  writeTO( '  color:' . $font_color . ';'                          );
  writeTO( '  background-color:' . $bg_color . ';'                 );
  writeTO( '  '                                                    );
  writeTO( '  font-family:' . $font_family . ';'                   );
  writeTO( '  font-size:'   . $font_size   .  'px;'                );
  writeTO( '  font-weight:'   . $bold   .       ';'                );
  writeTO( '  '                                                    );
  writeTO( '  visibility:' . $visible .  ';'                       );
  writeTO( '  '                                                    );
  writeTO( '  }'                                                   );

} 

function create_label_config( $modo_RAD )
{
 global $componentes_no_Prj;

  $comp_no_Prj = $componentes_no_Prj;
  $path  = ( $modo_RAD )? _CFG_ : CFG;
  $nDest = $path . "label.config.js.php";

  $fp = @fopen( $nDest, 'wb' );
  foreach( $comp_no_Prj as $comp_ => $obj_ )
  {
    if( $comp_ == 'label' )
    {
      $nrObj  = 0;
      $arrObj = array();
      $arrSub = array();

      foreach( $obj_ as $i_ => $v_ )
      {
        $arrObj[ $nrObj ] = $i_;
        $nrObj ++;
      }// End foreach()

      writeTO( "label_obj = ". $nrObj .";", $fp );
    }// End if()

  }// End foreach()
  fclose( $fp );

  return( $nDest );
}// End function()

?> 
