map_win.h
author ladanyi
Wed, 02 Jan 2008 21:03:09 +0000
changeset 201 879e47e5b731
parent 194 6b2b718420eb
permissions -rw-r--r--
Merge branches/akos to trunk.
alpar@174
     1
/* -*- C++ -*-
alpar@174
     2
 *
alpar@174
     3
 * This file is a part of LEMON, a generic C++ optimization library
alpar@174
     4
 *
alpar@174
     5
 * Copyright (C) 2003-2006
alpar@174
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@174
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
alpar@174
     8
 *
alpar@174
     9
 * Permission to use, modify and distribute this software is granted
alpar@174
    10
 * provided that this copyright notice appears in all copies. For
alpar@174
    11
 * precise terms see the accompanying LICENSE file.
alpar@174
    12
 *
alpar@174
    13
 * This software is provided "AS IS" with no warranty of any kind,
alpar@174
    14
 * express or implied, and with no claim as to its suitability for any
alpar@174
    15
 * purpose.
alpar@174
    16
 *
alpar@174
    17
 */
ladanyi@6
    18
ladanyi@6
    19
#ifndef MAP_WIN_H
ladanyi@6
    20
#define MAP_WIN_H
ladanyi@6
    21
hegyi@194
    22
class NoteBookTab;
hegyi@194
    23
class MapSelector;
hegyi@28
    24
hegyi@94
    25
#include <all_include.h>
ladanyi@6
    26
#include <libgnomecanvasmm.h>
ladanyi@6
    27
#include <libgnomecanvasmm/polygon.h>
ladanyi@201
    28
#include "map_value.h"
ladanyi@6
    29
hegyi@123
    30
///Graph visualization setup window.
hegyi@123
    31
ladanyi@6
    32
///This class is responsible for creating a window,
ladanyi@6
    33
///on which the visualization attributes can be
ladanyi@6
    34
///assigned to maps.
ladanyi@6
    35
class MapWin : public Gtk::Window
ladanyi@6
    36
{
ladanyi@6
    37
protected:
hegyi@123
    38
  ///\ref NoteBookTab to that the \ref MapWin belongs to.
hegyi@96
    39
  NoteBookTab & mytab;
ladanyi@6
    40
hegyi@123
    41
  ///Designing element
hegyi@28
    42
  Gtk::Table * table;
ladanyi@6
    43
  
hegyi@123
    44
  ///\ref MapSelectors for each property
ladanyi@6
    45
hegyi@123
    46
  ///Each property has an own \ref MapSelector through which
hegyi@123
    47
  ///the map to visualize by the property van be set.
hegyi@123
    48
  MapSelector ** e_combo_array;
hegyi@123
    49
hegyi@123
    50
  ///\ref MapSelectors for each property
hegyi@123
    51
hegyi@123
    52
  ///Each property has an own \ref MapSelector through which
hegyi@123
    53
  ///the map to visualize by the property van be set.
hegyi@123
    54
  MapSelector ** n_combo_array;
hegyi@123
    55
hegyi@123
    56
  ///Information holder
hegyi@8
    57
  Gtk::Label * label;
ladanyi@6
    58
hegyi@123
    59
  ///Container in which elements are organized.
hegyi@28
    60
  Gtk::VBox vbox;
hegyi@28
    61
ladanyi@6
    62
public:
hegyi@123
    63
  ///Constructor
ladanyi@6
    64
hegyi@123
    65
  ///It creates the widgets shown in \ref MapWin and
hegyi@123
    66
  ///binds the needed signal to the correct place.
hegyi@123
    67
  ///\param title title of window
hegyi@123
    68
  ///\param mw the owner \ref NoteBookTab (\ref mytab)
ladanyi@201
    69
  MapWin(const std::string& title, 
ladanyi@201
    70
      std::vector<std::string> n_eml,
ladanyi@201
    71
      std::vector<std::string> s_eml,
ladanyi@201
    72
      std::vector<std::string> n_nml,
ladanyi@201
    73
      std::vector<std::string> s_nml,
ladanyi@201
    74
      NoteBookTab & mw);
hegyi@95
    75
hegyi@123
    76
  ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab)
hegyi@95
    77
  virtual bool on_delete_event(GdkEventAny *);
hegyi@95
    78
hegyi@123
    79
  ///Handles changement in nodemap selection
hegyi@28
    80
hegyi@123
    81
  ///If \ref MapSelector emits a signal that indicates
hegyi@123
    82
  ///changement in nodemap selection this function will
hegyi@123
    83
  ///be called. It calls the appropriate handler function,
hegyi@123
    84
  ///\ref NoteBookTab::propertyChange with parameters describing the changement.
hegyi@123
    85
  ///\param mapname the recently selected map
hegyi@123
    86
  ///\param prop the changed property
hegyi@123
    87
  void nodeMapChanged(std::string mapname, int prop);
hegyi@94
    88
hegyi@123
    89
  ///Handles changement in edgemap selection
hegyi@28
    90
hegyi@123
    91
  ///If \ref MapSelector emits a signal that indicates
hegyi@123
    92
  ///changement in edgemap selection this function will
hegyi@123
    93
  ///be called. It calls the appropriate handler function,
hegyi@123
    94
  ///\ref NoteBookTab::propertyChange with parameters describing the changement.
hegyi@123
    95
  ///\param mapname the recently selected map
hegyi@123
    96
  ///\param prop the changed property
hegyi@123
    97
  void edgeMapChanged(std::string mapname, int prop);
hegyi@38
    98
hegyi@123
    99
  ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened.
hegyi@38
   100
hegyi@123
   101
  ///This function is bound to the
hegyi@123
   102
  ///signal emitted by the \ref MapSelector in case of
hegyi@123
   103
  ///the user wants to create a new map. It only pass the
hegyi@123
   104
  ///information further to the tab owning this \ref MapWin that is needed to open the
hegyi@123
   105
  ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin)
hegyi@123
   106
  ///\param itisedge should the new map will be an edgemap? (or nodemap)
hegyi@123
   107
  void newMapWinNeeded(bool itisedge);
hegyi@123
   108
hegyi@123
   109
  ///This function inserts name of the new edgemap in the name list in \ref MapSelector s
hegyi@123
   110
hegyi@123
   111
  ///\param new_name
hegyi@123
   112
  ///name of new map
ladanyi@201
   113
  void registerNewEdgeMap(std::string new_name, MapValue::Type type);
hegyi@123
   114
hegyi@123
   115
  ///This function inserts name of the new nodemap in the name list in \ref MapSelector s
hegyi@123
   116
hegyi@123
   117
  ///\param new_name
hegyi@123
   118
  ///name of new map
ladanyi@201
   119
  void registerNewNodeMap(std::string new_name, MapValue::Type type);
hegyi@123
   120
hegyi@123
   121
  ///Close window if Esc key pressed.
hegyi@30
   122
  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
hegyi@38
   123
hegyi@123
   124
  ///Updates list of maps in all \ref MapSelector
hegyi@123
   125
hegyi@123
   126
  ///This function is called by \ref NoteBookTab, when the file
hegyi@123
   127
  ///showed in it has changed, therefore the contained maps
hegyi@123
   128
  ///have changed as well. \ref NoteBookTab knows, whether it
hegyi@123
   129
  ///has to call this function or not from the \ref NoteBookTab::mapwinexists
hegyi@123
   130
  ///variable.
ladanyi@201
   131
  void update(
ladanyi@201
   132
    std::vector<std::string> n_eml,
ladanyi@201
   133
    std::vector<std::string> s_eml,
ladanyi@201
   134
    std::vector<std::string> n_nml,
ladanyi@201
   135
    std::vector<std::string> s_nml);
hegyi@172
   136
hegyi@172
   137
  void changeEntry(bool, int, std::string);
hegyi@172
   138
hegyi@172
   139
  void set_title(std::string);
ladanyi@6
   140
};
ladanyi@6
   141
ladanyi@6
   142
#endif //MAP_WIN_H