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