Changeset 89:4042761b21e3 in glemon-0.x
- Timestamp:
- 11/21/05 13:07:05 (19 years ago)
- Branch:
- gui
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2368
- Files:
-
- 2 deleted
- 9 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r81 r89 16 16 graph_displayer_canvas.h \ 17 17 graph-displayer.cc \ 18 gdc-broken_edge.cc \ 18 19 main_win.cc \ 19 20 main_win.h \ … … 22 23 map_win.cc \ 23 24 map_win.h \ 24 broken_edge.cc \ 25 broken_edge.h \ 25 mw-mapselector.cc \ 26 26 new_map_win.cc \ 27 27 new_map_win.h \ 28 28 xymap.h \ 29 icons/guipixbufs.h\ 30 mapselector.h\ 31 mapselector.cc 29 icons/guipixbufs.h 32 30 33 31 -
gdc-broken_edge.cc
r80 r89 1 #include " broken_edge.h"1 #include "graph_displayer_canvas.h" 2 2 #include <cmath> 3 3 4 BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p, GraphDisplayerCanvas & gc) : Line(g), gdc(gc), isbutton(false)4 GraphDisplayerCanvas::BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p, GraphDisplayerCanvas & gc) : Line(g), gdc(gc), isbutton(false) 5 5 { 6 6 my_points=new Gnome::Art::Point[3]; … … 8 8 arrow=new Gnome::Canvas::Polygon(g); 9 9 *arrow << Gnome::Canvas::Properties::fill_color("red"); 10 arrow->signal_event().connect(sigc::mem_fun(*this, & BrokenEdge::edgeFormerEventHandler));10 arrow->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::BrokenEdge::edgeFormerEventHandler)); 11 11 arrow->lower_to_bottom(); 12 12 setPoints(p); 13 13 } 14 14 15 BrokenEdge::~BrokenEdge()15 GraphDisplayerCanvas::BrokenEdge::~BrokenEdge() 16 16 { 17 17 if(arrow)delete(arrow); 18 18 } 19 19 20 void BrokenEdge::setPoints(Gnome::Canvas::Points p, bool move)20 void GraphDisplayerCanvas::BrokenEdge::setPoints(Gnome::Canvas::Points p, bool move) 21 21 { 22 22 bool set_arrow=false; … … 156 156 } 157 157 158 bool BrokenEdge::edgeFormerEventHandler(GdkEvent* e)158 bool GraphDisplayerCanvas::BrokenEdge::edgeFormerEventHandler(GdkEvent* e) 159 159 { 160 160 switch(e->type) … … 208 208 } 209 209 210 xy<double> BrokenEdge::getArrowPos()210 xy<double> GraphDisplayerCanvas::BrokenEdge::getArrowPos() 211 211 { 212 212 xy<double> ret_val(my_points[1].get_x(),my_points[1].get_y()); -
graph_displayer_canvas-edge.cc
r81 r89 1 1 #include "graph_displayer_canvas.h" 2 #include "broken_edge.h"3 2 #include <cmath> 4 3 -
graph_displayer_canvas-event.cc
r87 r89 1 1 #include "graph_displayer_canvas.h" 2 #include "broken_edge.h"3 2 #include <cmath> 4 3 -
graph_displayer_canvas-node.cc
r81 r89 1 1 #include "graph_displayer_canvas.h" 2 #include "broken_edge.h"3 2 #include <cmath> 4 3 -
graph_displayer_canvas-zoom.cc
r87 r89 1 1 #include "graph_displayer_canvas.h" 2 #include "broken_edge.h"3 2 #include <cmath> 4 3 -
graph_displayer_canvas.cc
r66 r89 1 1 #include "graph_displayer_canvas.h" 2 #include "broken_edge.h"3 2 #include <cmath> 4 3 -
graph_displayer_canvas.h
r88 r89 8 8 #include "all_include.h" 9 9 #include "mapstorage.h" 10 #include "broken_edge.h"11 10 #include "map_win.h" 12 11 #include <libgnomecanvasmm.h> 13 12 #include <libgnomecanvasmm/polygon.h> 13 #include <lemon/xy.h> 14 14 15 15 ///This class is the canvas, on which the graph can be drawn. 16 16 class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA 17 17 { 18 class BrokenEdge : public Gnome::Canvas::Line 19 { 20 GraphDisplayerCanvas & gdc; 21 Gnome::Canvas::Polygon * arrow; 22 Gnome::Art::Point * my_points; 23 24 25 ///Indicates whether the button of mouse is pressed or not 26 bool isbutton; 27 28 ///At this location was the mousebutton pressed. 29 ///It helps to calculate the distance of dragging. 30 double clicked_x, clicked_y; 31 32 ///event handler for forming edges 33 bool edgeFormerEventHandler(GdkEvent*); 34 public: 35 BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &); 36 ~BrokenEdge(); 37 void setPoints(Gnome::Canvas::Points, bool move=false); 38 xy<double> getArrowPos(); 39 }; 18 40 typedef Gnome::Canvas::CanvasAA Parent; 19 41 -
map_win.h
r82 r89 10 10 #include "mapstorage.h" 11 11 #include "new_map_win.h" 12 #include "mapselector.h"13 12 #include <libgnomecanvasmm.h> 14 13 #include <libgnomecanvasmm/polygon.h> … … 19 18 class MapWin : public Gtk::Window 20 19 { 20 21 class MapSelector : public Gtk::HBox 22 { 23 protected: 24 GraphDisplayerCanvas & gdc; 25 ///The \ref MapStorage in which the visualizable maps are stored 26 MapStorage & ms; 27 NewMapWin & nmw; 28 29 int id; 30 31 bool itisedge; 32 33 bool default_state; 34 35 bool set_new_map; 36 37 Gtk::ComboBoxText cbt; 38 39 Gtk::Button * newbut, * defbut; 40 41 Gtk::HBox hbox; 42 43 Gtk::Label * label; 44 45 Node node_to_update; 46 Edge edge_to_update; 47 48 49 public: 50 51 MapSelector(GraphDisplayerCanvas &, MapStorage &, NewMapWin &, int, bool); 52 53 void update_list(); 54 55 ///If a radiobutton is clicked, this function determines 56 ///which button was that and after that calls the 57 ///appropriate function of the \ref GraphDisplayerCanvas 58 ///to change the visible values of that attribute. 59 virtual void comboChanged(); 60 61 virtual void new_but_pressed(); 62 63 virtual void reset(); 64 65 virtual void update(Node node); 66 virtual void update(Edge edge); 67 68 Glib::ustring get_active_text(); 69 void set_active_text(Glib::ustring); 70 void append_text(Glib::ustring); 71 }; 72 73 74 21 75 protected: 22 76 ///The \ref GraphDisplayerCanvas on which the graph will be drawn. -
mw-mapselector.cc
r85 r89 1 #include "map selector.h"2 3 Map Selector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),set_new_map(false),node_to_update(INVALID),edge_to_update(INVALID)1 #include "map_win.h" 2 3 MapWin::MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),set_new_map(false),node_to_update(INVALID),edge_to_update(INVALID) 4 4 { 5 5 update_list(); … … 10 10 cbt.signal_changed().connect 11 11 ( 12 sigc::mem_fun((*this), &Map Selector::comboChanged),12 sigc::mem_fun((*this), &MapWin::MapSelector::comboChanged), 13 13 false 14 14 ); … … 30 30 defbut->signal_pressed().connect 31 31 ( 32 sigc::mem_fun(*this, &Map Selector::reset)32 sigc::mem_fun(*this, &MapWin::MapSelector::reset) 33 33 ); 34 34 … … 37 37 newbut->signal_pressed().connect 38 38 ( 39 sigc::mem_fun(*this, &Map Selector::new_but_pressed)39 sigc::mem_fun(*this, &MapWin::MapSelector::new_but_pressed) 40 40 ); 41 41 … … 48 48 } 49 49 50 void Map Selector::new_but_pressed()50 void MapWin::MapSelector::new_but_pressed() 51 51 { 52 52 set_new_map=true; … … 54 54 } 55 55 56 void Map Selector::update_list()56 void MapWin::MapSelector::update_list() 57 57 { 58 58 cbt.clear(); … … 76 76 } 77 77 78 void Map Selector::comboChanged()78 void MapWin::MapSelector::comboChanged() 79 79 { 80 80 if(cbt.get_active_row_number()!=0) … … 134 134 } 135 135 136 void Map Selector::reset()136 void MapWin::MapSelector::reset() 137 137 { 138 138 default_state=true; … … 177 177 } 178 178 179 void Map Selector::update(Node node)179 void MapWin::MapSelector::update(Node node) 180 180 { 181 181 node_to_update=node; … … 191 191 } 192 192 193 void Map Selector::update(Edge edge)193 void MapWin::MapSelector::update(Edge edge) 194 194 { 195 195 edge_to_update=edge; … … 205 205 } 206 206 207 Glib::ustring Map Selector::get_active_text()207 Glib::ustring MapWin::MapSelector::get_active_text() 208 208 { 209 209 return cbt.get_active_text(); 210 210 } 211 211 212 void Map Selector::set_active_text(Glib::ustring text)212 void MapWin::MapSelector::set_active_text(Glib::ustring text) 213 213 { 214 214 cbt.set_active_text(text); 215 215 } 216 216 217 void Map Selector::append_text(Glib::ustring text)217 void MapWin::MapSelector::append_text(Glib::ustring text) 218 218 { 219 219 cbt.append_text(text); -
new_map_win.cc
r88 r89 319 319 unsigned int pr=10000; 320 320 bool prevmult=false; 321 unsigned int prev_change ;322 unsigned int prev_br= 10000;321 unsigned int prev_change=pr; 322 unsigned int prev_br=pr; 323 323 int counter=0; 324 324 std::string comm_nobr=""; … … 393 393 NewMapWin::tree_node * NewMapWin::weightedString2Tree(std::string to_tree, std::vector<unsigned int> & p, int offset) 394 394 { 395 int min=p[offset];395 unsigned int min=p[offset]; 396 396 int minplace=0; 397 397 for(int i=0;i<(int)to_tree.size();i++)
Note: See TracChangeset
for help on using the changeset viewer.