]> rtime.felk.cvut.cz Git - orte.git/blob - orte/contrib/shape/MainForm.ui.h
02636b56e56b6ed0e59d269ae79df82dbbdcb97c
[orte.git] / orte / contrib / shape / MainForm.ui.h
1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
3 **
4 ** If you wish to add, delete or rename functions or slots use
5 ** Qt Designer which will update this file, preserving your code. Create an
6 ** init() function in place of a constructor, and a destroy() function in
7 ** place of a destructor.
8 *****************************************************************************/
9 #include <qmessagebox.h>
10 #include <qapplication.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include "FPublisher.h"
14 #include "FSubscriber.h"
15 #include "richtext.h"
16 #if (QT_VERSION-0 >= 0x040000)
17 #include <QCloseEvent>
18 #include <QPixmap>
19 #include <q3ptrlist.h>
20 #else
21 #include <qptrlist.h>
22 #endif
23
24
25 void MainForm::addPublisher()
26 {
27
28     FPublisher *fp;
29     fp = new FPublisher;
30     connect( this, SIGNAL( sigClose() ), fp, SLOT( destroy() ) );
31     fp->initPublisher(publGroup->id(publGroup->selected()),rand()%3);
32 #if (QT_VERSION-0 >= 0x040000)
33     fp->setWindowIcon(QPixmap("FPublisherIcon.png"));
34 #endif
35     fp->show();
36 }
37
38 void MainForm::addSubscriber()
39 {
40     FSubscriber *fs;
41     fs = new FSubscriber;
42     connect( this, SIGNAL( sigClose() ), fs, SLOT( destroy() ) );
43     fs->initSubscribers(
44         clBlue->isChecked(),
45         clGreen->isChecked(),
46         clRed->isChecked(),
47         clBlack->isChecked(),
48         clYellow->isChecked());
49 #if (QT_VERSION-0 >= 0x040000)
50     fs->setWindowIcon(QPixmap("FSubscriberIcon.png"));
51 #endif    
52     fs->show();
53 }
54
55 void MainForm::about()
56 {
57     QMessageBox::about( this, "ORTE application demo",
58                         "This application demonstrates usege of ORTE library\n\n"
59                         "Petr Smolik (c) 2004\n"
60                         "OCERA team");
61 }
62
63 void MainForm::viewPublSource()
64 {
65     MyRichText *richtext;
66     richtext=new MyRichText;
67     richtext->resize( 450, 350 );
68     richtext->setCaption( "Publisher example" );
69     richtext->setTextPublisher();
70     richtext->show();
71 }
72
73 void MainForm::viewSubsSource()
74 {
75     MyRichText *richtext;
76     richtext=new MyRichText;
77     richtext->resize( 450, 350 );
78     richtext->setCaption( "Subscriber example" );
79     richtext->setTextSubscriber();
80     richtext->show();
81 }
82
83 void MainForm::closeEvent( QCloseEvent *e )
84 {
85     sigClose();
86     e->accept();
87 }