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

Last change on this file since 99 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
RevLine 
[20]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
[32]9/*informations window constructor*/
[20]10void Window::winformations()
11{
12  winfo = new QWidget();
[21]13  informations = new QBoxLayout(QBoxLayout::TopToBottom,0);
[20]14  winfo->setWindowTitle("informations");
[32]15  winfo->setFixedSize(370,180);
[26]16  winfo->move(628,50);
[32]17 
[30]18
[32]19  /*name line*/
[30]20  QBoxLayout *bname = new QBoxLayout(QBoxLayout::LeftToRight,0);
21  ln = new QLabel();
22  ln->setText("");
[26]23  lname = new QLabel();
24  lname->setText("");
[30]25  bname->addWidget(ln);
26  bname->addWidget(lname);
27
[32]28  /*type line*/
[30]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);
[32]36 
37  /*comment line*/
[26]38  comment = new QLineEdit();
39  comment->setText("");
[30]40  comment->setReadOnly(true);
41
[32]42  /*buttons*/
[30]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);
[26]50  informations->addWidget(comment);
[30]51  informations->addWidget(noselect);
52  informations->addWidget(back);
53
[20]54  winfo->setLayout(informations);
55  winfo->show();
56}
57
[32]58/*write the comment of the componenet selected*/
[26]59void Window::write_comment(string cm){
60  QString c = QString::fromStdString(cm);
61  comment->setText(c);
[32]62  comment->setCursorPosition(1);
[30]63  comment->show();
[26]64}
65
[32]66void Window::erase_comment(){
67  comment->setText("");
68  comment->hide();
[26]69}
[32]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}
[30]77
[32]78void Window::erase_line(QLabel *l1, QLabel *l2){
79  l1->setText("");
80  l2->setText("");
81}
82
83/*write the type of the component selected*/
[30]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.