COIN-OR::LEMON - Graph Library

Changeset 201:879e47e5b731 in glemon-0.x for map_win.cc


Ignore:
Timestamp:
01/02/08 22:03:09 (16 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3431
Message:

Merge branches/akos to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • map_win.cc

    r194 r201  
    3232}
    3333
    34 MapWin::MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw):mytab(mw)
     34MapWin::MapWin(const std::string& title,
     35    std::vector<std::string> n_eml,
     36    std::vector<std::string> s_eml,
     37    std::vector<std::string> n_nml,
     38    std::vector<std::string> s_nml,
     39    NoteBookTab & mw):mytab(mw)
    3540{
    3641  set_title(title);
     
    4954  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    5055  {
    51     e_combo_array[i]=new MapSelector(eml, mytab.getActiveEdgeMap(i), edge_property_strings[i], true);
     56    switch (i)
     57    {
     58      case E_WIDTH:
     59        e_combo_array[i]=new MapSelector(n_eml, s_eml,
     60            mytab.getActiveEdgeMap(i), edge_property_strings[i],
     61            true, true, NUM);
     62        break;
     63      case E_COLOR:
     64        e_combo_array[i]=new MapSelector(n_eml, s_eml,
     65            mytab.getActiveEdgeMap(i), edge_property_strings[i],
     66            true, true, NUM);
     67        break;
     68      case E_TEXT:
     69        e_combo_array[i]=new MapSelector(n_eml, s_eml,
     70            mytab.getActiveEdgeMap(i), edge_property_strings[i],
     71            true, true, ALL);
     72        break;
     73    }
    5274
    5375    (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
     
    6991  for(int i=0;i<NODE_PROPERTY_NUM;i++)
    7092  {
    71     n_combo_array[i]=new MapSelector(nml, mytab.getActiveNodeMap(i), node_property_strings[i], false);
     93    switch (i)
     94    {
     95      case N_RADIUS:
     96        n_combo_array[i]=new MapSelector(n_nml, s_nml,
     97            mytab.getActiveNodeMap(i), node_property_strings[i],
     98            false, true, NUM);
     99        break;
     100      case N_COLOR:
     101        n_combo_array[i]=new MapSelector(n_nml, s_nml,
     102            mytab.getActiveNodeMap(i), node_property_strings[i],
     103            false, true, NUM);
     104        break;
     105      case N_TEXT:
     106        n_combo_array[i]=new MapSelector(n_nml, s_nml,
     107            mytab.getActiveNodeMap(i), node_property_strings[i],
     108            false, true, ALL);
     109        break;
     110    }
    72111
    73112    (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
     
    83122  vbox.pack_start(*table);
    84123
     124  update(n_eml, s_eml, n_nml, s_nml);
     125
    85126  show_all_children();
    86127
     
    102143}
    103144
    104 void MapWin::update(std::vector<std::string> eml, std::vector<std::string> nml)
     145void MapWin::update(
     146    std::vector<std::string> n_eml,
     147    std::vector<std::string> s_eml,
     148    std::vector<std::string> n_nml,
     149    std::vector<std::string> s_nml)
    105150{
    106151  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    107152  {
    108     e_combo_array[i]->update_list(eml);
     153    e_combo_array[i]->update_list(n_eml, s_eml);
    109154  }
    110155
    111156  for(int i=0;i<NODE_PROPERTY_NUM;i++)
    112157  {
    113     n_combo_array[i]->update_list(nml);
     158    n_combo_array[i]->update_list(n_nml, s_nml);
    114159  }
    115160
     
    117162}
    118163
    119 void MapWin::registerNewEdgeMap(std::string newmapname)
     164void MapWin::registerNewEdgeMap(std::string newmapname, MapValue::Type type)
    120165{
    121166  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    122167  {
    123168    //filling in combo box with choices
    124     e_combo_array[i]->append_text((Glib::ustring)newmapname);
    125   }
    126 }
    127 
    128 void MapWin::registerNewNodeMap(std::string newmapname)
     169    e_combo_array[i]->append_text((Glib::ustring)newmapname, type);
     170  }
     171}
     172
     173void MapWin::registerNewNodeMap(std::string newmapname, MapValue::Type type)
    129174{
    130175  for(int i=0;i<NODE_PROPERTY_NUM;i++)
    131176  {
    132177    //filling in combo box with choices
    133     n_combo_array[i]->append_text((Glib::ustring)newmapname);
     178    n_combo_array[i]->append_text((Glib::ustring)newmapname, type);
    134179  }
    135180}
Note: See TracChangeset for help on using the changeset viewer.