#include #include "piapplx.h" #include "picontainerx.h" #define DEBUG_APPLX /* --Methode-- */ PIApplicationX::PIApplicationX(int sx, int sy, int narg, char *arg[]) : PIApplicationGen() { int sxt, syt; #ifdef DEBUG_APPLX puts("PIApplicationX::PIApplicationX()_info : App creation"); #endif mStop = true; topwdg = new PIWdgX(narg, arg); intcont = new PIContainerX((PIMsgHandler *)this, topwdg, "MBCont", 10, 10, 0, 0); menubar = new PIMenubar(this, "DefMenubar"); Menubar()->SetBinding(true, false, true, false); sxt = ( sx > Menubar()->XSize() ) ? sx : Menubar()->XSize(); syt = ( sy > 0 ) ? sy : 0; syt += Menubar()->YSize(); MBCont()->SetSize(sxt, syt); if ( (sx > 0) && (sy > 0) ) { topcont = new PIContainerX(MBCont(), "TopLevelCont", sx, sy, 0, Menubar()->YSize()); topcont->SetBinding(true, false, true, true); topcont->Show(); } else topcont = MBCont(); MBCont()->Show(); topwdg->Manage(); } /* --Methode-- */ PIApplicationX::~PIApplicationX() { #ifdef DEBUG_APPLX puts("PIApplicationX::~PIApplicationX()_info : App delete"); #endif topwdg->Unmanage(); delete topcont; delete topwdg; exit(0); } /* --Methode-- */ void PIApplicationX::Run() { XEvent evt; #ifdef DEBUG_APPLX puts("PIApplicationX::Run()_info : App Run "); #endif topwdg->SetSize(MBCont()->XSize(), MBCont()->YSize()); while (mStop) { XtNextEvent(&evt); XtDispatchEvent(&evt); } return; }