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

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

Modifs avant Presentation 21,22/02 + Ajout fichiers MAC (Reza+Eric, 19/02/96)

File size: 1.5 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 menubar;
49if (topcont != MBCont()) delete topcont;
50delete intcont;
51delete topwdg;
52exit(0);
53}
54
55/* --Methode-- */
56void PIApplicationX::Run()
57{
58XEvent evt;
59#ifdef DEBUG_APPLX
60puts("PIApplicationX::Run()_info : App Run ");
61#endif
62
63topwdg->SetSize(MBCont()->XSize(), MBCont()->YSize());
64
65while (mStop)
66 {
67 XtNextEvent(&evt);
68 XtDispatchEvent(&evt);
69 }
70return;
71}
Note: See TracBrowser for help on using the repository browser.