Exemplo n.º 1
0
void WeatherDlg::onDeleteWeather( wxCommandEvent& event ) {
  if( m_Props == NULL )
    return;

  int action = wxMessageDialog( this, wxGetApp().getMsg("removewarning"), _T("Rocrail"), wxYES_NO | wxICON_EXCLAMATION ).ShowModal();
  if( action == wxID_NO )
    return;

  wxGetApp().pushUndoItem( (iONode)NodeOp.base.clone( m_Props ) );
  /* Notify RocRail. */
  iONode cmd = NodeOp.inst( wModelCmd.name(), NULL, ELEMENT_NODE );
  wModelCmd.setcmd( cmd, wModelCmd.remove );
  NodeOp.addChild( cmd, (iONode)m_Props->base.clone( m_Props ) );
  wxGetApp().sendToRocrail( cmd );
  cmd->base.del(cmd);

  iONode model = wxGetApp().getModel();
  if( model != NULL ) {
    iONode weatherlist = wPlan.getweatherlist( model );
    if( weatherlist != NULL ) {
      NodeOp.removeChild( weatherlist, m_Props );
      m_Props = NULL;
      m_RGBWPanel->setWeather(m_Props, m_SelectedRow, m_ColorWhite->IsChecked(), m_ColorBrightness->IsChecked(), m_ColorSaturation->IsChecked(), m_ColorWhite2->IsChecked());

    }
  }
  initIndex();
}
Exemplo n.º 2
0
BlockGroupingDialog::BlockGroupingDialog( wxWindow* parent, iONode props, bool save )
{
  m_TabAlign = wxGetApp().getTabAlign();
  m_CondSel = wxNOT_FOUND;
  Create(parent, -1, wxGetApp().getMsg("blockgrouptable") );
  m_Props = props;
  m_bSave = save;
  initLabels();

  initIndex();
  if( m_Props != NULL ) {
    initValues();
    //m_Notebook->SetSelection( 1 );
    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_PANEL_LINK_GENERAL );
    wxPostEvent( this, event );
  }

  m_IndexPanel->GetSizer()->Layout();
  m_GeneralPanel->GetSizer()->Layout();
  m_PropertiesPanel->GetSizer()->Layout();
  m_ConditionsPanel->GetSizer()->Layout();
  m_Notebook->Fit();
  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);
}
Exemplo n.º 3
0
ToursDlg::ToursDlg( wxWindow* parent, iONode tour, bool save, const char* startblock )
  :toursdlggen( parent )
{
  m_Props = tour;
  m_bSave = save;
  m_StartBlock = startblock;
  m_StartBlockID->SetValue((startblock==NULL)?_T(""):wxString(startblock,wxConvUTF8));

  initLabels();
  initIndex();
  initScheduleCombo();

  m_IndexPanel->GetSizer()->Layout();
  m_SchedulesPanel->GetSizer()->Layout();

  m_TourBook->Fit();
  m_TourBook->SetSelection(0);

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  m_TourList->SetFocus();

  if( m_Props != NULL ) {
    initValues();
  }

}
Exemplo n.º 4
0
void ToursDlg::onCopy( wxCommandEvent& event ) {
  if( m_Props != NULL ) {
    iONode model = wxGetApp().getModel();
    if( model != NULL ) {
      iONode tourlist = wPlan.gettourlist( model );
      if( tourlist == NULL ) {
        tourlist = NodeOp.inst( wTourList.name(), model, ELEMENT_NODE );
        NodeOp.addChild( model, tourlist );
      }

      if( tourlist != NULL ) {
        iONode tourcopy = (iONode)NodeOp.base.clone( m_Props );
        char* id = StrOp.fmt( "%s (copy)", wTour.getid(tourcopy));
        wTour.setid(tourcopy, id);
        StrOp.free(id);
        if( !BaseDialog::existID( this, tourlist, m_Props, wxString(wTour.getid( tourcopy ),wxConvUTF8) ) ) {
          NodeOp.addChild( tourlist, tourcopy );
          int cnt = NodeOp.getChildCnt( tourlist );
          TraceOp.trc( "tourdlg", TRCLEVEL_INFO, __LINE__, 9999, "copied tour [%s] (cnt=%d)", wTour.getid(tourcopy), cnt );
          initIndex();
        }
        else {
          NodeOp.base.del(tourcopy);
        }
      }

    }
  }

}
Exemplo n.º 5
0
ActionsCtrlDlg::ActionsCtrlDlg( wxWindow* parent, iONode node, const char* states )
{
  Init();
  Create(parent, -1, wxGetApp().getMsg("actionctrl"));

  m_Props = node;
  m_iCursel = wxNOT_FOUND;
  m_iCurCondsel = wxNOT_FOUND;

  initLabels();

  SetTitle(wxGetApp().getMsg("actionctrl") + wxT(": ") + wxString(wItem.getid(m_Props), wxConvUTF8));

  m_ConditionsPanel->Enable(false);

  initIndex(-1);
  initValues();

  m_IndexPanel->GetSizer()->Layout();
  m_ConditionsPanel->GetSizer()->Layout();

  m_Notebook->Fit();

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);
  GetSizer()->Layout();

  if( states != NULL ) {
    iOStrTok tok = StrTokOp.inst(states, ',');
    while( StrTokOp.hasMoreTokens(tok) ) {
      m_State->Append( wxString( StrTokOp.nextToken(tok), wxConvUTF8 ) );
    }
    StrTokOp.base.del(tok);
  }
}
Exemplo n.º 6
0
void AccDecDlg::onDelete( wxCommandEvent& event )
{
    TraceOp.trc( "accdecdlg", TRCLEVEL_INFO, __LINE__, 9999, "Delete" );
    if( m_Props != NULL ) {
        int action = wxMessageDialog( this, wxGetApp().getMsg("removewarning"), _T("Rocrail"), wxYES_NO | wxICON_EXCLAMATION ).ShowModal();
        if( action == wxID_NO )
            return;

        wxGetApp().pushUndoItem( (iONode)NodeOp.base.clone( m_Props ) );

        /* Notify RocRail. */
        iONode cmd = NodeOp.inst( wModelCmd.name(), NULL, ELEMENT_NODE );
        wModelCmd.setcmd( cmd, wModelCmd.remove );
        NodeOp.addChild( cmd, (iONode)m_Props->base.clone( m_Props ) );
        wxGetApp().sendToRocrail( cmd );
        cmd->base.del(cmd);

        iONode model = wxGetApp().getModel();
        if( model != NULL ) {
            iONode declist = wPlan.getdeclist( model );
            if( declist != NULL ) {
                NodeOp.removeChild( declist, m_Props );
                m_Props = selectPrev();
            }
        }

        initIndex();
    }
}
Exemplo n.º 7
0
void StageDlg::onIndexNew( wxCommandEvent& event ) {
  int i = findID("NEW");
  if( i == wxNOT_FOUND ) {
    iONode model = wxGetApp().getModel();
    if( model != NULL ) {
      iONode sblist = wPlan.getsblist( model );
      if( sblist == NULL ) {
        sblist = NodeOp.inst( wStageList.name(), model, ELEMENT_NODE );
        NodeOp.addChild( model, sblist );
      }
      if( sblist != NULL ) {
        iONode stage = NodeOp.inst( wStage.name(), sblist, ELEMENT_NODE );
        NodeOp.addChild( sblist, stage );
        wStage.setid( stage, "NEW" );
        wStage.setx( stage, 0 );
        wStage.sety( stage, 0 );
        wStage.setz( stage, 0 );
        m_Props = stage;
        initValues();
        initIndex();
        setSelection(wStage.getid( stage ));
      }
    }
  }
}
Exemplo n.º 8
0
StageDlg::StageDlg( wxWindow* parent, iONode p_Props ):stagedlggen( parent )
{
  TraceOp.trc( "stagedlg", TRCLEVEL_INFO, __LINE__, 9999, "stagedlg" );
  m_TabAlign = wxGetApp().getTabAlign();
  m_Props = p_Props;
  m_Section = NULL;
  m_SortCol = 0;
  m_SortOrder = true;
  initLabels();

  m_General->GetSizer()->Layout();
  m_Sections->GetSizer()->Layout();

  m_Notebook->Fit();

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  m_Notebook->Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( StageDlg::OnSetPage ), NULL, this );
  m_SetPage = 0;

  if( m_Props != NULL ) {
    initValues();
    m_SetPage = wxGetApp().getFrame()->isAutoMode()?2:1;
  }
  initIndex();

  wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_STAGEBOOK );
  wxPostEvent( m_Notebook, event );

}
Exemplo n.º 9
0
void VariableDlg::onDelete( wxCommandEvent& event )
{
  if( m_Props == NULL )
    return;

  int action = wxMessageDialog( this, wxGetApp().getMsg("removewarning"), _T("Rocrail"), wxYES_NO | wxICON_EXCLAMATION ).ShowModal();
  if( action == wxID_NO )
    return;

  wxGetApp().pushUndoItem( (iONode)NodeOp.base.clone( m_Props ) );
  /* Notify RocRail. */
  iONode cmd = NodeOp.inst( wModelCmd.name(), NULL, ELEMENT_NODE );
  wModelCmd.setcmd( cmd, wModelCmd.remove );
  NodeOp.addChild( cmd, (iONode)m_Props->base.clone( m_Props ) );
  wxGetApp().sendToRocrail( cmd );
  cmd->base.del(cmd);

  iONode model = wxGetApp().getModel();
  if( model != NULL ) {
    iONode varlist = wPlan.getvrlist( model );
    if( varlist != NULL ) {
      NodeOp.removeChild( varlist, m_Props );
      m_Props = NULL;
    }
  }

  initIndex();
}
Exemplo n.º 10
0
void PowerManDlg::onBoosterListColumn( wxListEvent& event ) {
    if( m_SortCol == event.GetColumn() )
        m_bInvertSortOrder = !m_bInvertSortOrder;
    else
        m_bInvertSortOrder = false;
    m_SortCol = event.GetColumn();
    initIndex();
}
Exemplo n.º 11
0
void VariableDlg::onListCol( wxListEvent& event ) {
  if( m_SortCol == event.GetColumn() )
    ms_SortOrder = !ms_SortOrder;
  else
    ms_SortOrder = true;
  m_SortCol = event.GetColumn();
  initIndex();
}
Exemplo n.º 12
0
void StageDlg::onStageColumn( wxListEvent& event ) {
  int sortcol = event.GetColumn();
  if( sortcol == m_SortCol )
    m_SortOrder = !m_SortOrder;
  else
    m_SortOrder = true;
  m_SortCol = sortcol;
  initIndex();
}
Exemplo n.º 13
0
void OperatorDlg::onSetLocation( wxCommandEvent& event )  {
  iONode cmd = NodeOp.inst( wOperator.name(), NULL, ELEMENT_NODE );
  wOperator.setid( cmd, wOperator.getid( m_Props ) );
  wOperator.setcmd( cmd, wLoc.block );
  wOperator.setlocation( cmd, m_Location->GetStringSelection().mb_str(wxConvUTF8) );
  wOperator.setlocation( m_Props, wOperator.getlocation(cmd) );
  wxGetApp().sendToRocrail( cmd );
  cmd->base.del(cmd);
  initIndex();
}
Exemplo n.º 14
0
Arquivo: main.c Projeto: murachue/WING
int main(int argc, char *argv[])
{
	glutInit(&argc, argv);
	options(argc, argv);

	if (mapmode) {
	/* read map data */
		readDigitalMap(MAPDIR "nara.map");
		readMeshData(MAPDIR "nara.mem");
		calcAllAltitude();
	}

	mapwindow = openMapWindow(argv[0]);	/* initialize 3D map window */

	/* 970904 イベントハンドラの設定 */
	glutDisplayFunc(drawScene);
	glutKeyboardFunc(mapKeyFunc);
	glutSpecialFunc(mapSpecialFunc);	/* 特殊キー用 */
	glutMouseFunc(mapMouseFunc);
	glutMotionFunc(mapMotionFunc);

	readdata();			/* read guide data */
	initGuide();			/* initialize the guide */
	initIndex();			/* initialize the index */
	initTOC();			/* initialize the TOC */

/* prepare graphics objects */
	setPartNVec(&compass);
	setPartNVec(&pencursor);

/* texture */
	/* 970904 あとで参考にするかもしれない
	if (!wiremode && !mapmode && texturemode) {
		tevdef(1, 0, tevprops[0]);
		tevbind(TV_ENV0, 1);
		if ((tid = readTexture(texturename, texturemode - 1)) == 0) {
			perror("cannot read texture data\n");
			exit(0);
		}
		texbind(TX_TEXTURE_0, tid);
	}
	*/

	calcLookAtPoint(lookAt, FALSE);
	glutSetWindow(mapwindow);
	glutPostRedisplay();

/* main loop */
	glutMainLoop();
}
Exemplo n.º 15
0
void PowerManDlg::OnAddBooster( wxCommandEvent& event )
{
    int i = findID("NEW");
    if( i == wxNOT_FOUND ) {
        iONode model = wxGetApp().getModel();
        iONode boosterlist = wPlan.getboosterlist( model );
        iONode booster = NodeOp.inst( wBooster.name(), boosterlist, ELEMENT_NODE );
        wBooster.setid(booster, "NEW");
        NodeOp.addChild( boosterlist, booster );

        m_Props = booster;
        initValues();
        initIndex();
        setSelection(wBooster.getid( booster ));
    }
}
Exemplo n.º 16
0
OperatorDlg::OperatorDlg( wxWindow* parent, iONode p_Props, bool save, const char* blockid )
  :operatordlggen( parent )
{
  TraceOp.trc( "opdlg", TRCLEVEL_INFO, __LINE__, 9999, "cardlg" );
  m_TabAlign = wxGetApp().getTabAlign();
  m_Props    = p_Props;
  m_bSave    = save;
  m_CarProps = NULL;
  m_BlockID  = blockid;

  initLabels();

  m_IndexPanel->GetSizer()->Layout();
  m_ControlPanel->GetSizer()->Layout();
  m_ConsistPanel->GetSizer()->Layout();

  m_OperatorBook->Fit();

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  initIndex();

  m_OperatorList->SetFocus();

  m_OperatorBook->Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( OperatorDlg::onSetPage ), NULL, this );
  m_SetPage = 0;

  m_ControlPanel->Enable(false);
  m_ConsistPanel->Enable(false);

  m_StdButtonApply->Enable(m_bSave);

  if( m_Props != NULL ) {
    initValues();
    m_SetPage = 1;
  }
  wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, -1 );
  wxPostEvent( m_OperatorBook, event );

  if( m_BlockID == NULL ) {
    m_ShowAllOperators->SetValue(true);
    m_ShowAllOperators->Enable(false);
  }

}
Exemplo n.º 17
0
void PowerManDlg::OnApply( wxCommandEvent& event )
{
    if( m_Props == NULL )
        return;

    if( !evaluate() )
        return;

    if( !wxGetApp().isStayOffline() ) {
        /* Notify RocRail. */
        iONode cmd = NodeOp.inst( wModelCmd.name(), NULL, ELEMENT_NODE );
        wModelCmd.setcmd( cmd, wModelCmd.modify );
        NodeOp.addChild( cmd, (iONode)m_Props->base.clone( m_Props ) );
        wxGetApp().sendToRocrail( cmd );
        cmd->base.del(cmd);
    }
    initIndex();
}
Exemplo n.º 18
0
void OperatorDlg::onApply( wxCommandEvent& event ) {
  if( m_Props == NULL || !m_bSave )
    return;

  evaluate();
  if( !wxGetApp().isStayOffline() ) {
    /* Notify RocRail. */
    iONode cmd = NodeOp.inst( wModelCmd.name(), NULL, ELEMENT_NODE );
    wModelCmd.setcmd( cmd, wModelCmd.modify );
    NodeOp.addChild( cmd, (iONode)m_Props->base.clone( m_Props ) );
    wxGetApp().sendToRocrail( cmd );
    cmd->base.del(cmd);
  }
  else {
    wxGetApp().setLocalModelModified(true);
  }
  initIndex();
}
Exemplo n.º 19
0
VariableDlg::VariableDlg( wxWindow* parent ):VariableDlgGen( parent )
{
  m_Props = NULL;
  m_SortCol  = 0;

  initLabels();

  m_IndexPanel->GetSizer()->Layout();
  m_GeneralPanel->GetSizer()->Layout();

  m_VarBook->Fit();

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  initIndex();
  m_VarBook->SetSelection(0);

}
Exemplo n.º 20
0
AccDecDlg::AccDecDlg( wxWindow* parent ):AccDecGenDlg( parent )
{
    m_Props = NULL;
    m_Image->SetBitmapLabel( wxBitmap(nopict_xpm) );
    m_Image->Refresh();

    initLabels();
    initCVDesc();

    m_IndexPanel->GetSizer()->Layout();
    m_GeneralPanel->GetSizer()->Layout();

    m_Notebook->Fit();

    GetSizer()->Fit(this);
    GetSizer()->SetSizeHints(this);

    initIndex();
}
Exemplo n.º 21
0
WeatherDlg::WeatherDlg( wxWindow* parent, iONode props ):WeatherDlgGen( parent )
{
  m_PropsList = props;
  m_Props = NULL;
  m_SelectedRow = -1;

  m_RGBWPanel->setListener(this);
  initLabels();


  m_IndexPanel->GetSizer()->Layout();
  m_DayPanel->GetSizer()->Layout();
  m_NightPanel->GetSizer()->Layout();
  m_ThemePanel->GetSizer()->Layout();
  m_ColorPanel->GetSizer()->Layout();

  m_WeatherBook->Fit();

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  initColorGrid();

  initIndex();
  m_WeatherBook->SetSelection(0);

  if( m_IndexList->GetCount() > 0 ) {
    m_IndexList->SetSelection(0);
    m_Props = (iONode)m_IndexList->GetClientData(m_IndexList->GetSelection());
    if( m_Props != NULL ) {
      initValues();
      initThemeIndex();
      m_SelectedRow = wxGetApp().getFrame()->GetHour();
      m_RGBWPanel->setWeather(m_Props, m_SelectedRow*2, m_ColorWhite->IsChecked(), m_ColorBrightness->IsChecked(), m_ColorSaturation->IsChecked(), m_ColorWhite2->IsChecked());
      m_RGBWPanel->setDayTime(m_SelectedRow, 0);
      m_ColorGrid->SelectRow(m_SelectedRow*2);
      m_ColorGrid->MakeCellVisible(m_SelectedRow*2, 0);
    }
  }

}
Exemplo n.º 22
0
Index finalIndex(Index * i) {
	Index finalI ;
	initIndex(&finalI) ; 
		while ((*i) -> ptr_next != NULL) 
		{		
			if ((*i) -> t1.occur < TMAX) 
			{	Cell * ptr_stock = *i ; 
			 	*i = (*i)->ptr_next ;
			 	free(ptr_stock) ; 
			}
		
	 		else 
			{ 	Cell * ptr_stock = *i ;
				addTerm(&finalI, (*i)->t1) ; 
				(*i) = (*i) -> ptr_next ; 
				free(ptr_stock) ; 
			}
		}
	printf("End of final Indexation\n") ; 
	return finalI ;
} 
Exemplo n.º 23
0
void BlockGroupingDialog::OnApplyClick( wxCommandEvent& event )
{
  if( m_Props == NULL )
    return;

  if( !evaluate() )
    return;

  if( !wxGetApp().isStayOffline() ) {
    /* Notify RocRail. */
    iONode cmd = NodeOp.inst( wModelCmd.name(), NULL, ELEMENT_NODE );
    wModelCmd.setcmd( cmd, wModelCmd.modify );
    NodeOp.addChild( cmd, (iONode)m_Props->base.clone( m_Props ) );
    wxGetApp().sendToRocrail( cmd );
    cmd->base.del(cmd);
  }
  else {
    wxGetApp().setLocalModelModified(true);
  }
  initIndex();
}
Exemplo n.º 24
0
TextDialog::TextDialog( wxWindow* parent, iONode p_Props )
{
  m_TabAlign = wxGetApp().getTabAlign();
  Create(parent, -1, wxGetApp().getMsg("text") );
  m_Props = p_Props;
  initLabels();
  initValues();

  m_IndexPanel->GetSizer()->Layout();
  m_GeneralPanel->GetSizer()->Layout();
  m_LocationPanel->GetSizer()->Layout();
  m_InterfacePanel->GetSizer()->Layout();
  m_Notebook->Fit();
  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  if( initIndex() ) {
    initValues();
    m_Notebook->SetSelection( 1 );
  }

}
Exemplo n.º 25
0
void OperatorDlg::onNewOperator( wxCommandEvent& event ) {
  int i = findID("NEW");
  if( i == wxNOT_FOUND ) {
    iONode model = wxGetApp().getModel();
    if( model != NULL ) {
      iONode operatorlist = wPlan.getoperatorlist( model );
      if( operatorlist == NULL ) {
        operatorlist = NodeOp.inst( wOperatorList.name(), model, ELEMENT_NODE );
        NodeOp.addChild( model, operatorlist );
      }
      if( operatorlist != NULL ) {
        iONode op = NodeOp.inst( wOperator.name(), operatorlist, ELEMENT_NODE );
        NodeOp.addChild( operatorlist, op );
        wOperator.setid( op, "NEW" );
        m_Props = op;
        initIndex();
        initValues();
        setSelection(wOperator.getid( op ));
      }
    }
  }
}
Exemplo n.º 26
0
void OperatorDlg::OnCopy( wxCommandEvent& event ){
  if( m_Props != NULL ) {
    iONode model = wxGetApp().getModel();
    if( model != NULL ) {
      iONode operatorlist = wPlan.getoperatorlist( model );
      if( operatorlist == NULL ) {
        operatorlist = NodeOp.inst( wOperatorList.name(), model, ELEMENT_NODE );
        NodeOp.addChild( model, operatorlist );
      }

      if( operatorlist != NULL ) {
        iONode lccopy = (iONode)NodeOp.base.clone( m_Props );
        char* id = StrOp.fmt( "%s (copy)", wOperator.getid(lccopy));
        wOperator.setid(lccopy, id);
        StrOp.free(id);
        NodeOp.addChild( operatorlist, lccopy );
        initIndex();
      }

    }
  }
}
Exemplo n.º 27
0
void AccDecDlg::onApply( wxCommandEvent& event )
{
    TraceOp.trc( "accdecdlg", TRCLEVEL_INFO, __LINE__, 9999, "Apply" );
    if( m_Props == NULL )
        return;

    if( !evaluate() )
        return;

    if( !wxGetApp().isStayOffline() ) {
        /* Notify RocRail. */
        iONode cmd = NodeOp.inst( wModelCmd.name(), NULL, ELEMENT_NODE );
        wModelCmd.setcmd( cmd, wModelCmd.modify );
        NodeOp.addChild( cmd, (iONode)m_Props->base.clone( m_Props ) );
        wxGetApp().sendToRocrail( cmd );
        cmd->base.del(cmd);
    }
    else {
        wxGetApp().setLocalModelModified(true);
    }
    initIndex();
}
Exemplo n.º 28
0
void VariableDlg::onNew( wxCommandEvent& event )
{
  int i = findID("NEW");
  if( i == wxNOT_FOUND ) {
    iONode model = wxGetApp().getModel();
    if( model != NULL ) {
      iONode varlist = wPlan.getvrlist( model );
      if( varlist == NULL ) {
        varlist = NodeOp.inst( wVariableList.name(), model, ELEMENT_NODE );
        NodeOp.addChild( model, varlist );
      }
      if( varlist != NULL ) {
        iONode var = NodeOp.inst( wVariable.name(), varlist, ELEMENT_NODE );
        NodeOp.addChild( varlist, var );
        wVariable.setid( var, "NEW" );
        m_Props = var;
        initValues();
        initIndex();
        setSelection(wVariable.getid( var ));
      }
    }
  }
}
Exemplo n.º 29
0
void PowerManDlg::OnDelBooster( wxCommandEvent& event )
{
    if( m_Props == NULL )
        return;

    int action = wxMessageDialog( this, wxGetApp().getMsg("removewarning"), _T("Rocrail"), wxYES_NO | wxICON_EXCLAMATION ).ShowModal();
    if( action == wxID_NO )
        return;

    wxGetApp().pushUndoItem( (iONode)NodeOp.base.clone( m_Props ) );
    m_ID->SetValue(_T(""));
    m_District->SetValue(_T(""));
    m_GeneralPanel->Enable(false);
    m_ModulesPanel->Enable(false);
    m_BlocksPanel->Enable(false);
    m_DetailsPanel->Enable(false);
    m_ModuleList->Clear();
    m_BlockList->Clear();
    m_ModuleID->SetValue(_T(""));

    /* Notify RocRail. */
    iONode cmd = NodeOp.inst( wModelCmd.name(), NULL, ELEMENT_NODE );
    wModelCmd.setcmd( cmd, wModelCmd.remove );
    NodeOp.addChild( cmd, (iONode)m_Props->base.clone( m_Props ) );
    wxGetApp().sendToRocrail( cmd );
    cmd->base.del(cmd);


    iONode model = wxGetApp().getModel();
    iONode boosterlist = wPlan.getboosterlist( model );

    NodeOp.removeChild( boosterlist, m_Props );
    m_Props = NULL;

    initIndex();
}
Exemplo n.º 30
0
PowerManDlg::PowerManDlg( wxWindow* parent ):powermandlggen( parent )
{
    m_Props = NULL;
    m_SortCol  = 0;
    m_bInvertSortOrder = false;
    initLabels();

    m_IndexPanel->GetSizer()->Layout();
    m_GeneralPanel->GetSizer()->Layout();
    m_ModulesPanel->GetSizer()->Layout();
    m_BlocksPanel->GetSizer()->Layout();
    m_DetailsPanel->GetSizer()->Layout();

    m_BoosterBook->Fit();

    GetSizer()->Fit(this);
    GetSizer()->SetSizeHints(this);

    m_GeneralPanel->Enable(false);
    m_ModulesPanel->Enable(false);
    m_BlocksPanel->Enable(false);
    m_DetailsPanel->Enable(false);

    initIndex();

    // not jet supported
    m_StopDistrictLocos->Enable(false);

    m_BoosterList->SetFocus();

    m_BoosterBook->Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( PowerManDlg::onSetPage ), NULL, this );
    m_SetPage = 0;

    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_BOOSTERBOOK );
    wxPostEvent( m_BoosterBook, event );
}