Beispiel #1
0
bool TextDialog::evaluate() {
  if( m_Props == NULL )
    return false;

  iONode model  = wxGetApp().getModel();
  iONode txlist = wPlan.gettxlist( model );

  if( existID( this, txlist, m_Props, m_ID->GetValue() ) ) {
    m_ID->SetValue( wxString(wItem.getid( m_Props ),wxConvUTF8) );
    return false;
  }

  // General
  wItem.setprev_id( m_Props, wItem.getid(m_Props) );
  wText.setid( m_Props, m_ID->GetValue().mb_str(wxConvUTF8) );
  wText.settext( m_Props, m_Text->GetValue().mb_str(wxConvUTF8) );
  wText.setdesc( m_Props, m_Tip->GetValue().mb_str(wxConvUTF8) );
  wText.setpointsize( m_Props, atoi( m_Pointsize->GetValue().mb_str(wxConvUTF8) ) );

  wText.setbold( m_Props, m_Bold->IsChecked()?True:False );
  wText.setunderlined( m_Props, m_Underlined->IsChecked()?True:False );
  wText.setborder( m_Props, m_Border->IsChecked()?True:False );
  wText.setitalic( m_Props, m_Italic->IsChecked()?True:False );
  wText.settransparent( m_Props, m_Transparent->IsChecked()?True:False );
  wText.setmanualinput( m_Props, m_Input->IsChecked()?True:False );
  wText.setreset( m_Props, m_Reset->IsChecked()?True:False );
  wText.setclock( m_Props, m_Clock->IsChecked() ? True:False );

  if( m_Ori->GetSelection() == 0 )
    wText.setori(m_Props, wItem.west );
  else if( m_Ori->GetSelection() == 1 )
    wText.setori(m_Props, wItem.north );
  else if( m_Ori->GetSelection() == 2 )
    wText.setori(m_Props, wItem.south );

  // Interface
  wText.setiid( m_Props, m_IID->GetValue().mb_str(wxConvUTF8) );
  wText.setbus( m_Props, atoi(m_Bus->GetValue().mb_str(wxConvUTF8)) );
  wText.setaddr( m_Props, m_Address->GetValue() );
  wText.setdisplay( m_Props, m_Display->GetValue() );

  // Location
  wText.setx( m_Props, atoi( m_x->GetValue().mb_str(wxConvUTF8) ) );
  wText.sety( m_Props, atoi( m_y->GetValue().mb_str(wxConvUTF8) ) );
  wText.setz( m_Props, atoi( m_z->GetValue().mb_str(wxConvUTF8) ) );
  wText.setcx( m_Props, atoi( m_Cx->GetValue().mb_str(wxConvUTF8) ) );
  wText.setcy( m_Props, atoi( m_Cy->GetValue().mb_str(wxConvUTF8) ) );

  return true;
}
Beispiel #2
0
bool TrackDialog::evaluate() {
  if( m_Props == NULL )
    return false;

  iONode model  = wxGetApp().getModel();
  iONode tklist = wPlan.gettklist( model );

  if( existID( this, tklist, m_Props, m_ID->GetValue() ) ) {
    m_ID->SetValue( wxString(wItem.getid( m_Props ),wxConvUTF8) );
    return false;
  }


  // General
  wItem.setprev_id( m_Props, wItem.getid(m_Props) );
  wTrack.setid( m_Props, m_ID->GetValue().mb_str(wxConvUTF8) );
  wTrack.setblockid( m_Props, m_BlockID->GetStringSelection().mb_str(wxConvUTF8) );
  wTrack.settype( m_Props, m_Type->GetStringSelection().mb_str(wxConvUTF8) );
  wItem.setroad( m_Props, m_Road->IsChecked()?True:False );
  wItem.setrouteids( m_Props, m_RouteIDs->GetValue().mb_str(wxConvUTF8) );
  wTrack.settknr( m_Props, m_TrackNr->GetValue());

  // Location
  wTrack.setx( m_Props, atoi( m_x->GetValue().mb_str(wxConvUTF8) ) );
  wTrack.sety( m_Props, atoi( m_y->GetValue().mb_str(wxConvUTF8) ) );
  wTrack.setz( m_Props, atoi( m_z->GetValue().mb_str(wxConvUTF8) ) );
  int ori = m_ori->GetSelection();
  if( ori == 0 )
    wTrack.setori( m_Props, wItem.north );
  else if( ori == 1 )
    wTrack.setori( m_Props, wItem.east );
  else if( ori == 2 )
    wTrack.setori( m_Props, wItem.south );
  else if( ori == 3 )
    wTrack.setori( m_Props, wItem.west );

  return true;
}