[Lemon-commits] ladanyi: r3384 - glemon/branches/akos
Lemon SVN
svn at lemon.cs.elte.hu
Sun Nov 18 02:15:25 CET 2007
Author: ladanyi
Date: Sun Nov 18 02:15:25 2007
New Revision: 3384
Modified:
glemon/branches/akos/design_win.cc
glemon/branches/akos/design_win.h
glemon/branches/akos/eps_win.cc
glemon/branches/akos/eps_win.h
glemon/branches/akos/nbtab.cc
glemon/branches/akos/nbtab.h
Log:
Ported r3208 from trunk.
Modified: glemon/branches/akos/design_win.cc
==============================================================================
--- glemon/branches/akos/design_win.cc (original)
+++ glemon/branches/akos/design_win.cc Sun Nov 18 02:15:25 2007
@@ -16,7 +16,6 @@
*
*/
-#include <nbtab.h>
#include <design_win.h>
bool DesignWin::closeIfEscapeIsPressed(GdkEventKey* e)
@@ -28,11 +27,11 @@
return true;
}
-DesignWin::DesignWin(const std::string& title, double attraction_v, double propulsation_v, int iterations_v, NoteBookTab & mw):mytab(mw)
+DesignWin::DesignWin(const std::string& title, double attraction_v, double propulsation_v, int iterations_v)
{
set_title(title);
- mytab.signal_title_ch().connect(sigc::mem_fun(*this, &DesignWin::set_title));
+ //mytab.signal_title_ch().connect(sigc::mem_fun(*this, &DesignWin::set_title));
signal_key_press_event().connect(sigc::mem_fun(*this, &DesignWin::closeIfEscapeIsPressed));
Modified: glemon/branches/akos/design_win.h
==============================================================================
--- glemon/branches/akos/design_win.h (original)
+++ glemon/branches/akos/design_win.h Sun Nov 18 02:15:25 2007
@@ -19,8 +19,6 @@
#ifndef DESWIN_H
#define DESWIN_H
-class NoteBookTab;
-
#include <all_include.h>
#include <libgnomecanvasmm.h>
#include <libgnomecanvasmm/polygon.h>
@@ -28,9 +26,6 @@
class DesignWin : public Gtk::Window
{
private:
- ///\ref NoteBookTab to that the \ref MapWin belongs to.
- NoteBookTab & mytab;
-
Gtk::SpinButton * attraction;
Gtk::SpinButton * propulsation;
Gtk::SpinButton * iteration;
@@ -54,7 +49,7 @@
///Constructor
///It builds the window.
- DesignWin(const std::string&, double, double, int, NoteBookTab & mw);
+ DesignWin(const std::string&, double, double, int);
sigc::signal<void, double> signal_attraction(){return signal_attraction_ch;};
sigc::signal<void, double> signal_propulsation(){return signal_propulsation_ch;};
Modified: glemon/branches/akos/eps_win.cc
==============================================================================
--- glemon/branches/akos/eps_win.cc (original)
+++ glemon/branches/akos/eps_win.cc Sun Nov 18 02:15:25 2007
@@ -16,7 +16,6 @@
*
*/
-#include <nbtab.h>
#include <eps_win.h>
#include <set>
@@ -29,7 +28,7 @@
return true;
}
-EpsWin::EpsWin(const std::string& title, NoteBookTab & mw):Gtk::Dialog(title, true, true),mytab(mw)
+EpsWin::EpsWin(const std::string& title):Gtk::Dialog(title, true, true)
{
set_default_size(200, 50);
@@ -37,8 +36,6 @@
signal_key_press_event().connect(sigc::mem_fun(*this, &EpsWin::closeIfEscapeIsPressed));
- mytab.signal_title_ch().connect(sigc::mem_fun(*this, &EpsWin::set_title));
-
table=new Gtk::Table(EPS_PROPERTY_NUM, 1, false);
std::vector<std::string> labels;
@@ -76,7 +73,7 @@
bool EpsWin::on_delete_event(GdkEventAny * event)
{
event=event;
- mytab.closeEpsWin();
+ signal_eps_close.emit();
return true;
}
@@ -90,7 +87,7 @@
{
values[i]=options[i]->get_active();
}
- mytab.exportGraphToEPS(values, name.get_text());
+ signal_eps_details.emit(values, name.get_text());
}
on_delete_event(NULL);
}
Modified: glemon/branches/akos/eps_win.h
==============================================================================
--- glemon/branches/akos/eps_win.h (original)
+++ glemon/branches/akos/eps_win.h Sun Nov 18 02:15:25 2007
@@ -19,8 +19,6 @@
#ifndef EPS_WIN_H
#define EPS_WIN_H
-class NoteBookTab;
-
#include <all_include.h>
#include <libgnomecanvasmm.h>
#include <libgnomecanvasmm/polygon.h>
@@ -33,9 +31,6 @@
class EpsWin : public Gtk::Dialog
{
protected:
- ///\ref NoteBookTab to that the \ref EpsWin belongs to.
- NoteBookTab & mytab;
-
///Designing element
Gtk::Table * table;
@@ -63,7 +58,7 @@
///\param eml edgemap list
///\param nml nodemap list
///\param mw the owner \ref NoteBookTab (\ref mytab)
- EpsWin(const std::string& title, NoteBookTab & mw);
+ EpsWin(const std::string& title);
///Deregistrates \ref EpsWin in its \ref NoteBookTab (\ref mytab)
virtual bool on_delete_event(GdkEventAny *);
@@ -79,6 +74,19 @@
///to create EPS
virtual void on_response(int response_id);
+ ///indicates that user is ready to export EPS file
+ sigc::signal<void, std::vector<bool>, std::string > signal_eps_details;
+
+ ///returns \ref signal_eps_details
+ sigc::signal<void, std::vector<bool>, std::string > signal_eps_details_ch(){return signal_eps_details;};
+
+ ///indicates that the windows can be closed
+ sigc::signal<void> signal_eps_close;
+
+ ///returns \ref signal_eps_close
+ sigc::signal<void> signal_eps_close_ch(){return signal_eps_close;};
+
+
};
#endif //EPS_WIN_H
Modified: glemon/branches/akos/nbtab.cc
==============================================================================
--- glemon/branches/akos/nbtab.cc (original)
+++ glemon/branches/akos/nbtab.cc Sun Nov 18 02:15:25 2007
@@ -57,7 +57,7 @@
mapstorage->getNodeMapList(NUM),
mapstorage->getNodeMapList(STR));
}
- signal_title.emit(Glib::filename_display_basename(file));
+ title_changed(Glib::filename_display_basename(file));
}
void NoteBookTab::newFile()
@@ -90,7 +90,7 @@
mapstorage->getNodeMapList(NUM),
mapstorage->getNodeMapList(STR));
}
- signal_title.emit("unsaved file");
+ title_changed("unsaved file");
}
void NoteBookTab::openFile()
@@ -134,7 +134,7 @@
mapstorage->getNodeMapList(NUM),
mapstorage->getNodeMapList(STR));
}
- signal_title.emit(Glib::filename_display_basename(filename));
+ title_changed(Glib::filename_display_basename(filename));
}
}
}
@@ -148,7 +148,7 @@
{
mapstorage->writeToFile(mapstorage->getFileName());
mapstorage->setModified(false);
- signal_title.emit(Glib::filename_display_basename(mapstorage->getFileName()));
+ title_changed(Glib::filename_display_basename(mapstorage->getFileName()));
}
}
@@ -163,7 +163,7 @@
mapstorage->setFileName(filename);
mapstorage->writeToFile(filename);
mapstorage->setModified(false);
- signal_title.emit(Glib::filename_display_basename(filename));
+ title_changed(Glib::filename_display_basename(filename));
}
}
@@ -197,7 +197,7 @@
mapstorage->getNodeMapList(NUM),
mapstorage->getNodeMapList(STR));
}
- signal_title.emit("unsaved file");
+ title_changed("unsaved file");
}
void NoteBookTab::propertyChange(bool itisedge, int prop, std::string mapname)
@@ -261,9 +261,11 @@
{
if(!epswinexists)
{
- epswin=new EpsWin("Export to EPS - "+name, *this);
+ epswin=new EpsWin("Export to EPS - "+name);
epswin->show();
epswinexists=true;
+ epswin->signal_eps_details_ch().connect(sigc::mem_fun(*this, &NoteBookTab::exportGraphToEPS));
+ epswin->signal_eps_close_ch().connect(sigc::mem_fun(*this, &NoteBookTab::closeEpsWin));
}
}
@@ -275,7 +277,7 @@
double attraction, propulsation;
int iterations;
mapstorage->get_design_data(attraction, propulsation, iterations);
- designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations, *this);
+ designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations);
designwin->signal_attraction().connect(sigc::mem_fun(*mapstorage, &MapStorage::set_attraction));
designwin->signal_propulsation().connect(sigc::mem_fun(*mapstorage, &MapStorage::set_propulsation));
@@ -343,3 +345,16 @@
{
mapstorage->exportGraphToEPS(options, filename);
}
+
+void NoteBookTab::title_changed(std::string newtitle)
+{
+ signal_title.emit(newtitle);
+ if(epswinexists)
+ {
+ epswin->set_title(newtitle);
+ }
+ if(designwinexists)
+ {
+ designwin->set_title(newtitle);
+ }
+}
Modified: glemon/branches/akos/nbtab.h
==============================================================================
--- glemon/branches/akos/nbtab.h (original)
+++ glemon/branches/akos/nbtab.h Sun Nov 18 02:15:25 2007
@@ -234,6 +234,9 @@
void active_maps_needed();
private:
+ ///Called when title of tab has changed
+ void title_changed(std::string);
+
///Signal connection from \ref MapStorage to \ref MapWin
///If \ref MapWin is closed this connection has to be disconnected,
More information about the Lemon-commits
mailing list