source: Sophya/trunk/SophyaPI/PI/piapplx.cc@ 2

Last change on this file since 2 was 2, checked in by eros, 30 years ago

Creation (par cvs import) du module PI (PeidaInter - active) Reza 15/02/96

File size: 1.4 KB
Line 
1#include <stdio.h>
2#include "piapplx.h"
3#include "picontainerx.h"
4
5
6#define DEBUG_APPLX
7
8/* --Methode-- */
9PIApplicationX::PIApplicationX(int sx, int sy, int narg, char *arg[])
10: PIApplicationGen()
11{
12int sxt, syt;
13
14#ifdef DEBUG_APPLX
15puts("PIApplicationX::PIApplicationX()_info : App creation");
16#endif
17mStop = true;
18topwdg = new PIWdgX(narg, arg);
19
20intcont = new PIContainerX((PIMsgHandler *)this, topwdg, "MBCont",
21 10, 10, 0, 0);
22menubar = new PIMenubar(this, "DefMenubar");
23Menubar()->SetBinding(true, false, true, false);
24sxt = ( sx > Menubar()->XSize() ) ? sx : Menubar()->XSize();
25syt = ( sy > 0 ) ? sy : 0;
26syt += Menubar()->YSize();
27MBCont()->SetSize(sxt, syt);
28if ( (sx > 0) && (sy > 0) )
29 {
30 topcont = new PIContainerX(MBCont(), "TopLevelCont",
31 sx, sy, 0, Menubar()->YSize());
32 topcont->SetBinding(true, false, true, true);
33 topcont->Show();
34 }
35else topcont = MBCont();
36
37MBCont()->Show();
38topwdg->Manage();
39}
40
41/* --Methode-- */
42PIApplicationX::~PIApplicationX()
43{
44#ifdef DEBUG_APPLX
45puts("PIApplicationX::~PIApplicationX()_info : App delete");
46#endif
47topwdg->Unmanage();
48delete topcont;
49delete topwdg;
50exit(0);
51}
52
53/* --Methode-- */
54void PIApplicationX::Run()
55{
56XEvent evt;
57#ifdef DEBUG_APPLX
58puts("PIApplicationX::Run()_info : App Run ");
59#endif
60
61topwdg->SetSize(MBCont()->XSize(), MBCont()->YSize());
62
63while (mStop)
64 {
65 XtNextEvent(&evt);
66 XtDispatchEvent(&evt);
67 }
68return;
69}
Note: See TracBrowser for help on using the repository browser.