Changeset 1263 in Sophya
- Timestamp:
- Oct 31, 2000, 9:40:50 AM (25 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Tests/pit0.cc
r366 r1263 227 227 char strg[64]; 228 228 229 printf("DBG-PITApp::Process() Msg= %d (%d - %d) Sender=%lx (This=%lx) \n", 230 (int)msg, (int)UserMsg(msg),(int)ModMsg(msg), (long)sender, (long)this); 231 229 232 // Gestion des actions en fonctions des messages 230 233 -
trunk/SophyaPI/PI/Tests/pitgr.cc
r458 r1263 113 113 int i,j; 114 114 115 printf("DBG-PITApp::Process() Msg= %d (%d - %d) Sender=%lx (This=%lx) \n", 116 (int)msg, (int)UserMsg(msg),(int)ModMsg(msg), (long)sender, (long)this); 117 115 118 if ( ( ModMsg(msg) == PIMsg_Active) || (ModMsg(msg) == PIMsg_Close) ) { 116 119 PIWdg *sndw; … … 122 125 mCurW = NULL; } 123 126 else mCurW = (PIWindow *)sender; 127 } 128 else if (sender == this) { 129 printf(" PIMsg_Close from Application !!! \n"); 130 return; 124 131 } 125 132 } … … 369 376 370 377 default : 371 //printf("PITApp::Process() Msg= %d (%d - %d)??? \n",372 //(int)msg, (int)UserMsg(msg),(int)ModMsg(msg));378 printf("PITApp::Process() Msg= %d (%d - %d)??? \n", 379 (int)msg, (int)UserMsg(msg),(int)ModMsg(msg)); 373 380 break; 374 381 } … … 402 409 app->Run(); 403 410 411 printf("Apres app->Run(); \n"); 404 412 delete cmap; 405 413 delete app; -
trunk/SophyaPI/PI/piapplx.cc
r1133 r1263 2 2 #include <X11/cursorfont.h> 3 3 #include <X11/IntrinsicP.h> 4 #include <X11/Shell.h> 5 #include <X11/StringDefs.h> 6 #include <Xm/Xm.h> 4 7 #include "piapplx.h" 5 8 #include "picontainerx.h" … … 79 82 { 80 83 } 84 85 // --------------------------------------------- 86 // Fonction pour gestion des close-window 87 88 /* Nouvelle-Fonction */ 89 static int fgactl = 0; 90 91 static void CloseWindow (Widget w, XEvent*, String*,Cardinal*) 92 { 93 XtCallCallbacks(w, XtNpopdownCallback, NULL); 94 } 95 96 /* Nouvelle-Fonction */ 97 static void popdwn_cb_app(Widget /*w*/, XtPointer *usd, XtPointer * ) 98 { 99 PIApplicationX * app = (PIApplicationX *) usd; 100 app->SendSelf(0,PIMsg_Close, NULL) ; 101 } 102 81 103 82 104 /* --Methode-- */ … … 134 156 135 157 topwdg->Manage(); 158 159 // ------------------------------------------------------ 160 // Pour la gestion des close window des Window manager 161 162 if (fgactl == 0) { 163 XtActionsRec desact = {(char *)"CloseWindow" ,CloseWindow}; 164 int szx, szy, szf; 165 XtAppContext * appctx = PIXtAppCtx(szx, szy, szf); 166 XtAppAddActions(*appctx, &desact, 1); 167 Display *mdsp; 168 mdsp = XtDisplay (topwdg->XtWdg()); 169 Atom wmd; 170 wmd = XInternAtom(mdsp, "WM_DELETE_WINDOW",False); 171 XSetWMProtocols(mdsp, XtWindow(topwdg->XtWdg()), &wmd, 1); 172 fgactl = 1; 173 } 174 175 XtTranslations trans; 176 trans = XtParseTranslationTable("<Message>WM_PROTOCOLS:CloseWindow()"); 177 XtOverrideTranslations(topwdg->XtWdg() , trans); 178 Arg warg[2]; 179 XtSetArg(warg[0], XmNdeleteResponse, XmDO_NOTHING); 180 XtSetValues(topwdg->XtWdg(), warg, 1); 181 182 XtAddCallback(topwdg->XtWdg(), XtNpopdownCallback, 183 (XtCallbackProc)popdwn_cb_app, (XtPointer)this); 184 185 // ------------------------------------------------------ 186 136 187 cur_piapp = this; 137 188 mState = -1; -
trunk/SophyaPI/PI/piversion.h
r1124 r1263 2 2 #define PIVERSION_H_SEEN 3 3 4 #define PI_VERSIONNUMBER 2.7 4 #define PI_VERSIONNUMBER 2.72 5 5 6 6 #endif -
trunk/SophyaPI/PI/piwindowx.cc
r425 r1263 20 20 } 21 21 22 23 /* Nouvelle-Fonction */24 static int fgactl = 0;25 26 static void CloseWindow (Widget w, XEvent*, String*,Cardinal*)27 {28 XtCallCallbacks(w, XtNpopdownCallback, NULL);29 }30 22 31 23 /* *** ATTENTION *** La constante ci-dessous PIXMFORMFRACBASE … … 80 72 (XtCallbackProc)popdwn_cb, (XtPointer)this); 81 73 82 if (fgactl == 0)83 {84 XtActionsRec desact = {(char *)"CloseWindow" ,CloseWindow};85 int szx, szy, szf;86 XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);87 XtAppAddActions(*appctx, &desact, 1); fgactl = 1;88 }89 74 90 75 trans = XtParseTranslationTable("<Message>WM_PROTOCOLS:CloseWindow()");
Note:
See TracChangeset
for help on using the changeset viewer.