Пример #1
0
/**
 * \brief Save the animation without asking anything.
 */
bool bf::main_frame::effective_save()
{
  bool result = m_animation_edit->validate();

  if (result)
    {
      std::string std_path( wx_to_std_string(m_animation_file) );
      std::ofstream f( std_path.c_str() );

      if (f)
        {
          animation_file_xml_writer writer;

          writer.save( f, m_animation_edit->get_value() );
          m_last_saved_animation = m_animation_edit->get_value();
          result = true;
          make_title();
        }
      else
        {
          wxMessageDialog dlg
            ( this, _("Can't open the animation file."), _("Error"), wxOK );

          dlg.ShowModal();
        }
    }

  return result;
} // main_frame::effective_save()
Пример #2
0
void DispValue::plot() const
{
    int ndim = can_plot();
    if (ndim == 0)
	return;

    if (plotter() == 0)
    {
	string title = make_title(full_name());
	MUTABLE_THIS(DispValue *)->_plotter = new_plotter(title, CONST_CAST(DispValue *,this));
	if (plotter() == 0)
	    return;

	plotter()->addHandler(Died, PlotterDiedHP, (void *)this);
    }
Пример #3
0
/**
 * \brief Load an animation.
 * \param path The path to the animation to load.
 */
void bf::main_frame::load_animation( const wxString& path )
{
  wxLogNull no_log;
  wxXmlDocument doc;
  animation_file_xml_reader reader;
  animation anim;

  if ( doc.Load(path) )
    anim = reader.load( doc.GetRoot(), m_workspace );

  m_animation_edit->set_value(anim);
  m_last_saved_animation = m_animation_edit->get_value();
  m_animation_file = path;
  make_title();
} // main_frame::load_animation()
Пример #4
0
void re_title()
{
 char bob[40];
 make_title(bob);
 title_text(bob);
}