map_win.h
author hegyi
Wed, 28 Feb 2007 18:20:28 +0000
changeset 194 6b2b718420eb
parent 174 95872af46fc4
child 201 879e47e5b731
permissions -rw-r--r--
Header reorganising
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@6
    28
hegyi@123
    29
///Graph visualization setup window.
hegyi@123
    30
ladanyi@6
    31
///This class is responsible for creating a window,
ladanyi@6
    32
///on which the visualization attributes can be
ladanyi@6
    33
///assigned to maps.
ladanyi@6
    34
class MapWin : public Gtk::Window
ladanyi@6
    35
{
ladanyi@6
    36
protected:
hegyi@123
    37
  ///\ref NoteBookTab to that the \ref MapWin belongs to.
hegyi@96
    38
  NoteBookTab & mytab;
ladanyi@6
    39
hegyi@123
    40
  ///Designing element
hegyi@28
    41
  Gtk::Table * table;
ladanyi@6
    42
  
hegyi@123
    43
  ///\ref MapSelectors for each property
ladanyi@6
    44
hegyi@123
    45
  ///Each property has an own \ref MapSelector through which
hegyi@123
    46
  ///the map to visualize by the property van be set.
hegyi@123
    47
  MapSelector ** e_combo_array;
hegyi@123
    48
hegyi@123
    49
  ///\ref MapSelectors for each property
hegyi@123
    50
hegyi@123
    51
  ///Each property has an own \ref MapSelector through which
hegyi@123
    52
  ///the map to visualize by the property van be set.
hegyi@123
    53
  MapSelector ** n_combo_array;
hegyi@123
    54
hegyi@123
    55
  ///Information holder
hegyi@8
    56
  Gtk::Label * label;
ladanyi@6
    57
hegyi@123
    58
  ///Container in which elements are organized.
hegyi@28
    59
  Gtk::VBox vbox;
hegyi@28
    60
ladanyi@6
    61
public:
hegyi@123
    62
  ///Constructor
ladanyi@6
    63
hegyi@123
    64
  ///It creates the widgets shown in \ref MapWin and
hegyi@123
    65
  ///binds the needed signal to the correct place.
hegyi@123
    66
  ///\param title title of window
hegyi@123
    67
  ///\param eml edgemap list
hegyi@123
    68
  ///\param nml nodemap list
hegyi@123
    69
  ///\param mw the owner \ref NoteBookTab (\ref mytab)
hegyi@123
    70
  MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw);
hegyi@95
    71
hegyi@123
    72
  ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab)
hegyi@95
    73
  virtual bool on_delete_event(GdkEventAny *);
hegyi@95
    74
hegyi@123
    75
  ///Handles changement in nodemap selection
hegyi@28
    76
hegyi@123
    77
  ///If \ref MapSelector emits a signal that indicates
hegyi@123
    78
  ///changement in nodemap selection this function will
hegyi@123
    79
  ///be called. It calls the appropriate handler function,
hegyi@123
    80
  ///\ref NoteBookTab::propertyChange with parameters describing the changement.
hegyi@123
    81
  ///\param mapname the recently selected map
hegyi@123
    82
  ///\param prop the changed property
hegyi@123
    83
  void nodeMapChanged(std::string mapname, int prop);
hegyi@94
    84
hegyi@123
    85
  ///Handles changement in edgemap selection
hegyi@28
    86
hegyi@123
    87
  ///If \ref MapSelector emits a signal that indicates
hegyi@123
    88
  ///changement in edgemap selection this function will
hegyi@123
    89
  ///be called. It calls the appropriate handler function,
hegyi@123
    90
  ///\ref NoteBookTab::propertyChange with parameters describing the changement.
hegyi@123
    91
  ///\param mapname the recently selected map
hegyi@123
    92
  ///\param prop the changed property
hegyi@123
    93
  void edgeMapChanged(std::string mapname, int prop);
hegyi@38
    94
hegyi@123
    95
  ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened.
hegyi@38
    96
hegyi@123
    97
  ///This function is bound to the
hegyi@123
    98
  ///signal emitted by the \ref MapSelector in case of
hegyi@123
    99
  ///the user wants to create a new map. It only pass the
hegyi@123
   100
  ///information further to the tab owning this \ref MapWin that is needed to open the
hegyi@123
   101
  ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin)
hegyi@123
   102
  ///\param itisedge should the new map will be an edgemap? (or nodemap)
hegyi@123
   103
  void newMapWinNeeded(bool itisedge);
hegyi@123
   104
hegyi@123
   105
  ///This function inserts name of the new edgemap in the name list in \ref MapSelector s
hegyi@123
   106
hegyi@123
   107
  ///\param new_name
hegyi@123
   108
  ///name of new map
hegyi@123
   109
  void registerNewEdgeMap(std::string new_name);
hegyi@123
   110
hegyi@123
   111
  ///This function inserts name of the new nodemap in the name list in \ref MapSelector s
hegyi@123
   112
hegyi@123
   113
  ///\param new_name
hegyi@123
   114
  ///name of new map
hegyi@123
   115
  void registerNewNodeMap(std::string new_name);
hegyi@123
   116
hegyi@123
   117
  ///Close window if Esc key pressed.
hegyi@30
   118
  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
hegyi@38
   119
hegyi@123
   120
  ///Updates list of maps in all \ref MapSelector
hegyi@123
   121
hegyi@123
   122
  ///This function is called by \ref NoteBookTab, when the file
hegyi@123
   123
  ///showed in it has changed, therefore the contained maps
hegyi@123
   124
  ///have changed as well. \ref NoteBookTab knows, whether it
hegyi@123
   125
  ///has to call this function or not from the \ref NoteBookTab::mapwinexists
hegyi@123
   126
  ///variable.
hegyi@123
   127
  ///\param eml edge map list
hegyi@123
   128
  ///\param nml node map list
hegyi@123
   129
  void update(std::vector<std::string> eml, std::vector<std::string> nml);
hegyi@172
   130
hegyi@172
   131
  void changeEntry(bool, int, std::string);
hegyi@172
   132
hegyi@172
   133
  void set_title(std::string);
ladanyi@6
   134
};
ladanyi@6
   135
ladanyi@6
   136
#endif //MAP_WIN_H