~cypheon/elfelli

78cf533053916b0a631b1f382aecd2f5e040c651 — Johann Rudloff 14 years ago 11666b8
Made toolbar detachable, added tooltips.
6 files changed, 175 insertions(+), 42 deletions(-)

M po/de.po
M po/elfelli.pot
M src/Application.cpp
M src/SConscript
A src/Toolbox.cpp
A src/Toolbox.h
M po/de.po => po/de.po +38 -18
@@ 8,7 8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: elfelli 01\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-02-04 16:04+0100\n"
"POT-Creation-Date: 2007-02-04 20:39+0100\n"
"PO-Revision-Date: 2006-11-07 20:30+0100\n"
"Last-Translator: Johann Rudloff <cypheon@gmx.net>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"


@@ 17,11 17,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: src/Application.cpp:163 src/Application.cpp:368
#: src/Application.cpp:171 src/Application.cpp:376
msgid "Elfelli XML (*.elfelli)"
msgstr "Elfelli-XML (*.elfelli)"

#: src/Application.cpp:239
#: src/Application.cpp:247
msgid ""
"This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"


@@ 33,7 33,7 @@ msgstr ""
"öffentlicht, weitergeben und/oder modifizieren; entweder gemäß Version 2\n"
"der Lizenz, oder (nach Ihrem Ermessen) gemäß jeder späteren Version.\n"

#: src/Application.cpp:244
#: src/Application.cpp:252
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"


@@ 45,7 45,7 @@ msgstr ""
"die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN\n"
"BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.\n"

#: src/Application.cpp:249
#: src/Application.cpp:257
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program; if not, write to the Free Software\n"


@@ 57,54 57,74 @@ msgstr ""
"Free Software Foundation, Inc.\n"
"51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.\n"

#: src/Application.cpp:285
#: src/Application.cpp:293
msgid "Export _PNG"
msgstr "_PNG exportieren"

#: src/Application.cpp:291
#: src/Application.cpp:299
msgid "Export S_VG"
msgstr "S_VG exportieren"

#: src/Application.cpp:298
#: src/Application.cpp:306
msgid "Negative body"
msgstr "Negativer Körper"

#: src/Application.cpp:305
#: src/Application.cpp:313
msgid "Positive body"
msgstr "Positiver Körper"

#: src/Application.cpp:312
#: src/Application.cpp:320
msgid "Negative plate"
msgstr "Negative Platte"

#: src/Application.cpp:319
#: src/Application.cpp:327
msgid "Positive plate"
msgstr "Positive Platte"

#: src/Application.cpp:333
#: src/Application.cpp:341
msgid "_Scene"
msgstr "_Szene"

#: src/Application.cpp:341
#: src/Application.cpp:349
msgid "E_dit"
msgstr "_Bearbeiten"

#: src/Application.cpp:348
#: src/Application.cpp:350
msgid "Remove all objects"
msgstr "Alle Objekte entfernen"

#: src/Application.cpp:351
msgid "Add new negative body"
msgstr "Neuen negativen Körper hinzufügen"

#: src/Application.cpp:352
msgid "Add new positive body"
msgstr "Neuen positiven Körper hinzufügen"

#: src/Application.cpp:353
msgid "Add new negative plate"
msgstr "Neue negative Platte hinzufügen"

#: src/Application.cpp:354
msgid "Add new positive plate"
msgstr "Neue positive Platte hinzufügen"

#: src/Application.cpp:356
msgid "_Help"
msgstr "_Hilfe"

#: src/Application.cpp:365
#: src/Application.cpp:373
msgid "Export PNG"
msgstr "PNG exportieren"

#: src/Application.cpp:371
#: src/Application.cpp:379
msgid "All files"
msgstr "Alle Dateien"

#: src/Application.cpp:374
#: src/Application.cpp:382
msgid "Save scene"
msgstr "Szene speichern"

#: src/Application.cpp:382
#: src/Application.cpp:390
msgid "Open scene"
msgstr "Szene öffnen"

M po/elfelli.pot => po/elfelli.pot +38 -18
@@ 8,7 8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-02-04 16:06+0100\n"
"POT-Creation-Date: 2007-02-04 20:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"


@@ 16,11 16,11 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/Application.cpp:163 src/Application.cpp:368
#: src/Application.cpp:171 src/Application.cpp:376
msgid "Elfelli XML (*.elfelli)"
msgstr ""

#: src/Application.cpp:239
#: src/Application.cpp:247
msgid ""
"This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"


@@ 28,7 28,7 @@ msgid ""
"at your option) any later version.\n"
msgstr ""

#: src/Application.cpp:244
#: src/Application.cpp:252
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"


@@ 36,7 36,7 @@ msgid ""
"GNU General Public License for more details.\n"
msgstr ""

#: src/Application.cpp:249
#: src/Application.cpp:257
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program; if not, write to the Free Software\n"


@@ 44,54 44,74 @@ msgid ""
"USA\n"
msgstr ""

#: src/Application.cpp:285
#: src/Application.cpp:293
msgid "Export _PNG"
msgstr ""

#: src/Application.cpp:291
#: src/Application.cpp:299
msgid "Export S_VG"
msgstr ""

#: src/Application.cpp:298
#: src/Application.cpp:306
msgid "Negative body"
msgstr ""

#: src/Application.cpp:305
#: src/Application.cpp:313
msgid "Positive body"
msgstr ""

#: src/Application.cpp:312
#: src/Application.cpp:320
msgid "Negative plate"
msgstr ""

#: src/Application.cpp:319
#: src/Application.cpp:327
msgid "Positive plate"
msgstr ""

#: src/Application.cpp:333
#: src/Application.cpp:341
msgid "_Scene"
msgstr ""

#: src/Application.cpp:341
#: src/Application.cpp:349
msgid "E_dit"
msgstr ""

#: src/Application.cpp:348
#: src/Application.cpp:350
msgid "Remove all objects"
msgstr ""

#: src/Application.cpp:351
msgid "Add new negative body"
msgstr ""

#: src/Application.cpp:352
msgid "Add new positive body"
msgstr ""

#: src/Application.cpp:353
msgid "Add new negative plate"
msgstr ""

#: src/Application.cpp:354
msgid "Add new positive plate"
msgstr ""

#: src/Application.cpp:356
msgid "_Help"
msgstr ""

#: src/Application.cpp:365
#: src/Application.cpp:373
msgid "Export PNG"
msgstr ""

#: src/Application.cpp:371
#: src/Application.cpp:379
msgid "All files"
msgstr ""

#: src/Application.cpp:374
#: src/Application.cpp:382
msgid "Save scene"
msgstr ""

#: src/Application.cpp:382
#: src/Application.cpp:390
msgid "Open scene"
msgstr ""

M src/Application.cpp => src/Application.cpp +10 -6
@@ 19,6 19,7 @@

#include "Application.h"
#include "Simulation.h"
#include "Toolbox.h"
#include "XmlLoader.h"
#include "XmlWriter.h"



@@ 346,11 347,11 @@ bool Application::setup_ui_actions()
  action_group->add( Action::create("Quit", Stock::QUIT) , sigc::mem_fun(*this, &Application::quit));

  action_group->add( Action::create("MenuEdit", _("E_dit")) );
  action_group->add( Action::create("Clear", Stock::CLEAR) , sigc::mem_fun(*this, &Application::reset_simulation));
  action_group->add( Action::create("AddNegative", Stock::ADD_NEGATIVE) , sigc::mem_fun(*this, &Application::on_add_negative_body_clicked));
  action_group->add( Action::create("AddPositive", Stock::ADD_POSITIVE) , sigc::mem_fun(*this, &Application::on_add_positive_body_clicked));
  action_group->add( Action::create("AddNegativePlate", Stock::ADD_NEGATIVE_PLATE) , sigc::mem_fun(*this, &Application::on_add_negative_plate_clicked));
  action_group->add( Action::create("AddPositivePlate", Stock::ADD_POSITIVE_PLATE) , sigc::mem_fun(*this, &Application::on_add_positive_plate_clicked));
  action_group->add( Action::create("Clear", Stock::CLEAR, "", _("Remove all objects")) , sigc::mem_fun(*this, &Application::reset_simulation));
  action_group->add( Action::create("AddNegative", Stock::ADD_NEGATIVE, "", _("Add new negative body")) , sigc::mem_fun(*this, &Application::on_add_negative_body_clicked));
  action_group->add( Action::create("AddPositive", Stock::ADD_POSITIVE, "", _("Add new positive body")) , sigc::mem_fun(*this, &Application::on_add_positive_body_clicked));
  action_group->add( Action::create("AddNegativePlate", Stock::ADD_NEGATIVE_PLATE, "", _("Add new negative plate")) , sigc::mem_fun(*this, &Application::on_add_negative_plate_clicked));
  action_group->add( Action::create("AddPositivePlate", Stock::ADD_POSITIVE_PLATE, "", _("Add new positive plate")) , sigc::mem_fun(*this, &Application::on_add_positive_plate_clicked));

  action_group->add( Action::create("MenuHelp", _("_Help")) );
  action_group->add( Action::create("About", Stock::ABOUT) , sigc::mem_fun(*this, &Application::on_about_activate));


@@ 405,7 406,10 @@ bool Application::build_gui()
  setup_file_chooser_dialogs();

  vbox1->pack_start(*(ui_manager->get_widget("/MenuBar")), false, false);
  vbox1->pack_start(*(ui_manager->get_widget("/ToolBar")), false, false);

  Gtk::Toolbar *main_toolbar = static_cast<Gtk::Toolbar *>(ui_manager->get_widget("/ToolBar"));
  Toolbox *main_toolbox = manage(new Toolbox(main_toolbar));
  vbox1->pack_start(*main_toolbox, false, false);

  vbox1->pack_start(sim_canvas);
  sim_canvas.set_size_request(640, 480);

M src/SConscript => src/SConscript +1 -0
@@ 6,6 6,7 @@ elfelli_sources = ['Application.cpp',
                   'Canvas.cpp',
                   'Simulation.cpp',
                   'SimulationCanvas.cpp',
                   'Toolbox.cpp',
                   'XmlLoader.cpp',
                   'XmlWriter.cpp',
                   'Main.cpp']

A src/Toolbox.cpp => src/Toolbox.cpp +44 -0
@@ 0,0 1,44 @@
/*
 * Toolbox.cpp
 * Copyright (C) 2007  Johann Rudloff
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "Toolbox.h"

namespace Elfelli
{

Toolbox::Toolbox(Gtk::Toolbar *toolbar)
{
  add(*toolbar);
}

void Toolbox::on_child_attached(Gtk::Widget *child)
{
  Gtk::Toolbar *tb = static_cast<Gtk::Toolbar *>(child);

  tb->set_show_arrow(true);
}

void Toolbox::on_child_detached(Gtk::Widget *child)
{
  Gtk::Toolbar *tb = static_cast<Gtk::Toolbar *>(child);

  tb->set_show_arrow(false);
}

}

A src/Toolbox.h => src/Toolbox.h +44 -0
@@ 0,0 1,44 @@
// -*- C++ -*-
/*
 * Toolbox.h
 * Copyright (C) 2007  Johann Rudloff
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef _TOOLBOX_H_
#define _TOOLBOX_H_

#include <gtkmm.h>

namespace Elfelli
{

class Toolbox : public Gtk::HandleBox
{
public:
  Toolbox(Gtk::Toolbar *toolbar);

protected:
  virtual void on_child_attached(Gtk::Widget *child);
  virtual void on_child_detached(Gtk::Widget *child);

private:

};

}

#endif // _TOOLBOX_H_