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

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

Commit avant modif PIOPtMenu et PISignButton (Reza)

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, true, true, false);
24sxt = ( sx > Menubar()->XSize() ) ? sx : Menubar()->XSize();
25syt = ( sy > 0 ) ? sy : 0;
26//syt += Menubar()->YSize();
27syt += 40;
28MBCont()->SetSize(sxt, syt);
29if ( (sx > 0) && (sy > 0) )
30 {
31 topcont = new PIContainerX(MBCont(), "TopLevelCont",
32 sx, sy, 0, 40);
33 topcont->SetBinding(true, true, true, true);
34 topcont->Show();
35 }
36else topcont = MBCont();
37
38MBCont()->Show();
39topwdg->Manage();
40}
41
42/* --Methode-- */
43PIApplicationX::~PIApplicationX()
44{
45#ifdef DEBUG_APPLX
46puts("PIApplicationX::~PIApplicationX()_info : App delete");
47#endif
48topwdg->Unmanage();
49delete menubar;
50if (topcont != MBCont()) delete topcont;
51delete intcont;
52delete topwdg;
53exit(0);
54}
55
56/* --Methode-- */
57void PIApplicationX::Run()
58{
59XEvent evt;
60#ifdef DEBUG_APPLX
61puts("PIApplicationX::Run()_info : App Run ");
62#endif
63
64topwdg->SetSize(MBCont()->XSize(), MBCont()->YSize());
65
66while (mStop)
67 {
68 XtNextEvent(&evt);
69 XtDispatchEvent(&evt);
70 }
71return;
72}
Note: See TracBrowser for help on using the repository browser.