COIN-OR::LEMON - Graph Library

Changeset 1614:350c1d8bb7cc in lemon-0.x


Ignore:
Timestamp:
08/07/05 16:17:11 (19 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2121
Message:

Alpar had the key, focus can be set in the window class. But it is not enough, the focused widget has to be activated, as well! Was a hard task to find out... By the way, two compilation warnings are removed.

Location:
gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • gui/graph_displayer_canvas-edge.cc

    r1606 r1614  
    2626      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
    2727        {
    28           double v=abs((*actual_map)[i]);
     28          double v=fabs((*actual_map)[i]);
    2929          int w;
    3030          if(min==max)
  • gui/graph_displayer_canvas-event.cc

    r1606 r1614  
    623623                        canvasentrywidget->property_width().set_value(edgetextmap[active_edge]->property_text_width().get_value()*4);
    624624                        canvasentrywidget->property_height().set_value(edgetextmap[active_edge]->property_text_height().get_value()*1.5);
     625
     626                        //setting the focus to newly created widget
     627                        parentwin->set_focus(entrywidget);
     628                        parentwin->activate_focus();
    625629                      }
    626630                  }
  • gui/graph_displayer_canvas-node.cc

    r1606 r1614  
    2525      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
    2626        {
    27           double v=abs((*actual_map)[i]);
     27          double v=fabs((*actual_map)[i]);
    2828          int w;
    2929          if(min==max)
  • gui/graph_displayer_canvas.cc

    r1606 r1614  
    33#include <math.h>
    44
    5 GraphDisplayerCanvas::GraphDisplayerCanvas(MapStorage & ms, MapWin & mw) :
     5GraphDisplayerCanvas::GraphDisplayerCanvas(MapStorage & ms, MapWin & mw, Gtk::Window * mainwin) :
    66  nodesmap(ms.graph), edgesmap(ms.graph), edgetextmap(ms.graph),
    77  nodetextmap(ms.graph), displayed_graph(*(root()), 0, 0),
     
    99  target_item(NULL), nodemap_to_edit(""), edgemap_to_edit(""), mapwin(mw)
    1010{
     11  parentwin=mainwin;
     12
    1113  //base event handler is move tool
    1214  actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false);
  • gui/graph_displayer_canvas.h

    r1606 r1614  
    1919
    2020public:
    21   GraphDisplayerCanvas(MapStorage &, MapWin &);
     21  GraphDisplayerCanvas(MapStorage &, MapWin &, Gtk::Window *);
    2222  virtual ~GraphDisplayerCanvas();
    2323
     
    178178  MapWin & mapwin;
    179179
     180  ///We need to store the parent window to be able to set the focus on a given widget
     181  ///We will use this variable to activate the set focus on entry widget in the case of editing map values.
     182  Gtk::Window * parentwin;
     183
    180184};
    181185
  • gui/main_win.cc

    r1606 r1614  
    33MainWin::MainWin(const std::string& title) :
    44  mapwin("Map Setup", mapstorage, gd_canvas),
    5   newmapwin("Creating new map", gd_canvas), gd_canvas(mapstorage, mapwin)
    6 {
    7 
     5  newmapwin("Creating new map", gd_canvas), gd_canvas(mapstorage, mapwin, (Gtk::Window *)this)
     6{
    87  set_title (title);
    98  set_default_size(WIN_WIDTH,WIN_HEIGHT);
Note: See TracChangeset for help on using the changeset viewer.