Changeset 78 in Sophya
- Timestamp:
- Feb 23, 1998, 10:00:35 AM (28 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/piapplgen.h
r75 r78 6 6 #include PICONT_H 7 7 #include PIMENUBAR_H 8 9 #include "picons.h" 8 10 9 11 class PIApplicationGen : public PIMsgHandler { … … 31 33 virtual int PrefYSize() = 0; 32 34 35 virtual void RedirectSdtOut(PIConsole* cons) = 0; 36 33 37 protected: 34 38 PIContainer *topcont; -
trunk/SophyaPI/PI/piapplx.cc
r75 r78 5 5 6 6 7 #define DEBUG_APPLX 7 // Pour rediriger stdout 8 #include <unistd.h> 9 #include <fcntl.h> 10 11 12 // #define DEBUG_APPLX 8 13 9 14 static Cursor a_curs[3]; … … 153 158 154 159 160 /* Call-Back - Fonction privee de ce fichier */ 161 static void redirectstdout_callback(XtPointer, int *, XtInputId*); 162 163 static PIConsole* curconstdout = NULL; 164 165 static void redirectstdout_callback(XtPointer /*cld*/, int * fd, XtInputId* /*iid*/) 166 { 167 char buff[128]; 168 int nr; 169 while ( (nr=read(*fd, buff, 127)) > 0 ) { 170 buff[nr] = '\0'; curconstdout->AddStr(buff, PIVA_Def, false); 171 } 172 173 curconstdout->Refresh(); 174 } 175 176 177 /* --Methode-- */ 178 void PIApplicationX::RedirectSdtOut(PIConsole* cons) 179 { 180 if (!cons) return; 181 if (curconstdout) { curconstdout = cons; return; } 182 curconstdout = cons; 183 184 int p[2]; 185 pipe(p); 186 // Redirection de stdout : 187 close(1); 188 dup(p[1]); 189 close(p[1]); 190 fcntl(p[0], F_SETFL, O_NONBLOCK); 191 192 XtAddInput(p[0], (XtPointer) XtInputReadMask, redirectstdout_callback, NULL); 193 } -
trunk/SophyaPI/PI/piapplx.h
r76 r78 8 8 class PIApplicationX : public PIApplicationGen { 9 9 public: 10 10 PIApplicationX(int sx=200, int sy=30, int narg=0, char *arg[]=NULL); 11 11 12 virtual ~PIApplicationX();12 virtual ~PIApplicationX(); 13 13 14 virtual void Run();15 virtual void Stop() { mStop = false; }14 virtual void Run(); 15 virtual void Stop() { mStop = false; } 16 16 17 virtual void SetReady();18 virtual void SetBusy();19 virtual void SetBlocked();17 virtual void SetReady(); 18 virtual void SetBusy(); 19 virtual void SetBlocked(); 20 20 21 virtual int PrefXSize(); 22 virtual int PrefYSize(); 21 virtual int PrefXSize(); 22 virtual int PrefYSize(); 23 virtual void RedirectSdtOut(PIConsole* cons); 23 24 24 PIContainer* MBCont() { return intcont; }25 PIContainer* MBCont() { return intcont; } 25 26 protected: 26 27 PIWdg * topwdg; -
trunk/SophyaPI/PI/picons.cc
r77 r78 8 8 9 9 10 #define DEBUG_PICONS 110 // #define DEBUG_PICONS 1 11 11 12 12 // Le menu qui va servir a changer de fontes, couleurs, ... … … 65 65 66 66 ActivateKeyboard(); 67 ActivateButton(1); //Pour permettre la selection67 // ActivateButton(1); Pour permettre la selection 68 68 ActivateButton(3); // Pour afficher le menu des options (Fontes/couleur) 69 69 Manage(); … … 151 151 mOffL = 0; 152 152 if (mScb) { 153 mScb->SetMinMax(0, NbLines()-1); 153 154 mScb->SetSize(WindNbLines()); 154 155 mScb->SetValue(NbLines()-WindNbLines()-1); … … 225 226 } 226 227 mOffL = 0; 227 if (mScb) mScb->SetValue(NbLines()-WindNbLines()-1);228 228 } 229 229 … … 240 240 void PIConsole::Keyboard(int key, PIKeyModifier kmod) 241 241 { 242 char c = ' ' ; 243 if (isprint(key)) c = key; 244 245 //printf("PIConsole::Keyboard: Key= %d (%c) Mod= %d NCmdL=%d (%d,%d)\n", 246 // key, c, (int)kmod, mNCmdL, mCCP, mCLC); 242 243 244 #ifdef DEBUG_PICONS 247 245 if ( (kmod == PIKM_Alt) ) { 248 246 char buff[128]; … … 300 298 } 301 299 } 300 #endif 302 301 303 302 if (mNCmdL < 1) return; … … 305 304 int k; 306 305 bool fgfk = false; 307 if (kmod == PIKM_Blank) { 306 307 if (kmod == PIKM_Cntl) { 308 switch (key) { 309 case 'A' : 310 case 'a' : 311 mCCP = 0; 312 break; 313 case 'E' : 314 case 'e' : 315 mCCP = mCLC; 316 break; 317 case 'K' : 318 case 'k' : 319 mCLC = mCCP; 320 break; 321 } 322 } 323 324 else if (kmod == PIKM_Alt) { 325 if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 326 } 327 328 else if (kmod == PIKM_Blank) { 308 329 switch (key) { 309 330 case PIK_Return : 310 331 case PIK_Enter : 311 332 mCmdStr[mCLC] = '\0'; 312 printf("Process()-Debug- <CR/Enter> CmdStr= %s (L=%d)\n", mCmdStr, strlen(mCmdStr) );333 // printf("Process()-Debug- <CR/Enter> CmdStr= %s (L=%d)\n", mCmdStr, strlen(mCmdStr) ); 313 334 Send( Msg(), PIMsg_OK, mCmdStr); 314 335 ClrCmd(); … … 345 366 346 367 347 /* --Methode-- */368 /* --Methode-- 348 369 void PIConsole::But1Press(int x, int y) 349 370 { 350 printf("PIConsole::But 3Press(%d %d ) \n", x, y);351 } 371 printf("PIConsole::But1Press(%d %d ) \n", x, y); 372 } */ 352 373 353 374 /* --Methode-- */ … … 356 377 opmc->SetMsgParent((PIMsgHandler*)this); 357 378 opmc->Show(this, x, y); 379 } 380 381 /* --Methode-- */ 382 void PIConsole::PasteSelection(unsigned int typ, void *pdata, unsigned int l) 383 { 384 if (typ != PICP_string) return; 385 int i; 386 char *pc = (char *)pdata; 387 for(i=0; i<l; i++) CmdAddChar(pc[i]); 388 UpdCmdLine(); 358 389 } 359 390 -
trunk/SophyaPI/PI/picons.h
r77 r78 39 39 virtual void Resize(); 40 40 virtual void Keyboard(int key, PIKeyModifier kmod); 41 virtual void But1Press(int x, int y);41 // virtual void But1Press(int x, int y); 42 42 virtual void But3Press(int x, int y); 43 virtual void PasteSelection(unsigned int typ, void *pdata, unsigned int l); 43 44 44 45 void DebugPrint(int cont=0); -
trunk/SophyaPI/PI/pistdwdgx.cc
r41 r78 468 468 if (min >= max) max = min+100; 469 469 if (mVal < min) mVal = min; 470 if (mVal > max ) mVal = max;470 if (mVal > max-mSz) mVal = max-mSz; 471 471 int n=0; 472 472 Arg warg[3];
Note:
See TracChangeset
for help on using the changeset viewer.