//---------------------------------------------------------------------------
void __fastcall TConfDlg::Refresh1Click(TObject *Sender)
{
	int index=HostBox->ItemIndex;
    if(index<0) return;
	Servers->Refresh(HostBox->Items->Strings[index].c_str());
    FormActivate(0);
}
void __fastcall TfrmPropVisor::cboAutoOpcionesChange(TObject *Sender)
{
  switch( cboAutoOpciones->ItemIndex )
  {
    case 0: //Trigonometrica
    dsgPrevia->ShowAxeX = true;
    dsgPrevia->ShowAxeY = true;
    dsgPrevia->DirectionAxeX = drLeftToRight;
    dsgPrevia->DirectionAxeY = drBottomToTop;
    dsgPrevia->AxeX->Color = clBlack;
    dsgPrevia->AxeY->Color = clBlack;
    dsgPrevia->FontAxeX->Color = clBlack;
    dsgPrevia->FontAxeY->Color = clBlack;
    //cboEstiloX
    dsgPrevia->AxeX->Width = 1;
    dsgPrevia->AxeY->Width = 1;
    dsgPrevia->ShowPointer = true;
    dsgPrevia->BackGround->Color = clWhite;
    dsgPrevia->ShowLabelsAxeX = true;
    dsgPrevia->ShowLabelsAxeY = true;
    dsgPrevia->LabelsStepX = 3.14159;
    dsgPrevia->LabelsStepY = 1;
    dsgPrevia->AdditionalStringAxeX = " [rad]";
    dsgPrevia->LabelsToTheTopOfAxeX = true;
    dsgPrevia->LabelsToTheRigthOfAxeY = true;
    dsgPrevia->FontLabelX->Color = clBlack;
    dsgPrevia->FontLabelY->Color = clBlack;
    dsgPrevia->ShowMarksAxeX = true;
    dsgPrevia->ShowMarksAxeY = true;
    dsgPrevia->MarksStepX = 3.14159/2;
    dsgPrevia->MarksStepY = 0.5;
    dsgPrevia->MarksLengthAxeX = 8;
    dsgPrevia->MarksLengthAxeY = 8;
    dsgPrevia->ShowGridX = true;
    dsgPrevia->ShowGridY = true;
    dsgPrevia->GridStepX = 3.14159;
    dsgPrevia->GridStepY = 1;
    //cboStyleGridX
    dsgPrevia->GridX->Width = 1;
    dsgPrevia->GridY->Width = 1;
    dsgPrevia->GridX->Color = clSilver;
    dsgPrevia->GridY->Color = clSilver;
    FormActivate(Sender);
    break;
    case 1: //Discreta
    dsgPrevia->ShowAxeX = true;
    dsgPrevia->ShowAxeY = true;
    dsgPrevia->DirectionAxeX = drLeftToRight;
    dsgPrevia->DirectionAxeY = drBottomToTop;
    dsgPrevia->AxeX->Color = clBlack;
    dsgPrevia->AxeY->Color = clBlack;
    dsgPrevia->FontAxeX->Color = clBlack;
    dsgPrevia->FontAxeY->Color = clBlack;
    //cboEstiloX
    dsgPrevia->AxeX->Width = 1;
    dsgPrevia->AxeY->Width = 1;
    dsgPrevia->ShowPointer = true;
    dsgPrevia->BackGround->Color = clSilver;
    dsgPrevia->ShowLabelsAxeX = true;
    dsgPrevia->ShowLabelsAxeY = true;
    dsgPrevia->AdditionalStringAxeX = "";
    dsgPrevia->LabelsStepX = 1;
    dsgPrevia->LabelsStepY = 1;
    dsgPrevia->LabelsToTheTopOfAxeX = true;
    dsgPrevia->LabelsToTheRigthOfAxeY = true;
    dsgPrevia->FontLabelX->Color = clBlack;
    dsgPrevia->FontLabelY->Color = clBlack;
    dsgPrevia->ShowMarksAxeX = true;
    dsgPrevia->ShowMarksAxeY = true;
    dsgPrevia->MarksStepX = 1;
    dsgPrevia->MarksStepY = 1;
    dsgPrevia->MarksLengthAxeX = 8;
    dsgPrevia->MarksLengthAxeY = 8;
    dsgPrevia->ShowGridX = false;
    dsgPrevia->ShowGridY = false;
    dsgPrevia->GridStepX = 1;
    dsgPrevia->GridStepY = 1;
    //cboStyleGridX
    dsgPrevia->GridX->Width = 1;
    dsgPrevia->GridY->Width = 1;
    dsgPrevia->GridX->Color = clSilver;
    dsgPrevia->GridY->Color = clSilver;
    FormActivate(Sender);
    break;
  case 2: //Profesional
    dsgPrevia->ShowAxeX = true;
    dsgPrevia->ShowAxeY = true;
    dsgPrevia->DirectionAxeX = drLeftToRight;
    dsgPrevia->DirectionAxeY = drBottomToTop;
    dsgPrevia->AxeX->Color = clLime;
    dsgPrevia->AxeY->Color = clLime;
    dsgPrevia->FontAxeX->Color = clLime;
    dsgPrevia->FontAxeY->Color = clLime;
    //cboEstiloX
    dsgPrevia->AxeX->Width = 1;
    dsgPrevia->AxeY->Width = 1;
    dsgPrevia->ShowPointer = true;
    dsgPrevia->BackGround->Color = clBlack;
    dsgPrevia->ShowLabelsAxeX = true;
    dsgPrevia->ShowLabelsAxeY = true;
    dsgPrevia->LabelsStepX = 1;
    dsgPrevia->LabelsStepY = 1;
    dsgPrevia->AdditionalStringAxeX = "";
    dsgPrevia->LabelsToTheTopOfAxeX = false;
    dsgPrevia->LabelsToTheRigthOfAxeY = false;
    dsgPrevia->FontLabelX->Color = clSilver;
    dsgPrevia->FontLabelY->Color = clSilver;
    dsgPrevia->ShowMarksAxeX = true;
    dsgPrevia->ShowMarksAxeY = true;
    dsgPrevia->MarksStepX = 0.5;
    dsgPrevia->MarksStepY = 0.5;
    dsgPrevia->MarksLengthAxeX = 5;
    dsgPrevia->MarksLengthAxeY = 5;
    dsgPrevia->ShowGridX = true;
    dsgPrevia->ShowGridY = true;
    dsgPrevia->GridStepX = 2;
    dsgPrevia->GridStepY = 2;
    //cboStyleGridX
    dsgPrevia->GridX->Width = 1;
    dsgPrevia->GridY->Width = 1;
    dsgPrevia->GridX->Color = clSilver;
    dsgPrevia->GridY->Color = clSilver;
    FormActivate(Sender);
    break;
  case 3: //Moderna
    dsgPrevia->ShowAxeX = true;
    dsgPrevia->ShowAxeY = true;
    dsgPrevia->DirectionAxeX = drLeftToRight;
    dsgPrevia->DirectionAxeY = drBottomToTop;
    dsgPrevia->AxeX->Color = clNavy;
    dsgPrevia->AxeY->Color = clNavy;
    dsgPrevia->FontAxeX->Color = clNavy;
    dsgPrevia->FontAxeY->Color = clNavy;
    //cboEstiloX
    dsgPrevia->AxeX->Width = 1;
    dsgPrevia->AxeY->Width = 1;
    dsgPrevia->ShowPointer = true;
    dsgPrevia->BackGround->Color = TColor(0xCB8B64);
    dsgPrevia->ShowLabelsAxeX = true;
    dsgPrevia->ShowLabelsAxeY = true;
    dsgPrevia->LabelsStepX = 0.5;
    dsgPrevia->LabelsStepY = 0.5;
    dsgPrevia->AdditionalStringAxeX = "";
    dsgPrevia->LabelsToTheTopOfAxeX = false;
    dsgPrevia->LabelsToTheRigthOfAxeY = false;
    dsgPrevia->FontLabelX->Color = clBlack;
    dsgPrevia->FontLabelY->Color = clBlack;
    dsgPrevia->ShowMarksAxeX = true;
    dsgPrevia->ShowMarksAxeY = true;
    dsgPrevia->MarksStepX = 1.0/3.0;
    dsgPrevia->MarksStepY = 1.0/3.0;
    dsgPrevia->MarksLengthAxeX = 8;
    dsgPrevia->MarksLengthAxeY = 8;
    dsgPrevia->ShowGridX = true;
    dsgPrevia->ShowGridY = true;
    dsgPrevia->GridStepX = 0.25;
    dsgPrevia->GridStepY = 0.25;
    //cboStyleGridX
    dsgPrevia->GridX->Width = 1;
    dsgPrevia->GridY->Width = 1;
    dsgPrevia->GridX->Color = TColor(0xD9AC91);
    dsgPrevia->GridY->Color = TColor(0xD9AC91);
    FormActivate(Sender);
    break;
  case 4: //Impactante
    dsgPrevia->ShowAxeX = true;
    dsgPrevia->ShowAxeY = true;
    dsgPrevia->DirectionAxeX = drLeftToRight;
    dsgPrevia->DirectionAxeY = drBottomToTop;
    dsgPrevia->AxeX->Color = clRed;
    dsgPrevia->AxeY->Color = clBlue;
    dsgPrevia->FontAxeX->Color = clRed;
    dsgPrevia->FontAxeY->Color = clBlue;
    //cboEstiloX
    dsgPrevia->AxeX->Width = 1;
    dsgPrevia->AxeY->Width = 1;
    dsgPrevia->ShowPointer = true;
    dsgPrevia->BackGround->Color = clBlack;
    dsgPrevia->ShowLabelsAxeX = true;
    dsgPrevia->ShowLabelsAxeY = true;
    dsgPrevia->LabelsStepX = 0.5;
    dsgPrevia->LabelsStepY = 0.5;
    dsgPrevia->AdditionalStringAxeX = "";
    dsgPrevia->LabelsToTheTopOfAxeX = false;
    dsgPrevia->LabelsToTheRigthOfAxeY = false;
    dsgPrevia->FontLabelX->Color = clRed;
    dsgPrevia->FontLabelY->Color = clBlue;
    dsgPrevia->ShowMarksAxeX = true;
    dsgPrevia->ShowMarksAxeY = true;
    dsgPrevia->MarksStepX = 0.25;
    dsgPrevia->MarksStepY = 0.25;
    dsgPrevia->MarksLengthAxeX = 8;
    dsgPrevia->MarksLengthAxeY = 8;
    dsgPrevia->ShowGridX = true;
    dsgPrevia->ShowGridY = true;
    dsgPrevia->GridStepX = 0.5;
    dsgPrevia->GridStepY = 0.5;
    //cboStyleGridX
    dsgPrevia->GridX->Width = 1;
    dsgPrevia->GridY->Width = 1;
    dsgPrevia->GridX->Color = clYellow;
    dsgPrevia->GridY->Color = clYellow;
    FormActivate(Sender);
    break;
  case 5: //Impresión
    dsgPrevia->ShowAxeX = true;
    dsgPrevia->ShowAxeY = true;
    dsgPrevia->DirectionAxeX = drLeftToRight;
    dsgPrevia->DirectionAxeY = drBottomToTop;
    dsgPrevia->AxeX->Color = clBlack;
    dsgPrevia->AxeY->Color = clBlack;
    dsgPrevia->FontAxeX->Color = clBlack;
    dsgPrevia->FontAxeY->Color = clBlack;
    //cboEstiloX
    dsgPrevia->AxeX->Width = 1;
    dsgPrevia->AxeY->Width = 1;
    dsgPrevia->ShowPointer = true;
    dsgPrevia->BackGround->Color = clWhite;
    dsgPrevia->ShowLabelsAxeX = true;
    dsgPrevia->ShowLabelsAxeY = true;
    dsgPrevia->LabelsStepX = 1;
    dsgPrevia->LabelsStepY = 1;
    dsgPrevia->AdditionalStringAxeX = "";
    dsgPrevia->LabelsToTheTopOfAxeX = false;
    dsgPrevia->LabelsToTheRigthOfAxeY = false;
    dsgPrevia->FontLabelX->Color = clBlack;
    dsgPrevia->FontLabelY->Color = clBlack;
    dsgPrevia->ShowMarksAxeX = true;
    dsgPrevia->ShowMarksAxeY = true;
    dsgPrevia->MarksStepX = 0.5;
    dsgPrevia->MarksStepY = 0.5;
    dsgPrevia->MarksLengthAxeX = 8;
    dsgPrevia->MarksLengthAxeY = 8;
    dsgPrevia->ShowGridX = false;
    dsgPrevia->ShowGridY = false;
    dsgPrevia->GridStepX = 1;
    dsgPrevia->GridStepY = 1;
    //cboStyleGridX
    dsgPrevia->GridX->Width = 1;
    dsgPrevia->GridY->Width = 1;
    dsgPrevia->GridX->Color = clSilver;
    dsgPrevia->GridY->Color = clSilver;
    FormActivate(Sender);
    break;
  case 6: //cargar
    if( dlgOpenDSG->Execute() ){
      dsgPrevia->LoadFromFile(dlgOpenDSG->FileName);
      frmMain->Config.DirectorioDsg = ExtractFilePath(dlgOpenDSG->FileName);
      FormActivate(Sender);
    }
    break;
  }
}