source: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_informations_window.cpp @ 81

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1#include "window.h"
2
3using namespace std;
4
5using namespace morpheo::tools::viewer::parser;
6using namespace morpheo::tools::viewer::bdd;
7using namespace morpheo::tools::viewer::graphics;
8
9/*informations window constructor*/
10void Window::winformations()
11{
12  winfo = new QWidget();
13  informations = new QBoxLayout(QBoxLayout::TopToBottom,0);
14  winfo->setWindowTitle("informations");
15  winfo->setFixedSize(370,180);
16  winfo->move(628,50);
17 
18
19  /*name line*/
20  QBoxLayout *bname = new QBoxLayout(QBoxLayout::LeftToRight,0);
21  ln = new QLabel();
22  ln->setText("");
23  lname = new QLabel();
24  lname->setText("");
25  bname->addWidget(ln);
26  bname->addWidget(lname);
27
28  /*type line*/
29  QBoxLayout *btype = new QBoxLayout(QBoxLayout::LeftToRight,0);
30  lt = new QLabel();
31  lt->setText("");
32  ltype = new QLabel();
33  ltype->setText("");
34  btype->addWidget(lt);
35  btype->addWidget(ltype);
36 
37  /*comment line*/
38  comment = new QLineEdit();
39  comment->setText("");
40  comment->setReadOnly(true);
41
42  /*buttons*/
43  QPushButton *noselect = new QPushButton("cancel selection",wparam);
44  QPushButton *back = new QPushButton("back",wparam);
45  connect(back,SIGNAL(clicked()),this,SLOT(_back()));
46  connect(noselect,SIGNAL(clicked()),this,SLOT(_cancel_selection()));
47
48  informations->addLayout(bname);
49  informations->addLayout(btype);
50  informations->addWidget(comment);
51  informations->addWidget(noselect);
52  informations->addWidget(back);
53
54  winfo->setLayout(informations);
55  winfo->show();
56}
57
58/*write the comment of the componenet selected*/
59void Window::write_comment(string cm){
60  QString c = QString::fromStdString(cm);
61  comment->setText(c);
62  comment->setCursorPosition(1);
63  comment->show();
64}
65
66void Window::erase_comment(){
67  comment->setText("");
68  comment->hide();
69}
70/*write the name of the component selected*/
71void Window::write_name(string type,string name){
72  QString n = QString::fromStdString(type);
73  ln->setText(n);
74  QString n2 = QString::fromStdString(name);
75  lname->setText(n2);
76}
77
78void Window::erase_line(QLabel *l1, QLabel *l2){
79  l1->setText("");
80  l2->setText("");
81}
82
83/*write the type of the component selected*/
84void Window::write_type(string type){
85  lt->setText("type");
86  QString n = QString::fromStdString(type);
87  ltype->setText(n);
88}
89
90void Window::_cancel_selection(){
91  component_clicked = false;
92}
Note: See TracBrowser for help on using the repository browser.