COIN-OR::LEMON - Graph Library

source: glemon-0.x/map_win.h @ 197:c1084e2bff10

Last change on this file since 197:c1084e2bff10 was 194:6b2b718420eb, checked in by Hegyi Péter, 13 years ago

Header reorganising

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