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@28
|
22 |
class MapWin;
|
hegyi@28
|
23 |
|
hegyi@94
|
24 |
#include <all_include.h>
|
hegyi@96
|
25 |
#include <nbtab.h>
|
hegyi@112
|
26 |
#include <mapselector.h>
|
ladanyi@6
|
27 |
#include <libgnomecanvasmm.h>
|
ladanyi@6
|
28 |
#include <libgnomecanvasmm/polygon.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 eml edgemap list
|
hegyi@123
|
69 |
///\param nml nodemap list
|
hegyi@123
|
70 |
///\param mw the owner \ref NoteBookTab (\ref mytab)
|
hegyi@123
|
71 |
MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw);
|
hegyi@95
|
72 |
|
hegyi@123
|
73 |
///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab)
|
hegyi@95
|
74 |
virtual bool on_delete_event(GdkEventAny *);
|
hegyi@95
|
75 |
|
hegyi@123
|
76 |
///Handles changement in nodemap selection
|
hegyi@28
|
77 |
|
hegyi@123
|
78 |
///If \ref MapSelector emits a signal that indicates
|
hegyi@123
|
79 |
///changement in nodemap selection this function will
|
hegyi@123
|
80 |
///be called. It calls the appropriate handler function,
|
hegyi@123
|
81 |
///\ref NoteBookTab::propertyChange with parameters describing the changement.
|
hegyi@123
|
82 |
///\param mapname the recently selected map
|
hegyi@123
|
83 |
///\param prop the changed property
|
hegyi@123
|
84 |
void nodeMapChanged(std::string mapname, int prop);
|
hegyi@94
|
85 |
|
hegyi@123
|
86 |
///Handles changement in edgemap selection
|
hegyi@28
|
87 |
|
hegyi@123
|
88 |
///If \ref MapSelector emits a signal that indicates
|
hegyi@123
|
89 |
///changement in edgemap selection this function will
|
hegyi@123
|
90 |
///be called. It calls the appropriate handler function,
|
hegyi@123
|
91 |
///\ref NoteBookTab::propertyChange with parameters describing the changement.
|
hegyi@123
|
92 |
///\param mapname the recently selected map
|
hegyi@123
|
93 |
///\param prop the changed property
|
hegyi@123
|
94 |
void edgeMapChanged(std::string mapname, int prop);
|
hegyi@38
|
95 |
|
hegyi@123
|
96 |
///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened.
|
hegyi@38
|
97 |
|
hegyi@123
|
98 |
///This function is bound to the
|
hegyi@123
|
99 |
///signal emitted by the \ref MapSelector in case of
|
hegyi@123
|
100 |
///the user wants to create a new map. It only pass the
|
hegyi@123
|
101 |
///information further to the tab owning this \ref MapWin that is needed to open the
|
hegyi@123
|
102 |
///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin)
|
hegyi@123
|
103 |
///\param itisedge should the new map will be an edgemap? (or nodemap)
|
hegyi@123
|
104 |
void newMapWinNeeded(bool itisedge);
|
hegyi@123
|
105 |
|
hegyi@123
|
106 |
///This function inserts name of the new edgemap in the name list in \ref MapSelector s
|
hegyi@123
|
107 |
|
hegyi@123
|
108 |
///\param new_name
|
hegyi@123
|
109 |
///name of new map
|
hegyi@123
|
110 |
void registerNewEdgeMap(std::string new_name);
|
hegyi@123
|
111 |
|
hegyi@123
|
112 |
///This function inserts name of the new nodemap in the name list in \ref MapSelector s
|
hegyi@123
|
113 |
|
hegyi@123
|
114 |
///\param new_name
|
hegyi@123
|
115 |
///name of new map
|
hegyi@123
|
116 |
void registerNewNodeMap(std::string new_name);
|
hegyi@123
|
117 |
|
hegyi@123
|
118 |
///Close window if Esc key pressed.
|
hegyi@30
|
119 |
virtual bool closeIfEscapeIsPressed(GdkEventKey*);
|
hegyi@38
|
120 |
|
hegyi@123
|
121 |
///Updates list of maps in all \ref MapSelector
|
hegyi@123
|
122 |
|
hegyi@123
|
123 |
///This function is called by \ref NoteBookTab, when the file
|
hegyi@123
|
124 |
///showed in it has changed, therefore the contained maps
|
hegyi@123
|
125 |
///have changed as well. \ref NoteBookTab knows, whether it
|
hegyi@123
|
126 |
///has to call this function or not from the \ref NoteBookTab::mapwinexists
|
hegyi@123
|
127 |
///variable.
|
hegyi@123
|
128 |
///\param eml edge map list
|
hegyi@123
|
129 |
///\param nml node map list
|
hegyi@123
|
130 |
void update(std::vector<std::string> eml, std::vector<std::string> nml);
|
hegyi@172
|
131 |
|
hegyi@172
|
132 |
void changeEntry(bool, int, std::string);
|
hegyi@172
|
133 |
|
hegyi@172
|
134 |
void set_title(std::string);
|
ladanyi@6
|
135 |
};
|
ladanyi@6
|
136 |
|
ladanyi@6
|
137 |
#endif //MAP_WIN_H
|