source: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main_window.cpp @ 30

Last change on this file since 30 was 30, checked in by chou, 17 years ago

Morpheo Viewer Release 4.0 :
changements graphiques .

  • Property svn:executable set to *
File size: 4.3 KB
Line 
1#include "window.h"
2
3
4using namespace std;
5using namespace morpheo::tools::viewer::parser;
6using namespace morpheo::tools::viewer::bdd;
7using namespace morpheo::tools::viewer::graphics;
8
9Window::Window(QString name)
10{
11  paint = false;
12  window_height = 620;
13  window_width = 620;
14  charg_open = false;
15  mess_open = false; 
16  component_clicked = false;
17  cpt_level=0;
18 
19  /*menu bar*/
20  QMenuBar *menu_bar = new QMenuBar(this);
21 
22  /*items of the menu bar*/
23  QMenu *file = new QMenu();
24  QMenu *tools = new QMenu();
25  QMenu *help = new QMenu();
26 
27  /*connect signals of "file" menu with items of the menu bar*/
28  QAction *openAct;
29  openAct = new QAction(tr("&open"),this);
30  connect(openAct,SIGNAL(triggered()),this,SLOT(_open()));
31 
32  QAction *closeAct;
33  closeAct = new QAction(tr("&close"),this);
34  connect(closeAct,SIGNAL(triggered()),this,SLOT(_close()));
35 
36  QAction *saveAct;
37  saveAct = new QAction(tr("&save"),this);
38  connect(saveAct,SIGNAL(triggered()),this,SLOT(_save()));
39 
40  QAction *saveAsAct;
41  saveAsAct = new QAction(tr("&save_as"),this);
42  connect(saveAsAct,SIGNAL(triggered()),this,SLOT(_saveAs()));
43 
44  QAction *quitAct;
45  quitAct = new QAction(tr("&quit"),this);
46  connect(quitAct,SIGNAL(triggered()),this,SLOT(_quit()));
47 
48  /*add the menu "file" to the menu bar*/
49  file = menu_bar->addMenu(tr("&File"));
50  file->addAction(openAct);
51  file->addAction(saveAct);
52  file->addAction(saveAsAct);
53  file->addAction(closeAct);
54  file->addAction(quitAct);
55
56  /*connect signals of the menu "tools"  with items of the menu bar*/
57  QAction *zoomInAct;
58  zoomInAct = new QAction(tr("&zoom in"),this);
59  connect(zoomInAct,SIGNAL(triggered()),this,SLOT(_zoomIn()));
60
61  QAction *zoomOutAct;
62  zoomOutAct = new QAction(tr("&zoom out"),this);
63  connect(zoomOutAct,SIGNAL(triggered()),this,SLOT(_zoomOut()));
64
65  QAction *defautZoomAct;
66  defautZoomAct = new QAction(tr("&defaut zoom"),this);
67  connect(defautZoomAct,SIGNAL(triggered()),this,SLOT(_defautZoom()));
68
69  QAction *levelAct;
70  levelAct = new QAction(tr("&level"),this);
71  connect(levelAct,SIGNAL(triggered()),this,SLOT(_level()));
72
73  QAction *infoAct;
74  infoAct = new QAction(tr("&informations"),this);
75  connect(infoAct,SIGNAL(triggered()),this,SLOT(_informations()));
76
77  QAction *paramAct;
78  paramAct = new QAction(tr("&parameters"),this);
79  connect(paramAct,SIGNAL(triggered()),this,SLOT(_parameters()));
80
81
82  QAction *compoNameAct;
83  compoNameAct = new QAction(tr("&components name"),this);
84  connect(compoNameAct,SIGNAL(triggered()),this,SLOT(_component_name()));
85
86  QAction *signalNameAct;
87  signalNameAct = new QAction(tr("&signals name"),this);
88  connect(signalNameAct,SIGNAL(triggered()),this,SLOT(_signal_name()));
89
90  /*add the menu "tools" to the menu bar*/
91  tools = menu_bar->addMenu(tr("&Tools"));
92  //tools->addAction(zoomInAct);
93  //tools->addAction(zoomOutAct);
94  //tools->addAction(defautZoomAct);
95  tools->addAction(compoNameAct);
96  tools->addAction(signalNameAct);
97  //tools->addAction(levelAct);
98  tools->addAction(infoAct);
99  tools->addAction(paramAct);
100
101  /*connect the menu "about" with items of the menu bar*/
102  QAction *aboutAct;
103  aboutAct = new QAction(tr("&about"),this);
104  connect(aboutAct,SIGNAL(triggered()),this,SLOT(_about()));
105 
106  /*add the emenu "about" yo yhe menu bar*/
107  help = menu_bar->addMenu(tr("&About"));
108  help->addAction(aboutAct);
109 
110  /*add the menu bar to the main window*/
111  this->setMenuWidget(menu_bar);
112
113  /*add a status bar to the main menu*/
114  status = new QStatusBar();
115  this->setStatusBar(status);
116
117  /*defaut size*/
118  this->setFixedSize(window_width,window_height);
119
120  /*defaut position*/
121  this->move(0,50);   
122
123  /*main window title*/
124  this->setWindowTitle("Viewer");
125   
126  /*parameters window creation*/
127  this->wparameters();
128  param_open = true;
129
130  /*informations window creation*/
131  this->winformations();
132  info_open = true;
133
134  /*if quit_demand = true, then the user clicked on "quit"*/
135  quit_demand = false;
136
137  /*little windows (open, save...), closed at init*/
138  wq_open = false;
139  wa_open = false;
140
141  /*signals and components name hidden*/
142  signalName = false;
143  componentName = false;
144
145  /*file unsaved at init*/
146  save_as = false;
147  first_save = false; //first_save = true for a new file
148 
149  current_name = name;
150  if(current_name != NULL){
151    is_save = true;
152  }
153  else {
154    file_open = false;
155    paint = false;
156    is_save = true;
157  }
158}
Note: See TracBrowser for help on using the repository browser.