Changeset 60 in Sophya
- Timestamp:
- Nov 5, 1997, 6:41:33 PM (28 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/ex_dessin.cc
r11 r60 17 17 str[20] = '\0'; 18 18 19 ActivateKeyboard();20 ActivateButton(1);21 ActivateButton(2);22 ActivateButton(3);23 19 } 24 20 … … 148 144 buf[0] = key; buf[1] = '\0'; 149 145 146 printf("ExBWdg::Keyboard: Key= %d (%c) , Mod= %d \n", key, (char)key, (int)kmod); 150 147 SelFont(PI_BigSizeFont, PI_BoldFont); 151 148 DrawString(20, 75, buf); -
trunk/SophyaPI/PI/piapplx.cc
r52 r60 9 9 static Cursor a_curs[3]; 10 10 static bool a_fgcur=false; 11 12 // Voir fichier pimenux.cc , Pour resoudre certains conflits avec les WindowManagers 13 void SetTopWdgForMenuX(SysDWdg mtw); 11 14 12 15 /* --Methode-- */ … … 24 27 intcont = new PIContainerX((PIMsgHandler *)this, topwdg, "MBCont", 25 28 10, 10, 0, 0); 29 // Pb avec les Popup MenuX et certains Window Manager , voir pimenux.cc 30 SetTopWdgForMenuX(intcont->XtWdg()); 31 26 32 menubar = new PIMenubar(this, "DefMenubar"); 27 33 Menubar()->SetBinding(PIBK_fixed, PIBK_fixed, PIBK_fixed, PIBK_free); -
trunk/SophyaPI/PI/pibwdggen.h
r52 r60 10 10 #include <list> 11 11 12 enum PIKeyModifier { PIKM_Blank = 0, PIKM_Shift = 1, PIKM_Alt = 2, PIKM_Cntl = 4 } ; 12 13 13 enum PIKeyModifier { PIKM_Blank = 0, PIKM_Shift = 1, PIKM_Alt = 2, PIKM_Cntl = 4 } ; 14 enum PIKeyValues { PIK_Return = 1+0x2000, PIK_Enter = 2+0x2000 , 15 PIK_BackSpace = 3+0x2000, PIK_Delete = 4+0x2000, 16 PIK_Tab = 5+0x2000, PIK_Escape = 6+0x2000, 17 PIK_Up = 11+0x2000, PIK_Down = 12+0x2000, 18 PIK_Right = 13+0x2000, PIK_Left = 14+0x2000, 19 PIK_Previous = 21+0x2000, PIK_Next = 22+0x2000 } ; 14 20 15 21 enum PIColors { PI_NotDefColor = -1, … … 56 62 57 63 virtual long kind() {return ClassId; } 58 59 // Activation des evenements60 virtual void ActivatePtrCross() = 0;61 virtual void ActivateButton(int bid) = 0;62 virtual void ActivateMove(int bid) = 0;63 virtual void ActivateKeyboard() = 0;64 64 65 65 // Trace graphiques -
trunk/SophyaPI/PI/pibwdgmac.cc
r52 r60 24 24 } 25 25 26 27 /* --Methode-- */28 void PIBaseWdgMac::ActivatePtrCross()29 {30 // toujours actif pour le moment31 }32 33 34 /* --Methode-- */35 void PIBaseWdgMac::ActivateButton(int /*bid*/)36 {37 }38 39 /* --Methode-- */40 void PIBaseWdgMac::ActivateMove(int /*bid*/)41 {42 }43 44 45 /* --Methode-- */46 void PIBaseWdgMac::ActivateKeyboard()47 {48 }49 26 50 27 /* --Methode-- */ -
trunk/SophyaPI/PI/pibwdgmac.h
r52 r60 17 17 int sx=10, int sy=10, int px=0, int py=0); 18 18 virtual ~PIBaseWdgMac(); 19 20 // Activation des evenements21 virtual void ActivatePtrCross();22 virtual void ActivateButton(int bid);23 virtual void ActivateMove(int bid);24 virtual void ActivateKeyboard();25 19 26 20 // Trace graphiques -
trunk/SophyaPI/PI/pibwdgx.cc
r52 r60 48 48 XtSetArg(wargs[2],XtNborderWidth, (Dimension)0); 49 49 XtSetValues(XtWdg(), wargs, 3); 50 51 XtUninstallTranslations(XtWdg()); 50 52 51 53 mDefGC = XCreateGC (PIXDisplay(), XtWindow(PIXtTopWdg()), 0, NULL); … … 63 65 SelMarker(1, PI_DotMarker); 64 66 67 // On active tous les evenements ... 68 ActivatePtrCross(); 69 ActivateKeyboard(); 70 int i; 71 for(i=1; i<=3; i++) { 72 ActivateButton(i); 73 ActivateMove(i); 74 } 65 75 Manage(); 66 76 } -
trunk/SophyaPI/PI/pibwdgx.h
r52 r60 17 17 18 18 virtual void FinishCreate(); // appele par la fenetre mere, apres XtRealize() 19 20 // Activation des evenements21 virtual void ActivatePtrCross();22 virtual void ActivateButton(int bid);23 virtual void ActivateMove(int bid);24 virtual void ActivateKeyboard();25 19 26 20 // Trace graphiques … … 98 92 void Init(); 99 93 void SelectFont(int isz, int jat); 94 // Activation des evenements 95 void ActivatePtrCross(); 96 void ActivateButton(int bid); 97 void ActivateMove(int bid); 98 void ActivateKeyboard(); 100 99 101 100 GC mDefGC; -
trunk/SophyaPI/PI/picontainerx.cc
r52 r60 8 8 : PIContainerGen(par, nom, sx, sy, px, py) 9 9 { 10 if ((sx > 0) && (sy > 0)) 10 if ((sx > 0) && (sy > 0)) 11 11 CreateXtWdg(nom, xmFormWidgetClass , NULL, sx, sy, px, py); 12 12 // CreateXtWdg(nom, xmBulletinBoardWidgetClass , NULL, sx, sy, px, py); … … 18 18 { 19 19 SetMsgParent(par); 20 if ((sx > 0) && (sy > 0)) 20 if ((sx > 0) && (sy > 0)) 21 21 CreateXtWdg(nom, xmFormWidgetClass , parwdg->XtWdg(), sx, sy, px, py); 22 22 } -
trunk/SophyaPI/PI/piimage.cc
r59 r60 52 52 SelForeground(PI_White); 53 53 SelBackground(PI_Black); 54 55 ActivateButton(1);56 ActivateMove(1);57 ActivateButton(2);58 ActivateMove(2);59 ActivateButton(3);60 ActivateMove(3);61 54 62 55 } -
trunk/SophyaPI/PI/pimenux.cc
r56 r60 11 11 /************* PIMenuX ************/ 12 12 13 // Quand on cree les menus comme fils du Top-Widget, ca rentre en 14 // conflit avec certaains Window-Manager ... 15 // La fonction suivante permet de bypasser ce probleme- Le createur d'application 16 // X doit donc appeler la fonction ci-dessous pour initialiser menuXTopWdg 17 // Reza /411/97 18 static SysDWdg menuXTopWdg = NULL; 19 void SetTopWdgForMenuX(SysDWdg mtw) { 20 menuXTopWdg = mtw; 21 } 22 13 23 // Pour ces sal... de XmString (ds piwdgx.cc) 14 24 int CStrFrXmStr(XmString xms, char* buff, int nmx); 25 15 26 16 27 // Fonction prive (CallBack) … … 43 54 mBut = new _pimxit_[mNItemMax]; 44 55 56 SysDWdg tw= menuXTopWdg; 57 if (tw == NULL) tw = PIXtTopWdg(); 58 45 59 if (pdpu == k_PopupMenu) 46 XtWdg() = XmCreatePopupMenu( PIXtTopWdg(), nom, NULL, 0);60 XtWdg() = XmCreatePopupMenu( tw, nom, NULL, 0); 47 61 else 48 XtWdg() = XmCreatePulldownMenu( PIXtTopWdg(), nom, NULL, 0);62 XtWdg() = XmCreatePulldownMenu( tw, nom, NULL, 0); 49 63 50 64 wmis = k_wmi_normal ; -
trunk/SophyaPI/PI/pipixmapgen.cc
r49 r60 22 22 cmap = new PIColorMap(CMAP_GREY32); 23 23 mEn = 0; 24 ActivateButton(1);25 24 } 26 25 -
trunk/SophyaPI/PI/piscdrawwdg.cc
r54 r60 18 18 mTrW = NULL; 19 19 SetTextWin(NULL); 20 21 ActivateButton(1); // Pour pouvoir activer la fenetre et coordonnees22 ActivateMove(1); // " " " "23 ActivateButton(2);24 ActivateMove(2);25 20 26 21 } -
trunk/SophyaPI/PI/pitestapp.cc
r23 r60 20 20 #include "piimage.h" 21 21 22 #include PILIST_H 23 22 24 #include "fitsimage.h" 25 26 #include <X11/Xlib.h> 23 27 24 28 int SysBeep(int n) … … 95 99 : PIApplication(sx, sy) 96 100 { 101 char ans[128]; 97 102 // menb = new PIMenubar(this, "MyMenubar"); 98 103 m[0] = new PIPDMenu((PIMsgHandler *)Menubar(),"File"); … … 100 105 m[0]->AppendItem("Close", 10102); 101 106 m[0]->AppendItem("New", 10103); 107 m[0]->AppendItem("ScBar", 10105); 102 108 m[0]->AppendItem("Quit", 10104); 103 109 m[1] = new PIPDMenu((PIMsgHandler *)Menubar(),"Edit"); … … 124 130 bouton4 = new PIButton(this->MainWin(), "Dialog", 333, 40, 25, 200, 120); 125 131 bouton5 = new PIButton(this->MainWin(), "ScDraw", 433, 40, 25, 260, 120); 126 scl = new PIScale(this->MainWin(), "Scale", 88, 5, 45, 100, 20, 10, 150);127 132 scl = new PIScale(this->MainWin(), "Scale", 88, true, 100, 20, 10, 150); 133 scl->SetMinMax(5, 45); 128 134 zoom = new PIPixmap(this->MainWin(), "Zoom", 100,100,5,195); 129 135 labimg = new PILabel(this->MainWin(), "PixelValue", 250, 20, 10, 320); 130 136 131 menu = new PIPUMenu((PIMsgHandler *)this, "myMenu"); 137 // XSync(PIXDisplay(), FALSE); 138 // printf("Creation PIPUMenu DoIt-1... \n"); gets(ans); 139 menu = new PIPUMenu((PIMsgHandler *)this->MainWin(), "myMenu"); 140 // XSync(PIXDisplay(), FALSE); 141 // printf("Apres Creation PIPUMenu -AppendItem() 1 ... \n"); gets(ans); 142 132 143 menu->AppendItem("DoIt-1", 4401); 144 // XSync(PIXDisplay(), FALSE); 145 // printf("Apres Creation PIPUMenu -AppendItem() 2 ... \n"); gets(ans); 146 133 147 menu->AppendItem("DoIt-2", 4402); 134 148 menu->AppendItem("DoIt-25", 4425); … … 137 151 menu->AppendItem("Check-33", 4433); 138 152 139 pum[1] = new PIPUMenu((PIMsgHandler *)this,"Edit"); 153 // XSync(PIXDisplay(), FALSE); 154 // printf("Creation PIPUMenu Copier ... \n"); gets(ans); 155 pum[1] = new PIPUMenu((PIMsgHandler *)this->MainWin(),"Edit"); 140 156 pum[1]->AppendItem("Copier", 80201); 141 157 pum[1]->AppendItem("Coller", 80202); … … 144 160 pum[1]->AppendItem("Select-All", 80205); 145 161 146 pum[0] = new PIPUMenu((PIMsgHandler *)this , "myMenu");162 pum[0] = new PIPUMenu((PIMsgHandler *)this->MainWin(), "myMenu"); 147 163 pum[0]->AppendItem("Linear", 5601); 148 164 pum[0]->AppendItem("Log.", 5602); … … 151 167 pum[0]->AppendItem("Polyn", 5605); 152 168 169 153 170 opt = new PIOptMenu(this->MainWin(), pum[0], 90, 25, 110, 150); 154 171 opt->SetValueStr("Sqrt"); … … 157 174 opt3 = new PIOptMenu(this->MainWin(), pum[0], 80, 25, 110, 250); 158 175 opt3->SetValueStr("Linear"); 159 176 160 177 } 161 178 … … 188 205 static PIImage *cur=NULL; 189 206 static ScSample *scs1, *scs2, *scs3; 207 static PIScrollBar *scb, *scb2; 190 208 static ExBWdg *exb1; 191 209 192 static PIWindow * wp3, *wp2, *wp4, *wp5 ;210 static PIWindow * wp3, *wp2, *wp4, *wp5, *wp6; 193 211 static PIPixmap * pxm; 194 212 static unsigned char pixels[25000]; … … 198 216 static bool fgt2 = false; 199 217 218 static PIListX * pil; 219 200 220 void 201 221 PITestApp::Process(PIMessage msg, PIMsgHandler* sender, void* data) … … 208 228 sprintf(truc,"< %ld - %d (%d)>",msg,x++, (int)((PIWdgGen *)sender)->kind()); 209 229 this->label->SetLabel(truc); 210 sprintf(truc,"[%d] Msg= %ld (%d-%d) Kind=(%d) ",x, msg, (int)UserMsg(msg),211 (int)ModMsg(msg), (int)((PIWdgGen *)sender)->kind() );230 sprintf(truc,"[%d] Msg= %ld (%d-%d) Kind=(%d) Data= (%d - %lx)",x, msg, (int)UserMsg(msg), 231 (int)ModMsg(msg), (int)((PIWdgGen *)sender)->kind(), (int)data, (long)data); 212 232 puts(truc); 213 233 … … 252 272 if (msg == 433) 253 273 { 254 if (fgt2) { wp5->Hide(); fgt2 = false; }255 else { wp5->Show(); fgt2 = true; }274 if (fgt2) { wp5->Hide(); wp6->Hide(); fgt2 = false; } 275 else { wp5->Show(); wp6->Show(); fgt2 = true; } 256 276 } 257 277 258 278 // if (msg == 555) (this->menu)->Show(); 259 279 280 if (msg == 10105) scb->SetSize(atoi(((char *)text->GetText().c_str()))); 260 281 if (msg == 10104) Stop(); 261 282 if (msg == 10101) { pfc->AcceptNewFile(false); pfc->Show(); } … … 265 286 { 266 287 numsg++; 267 m[1]->AppendItem((char *)text->GetText().c_str(), numsg); 288 string nit; 289 nit = text->GetText(); 290 m[1]->AppendItem((char *)nit.c_str(), numsg); 268 291 opt2->SetValue(numsg); 269 292 } … … 272 295 if (msg == 10303) 273 296 { 274 long ml = atol(text->GetText().c_str()); 297 string nit; 298 nit = text->GetText(); 299 long ml = atol(nit.c_str()); 275 300 m[1]->DeleteItemMsg(ml); 276 301 opt2->SetValue(10201); … … 278 303 279 304 280 if ((msg > 8000) && data) printf("PITestApp::MenubarReturn: %s \n", (char *)data);305 if ((msg > 9000) && data) printf("PITestApp::MenubarReturn: %s \n", (char *)data); 281 306 if (msg == 5000) 282 307 { … … 306 331 } 307 332 308 int main() 309 { 333 int main(int narg, char *arg[]) 334 { 335 int mii; 336 310 337 PITestApp * app; 311 338 app = new PITestApp(350, 350); 312 339 313 wp2 = new PIWindow(app, "Window-2", PIWK_normal, 150, 150, 250, 250); 314 ExBWdg bw(wp2, "BWdg", 150, 150, 0, 0); 315 // bw.ActivateButton(1); 316 // bw.ActivatePtrCross(); 317 // bw.ActivateKeyboard(); 318 340 wp2 = new PIWindow(app, "Window-2", PIWK_normal, 200, 200, 250, 250); 341 ExBWdg bw(wp2, "BWdg", 150, 150, 10, 40); 342 bw.SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_fixed); 319 343 320 344 wp4 = new PIWindow(app, "Window-4", PIWK_dialog, 200, 200, 350, 350); … … 340 364 pxm->SetPixmap(pixels, 150, 150); 341 365 342 wp5 = new PIWindow(app, "Window-5", PIWK_normal, 4 00, 450, 200, 200);366 wp5 = new PIWindow(app, "Window-5", PIWK_normal, 420, 450, 200, 200); 343 367 scs1 = new ScSample(wp5, "ScSample", 200, 200, 0, 0); 344 368 scs1->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic); 345 369 scs2 = new ScSample(wp5, "ScSample", 160, 160, 220, 20); 346 scs2->SetBinding(PIBK_elastic,PIBK_fixed,PIBK_fixed,PIBK_elastic); 370 printf("DBG-WP5 (A) , SCS2, SzC %d %d , Sz %d %d Pos %d %d \n", wp5->XSize(), 371 wp5->YSize(), scs2->XSize(), scs2->YSize(),scs2->XPos(), scs2->YPos() ); 372 // scs2->SetBinding(PIBK_elastic,PIBK_fixed,PIBK_fixed,PIBK_elastic); 373 scs2->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic); 374 printf("DBG-WP5 (B) , SCS2, SzC %d %d , Sz %d %d Pos %d %d \n", wp5->XSize(), 375 wp5->YSize(), scs2->XSize(), scs2->YSize(),scs2->XPos(), scs2->YPos() ); 376 377 scb = new PIScrollBar(wp5, "ScBar", 8811, true, 15, 420, 405, 0); 378 scb->SetBinding(PIBK_free,PIBK_fixed,PIBK_fixed,PIBK_fixed); 379 scb->ActivateDrag(true); 380 scb2 = new PIScrollBar(wp5, "ScBar", 8821, false, 420, 15, 0, 425); 381 scb2->SetBinding(PIBK_fixed,PIBK_free,PIBK_fixed,PIBK_fixed); 347 382 348 383 scs3 = new ScSample(wp5, "ScSample", 200, 200, 100, 220); 349 350 384 scs3->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic); 351 385 /* … … 358 392 pfc->SetPath("/exp/eros/ImagRed/"); 359 393 360 394 wp6 = new PIWindow(app, "Window-List", PIWK_normal, 200, 250, 300, 400); 395 pil = new PIListX(wp6, "MyList", 200, 250, 0, 0); 396 pil->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed,PIBK_fixed); 397 for(mii=1; mii<narg; mii++) 398 { 399 printf("AppendItem[%d] - %s (%ld) \n", mii, arg[mii], 3330+mii); 400 pil->AppendItem(arg[mii], 3330+mii); 401 puts("Append-OK"); 402 } 403 pil->SetMultipleSelect(true); 404 pil->SelectItem("user.cc"); 361 405 // Int32 ioNumber = 100; 362 406 app->Run(); -
trunk/SophyaPI/PI/piup.h
r37 r60 1 1 #include "cimage.h" 2 2 extern "C" { 3 3 RzImage * PIUserProc_1(ImageR4& myimg, int xp, int yp, int dx, int dy, 4 4 char * arg1, char * arg2); … … 7 7 RzImage * PIUserProc_3(ImageR4& myimg, int xp, int yp, int dx, int dy, 8 8 char * arg1, char * arg2); 9 } 10 -
trunk/SophyaPI/PI/piwdgx.cc
r56 r60 244 244 PIBindingKind right, PIBindingKind bottom) 245 245 { 246 Arg wargs[ 3];246 Arg wargs[9]; 247 247 int n=0; 248 248 if (!sdw) return; 249 249 if (!parent) return; 250 250 251 /* 251 int fbase = 1000 ; // Valeur de XmNfractionBase des XmForm ds PIContainerX 252 int frpos = 0; 253 float frac; 254 252 255 n = 0; 253 XtSetArg(wargs[n],XmNfractionBase, 500); n++; 254 XtSetValues(this->sdw, wargs, n); 255 */ 256 XtSetArg(wargs[n],XmNfractionBase, fbase); n++; 257 XtSetValues(parent->XtWdg(), wargs, n); 258 259 // printf(" DEBUG_SetBinding: C-Sz= %d %d - Sz=%d %d , Pos= %d %d \n", parent->XSize(), 260 // parent->YSize(), XSize(), YSize(), XPos(), YPos()); 256 261 switch (left) 257 262 { 258 263 case PIBK_free : 259 n = 0;260 264 XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE); n++; 261 XtSetValues(this->sdw, wargs, n);262 265 break; 263 266 case PIBK_fixed : 264 n = 0;265 267 XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_FORM); n++; 266 268 XtSetArg(wargs[n],XmNleftOffset, XPos() ); n++; 267 XtSetValues(this->sdw, wargs, n);268 269 break; 269 270 case PIBK_elastic : 270 n = 0;271 271 XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_POSITION); n++; 272 XtSetArg(wargs[n],XmNleftPosition, (XPos()*100/parent->XSize()) ); n++; 273 XtSetValues(this->sdw, wargs, n); 272 frac = (float)(XPos())/(float)parent->XSize() ; 273 frpos = frac*fbase; 274 XtSetArg(wargs[n],XmNleftPosition, frpos ); n++; 274 275 break; 275 276 } … … 278 279 { 279 280 case PIBK_free : 280 n = 0;281 281 XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_NONE); n++; 282 XtSetValues(this->sdw, wargs, n);283 282 break; 284 283 case PIBK_fixed : 285 n = 0;286 284 XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_FORM); n++; 287 285 XtSetArg(wargs[n],XmNtopOffset, YPos() ); n++; 288 XtSetValues(this->sdw, wargs, n);289 286 break; 290 287 case PIBK_elastic : 291 n = 0;292 288 XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_POSITION); n++; 293 XtSetArg(wargs[n],XmNtopPosition, (YPos()*100/parent->YSize()) ); n++; 294 XtSetValues(this->sdw, wargs, n); 289 frac = (float)(YPos())/(float)parent->YSize() ; 290 frpos = frac*fbase; 291 XtSetArg(wargs[n],XmNtopPosition, frpos ); n++; 295 292 break; 296 293 } … … 299 296 { 300 297 case PIBK_free : 301 n = 0;302 298 XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_NONE); n++; 303 XtSetValues(this->sdw, wargs, n);304 299 break; 305 300 case PIBK_fixed : 306 n = 0;307 301 XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM); n++; 308 302 XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) ); n++; 309 XtSetValues(this->sdw, wargs, n);310 303 break; 311 304 case PIBK_elastic : 312 n = 0;313 305 XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_POSITION); n++; 314 XtSetArg(wargs[n],XmNrightPosition, ((XPos()+XSize())*100/parent->XSize()) ); n++; 315 XtSetValues(this->sdw, wargs, n); 306 frac = (float)(XPos()+XSize())/(float)parent->XSize() ; 307 frpos = frac*fbase; 308 XtSetArg(wargs[n],XmNrightPosition, frpos ); n++; 316 309 break; 317 310 } … … 320 313 { 321 314 case PIBK_free : 322 n = 0;323 315 XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_NONE); n++; 324 XtSetValues(this->sdw, wargs, n);325 316 break; 326 317 case PIBK_fixed : 327 n = 0;328 318 XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_FORM); n++; 329 319 XtSetArg(wargs[n],XmNbottomOffset, parent->YSize()-(YSize()+YPos()) ); n++; 330 XtSetValues(this->sdw, wargs, n);331 320 break; 332 321 case PIBK_elastic : 333 n = 0;334 322 XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_POSITION); n++; 335 XtSetArg(wargs[n],XmNbottomPosition, ((YPos()+YSize())*100/parent->YSize()) ); n++; 336 XtSetValues(this->sdw, wargs, n); 337 break; 338 } 323 frac = (float)(YPos()+YSize())/(float)parent->YSize() ; 324 frpos = frac*fbase; 325 XtSetArg(wargs[n],XmNbottomPosition, frpos ); n++; 326 break; 327 } 328 329 XtSetValues(this->sdw, wargs, n); 330 331 // printf(" Out_SetBinding: C-Sz= %d %d - Sz=%d %d , Pos= %d %d \n", parent->XSize(), 332 // parent->YSize(), XSize(), YSize(), XPos(), YPos()); 339 333 340 334 return; -
trunk/SophyaPI/PI/pixtbase.cc
r52 r60 6 6 #include <X11/IntrinsicP.h> 7 7 #include <X11/CoreP.h> 8 9 #include <X11/keysym.h> 8 10 9 11 #include "pixtbaseP.h" … … 356 358 last_time_xevt = evt->xkey.time; 357 359 last_serial_xevt = evt->xkey.serial; 360 358 361 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 359 362 { … … 361 364 KeySym key; 362 365 char buf[10]; 363 int i,nc ;366 int i,nc,rkey; 364 367 PIKeyModifier kmod; 365 368 366 369 kmod = PIKM_Blank; 367 368 370 nc = XLookupString(&(evt->xkey), buf, 10, &key, &cs); 369 if (nc <= 0) return; 371 370 372 if (evt->xkey.state & ShiftMask) 371 373 kmod = (PIKeyModifier) (kmod | PIKM_Shift); 372 374 if (evt->xkey.state & ControlMask) 373 375 kmod = (PIKeyModifier) (kmod | PIKM_Cntl); 374 if (evt->xkey.state & Mod 2Mask)376 if (evt->xkey.state & Mod1Mask) 375 377 kmod = (PIKeyModifier) (kmod | PIKM_Alt); 376 for(i=0; i<nc; i++) 378 switch (key) { 379 case XK_Return : 380 rkey = PIK_Return; 381 break; 382 case XK_KP_Enter : 383 rkey = PIK_Enter; 384 break; 385 case XK_Up : 386 rkey = PIK_Up; 387 break; 388 case XK_Down : 389 rkey = PIK_Down; 390 break; 391 case XK_Left : 392 rkey = PIK_Left; 393 break; 394 case XK_Right : 395 rkey = PIK_Right; 396 break; 397 case XK_Prior : 398 rkey = PIK_Previous; 399 break; 400 case XK_Next : 401 rkey = PIK_Next; 402 break; 403 default : 404 rkey = 0; 405 break; 406 } 407 if (rkey > 0) (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Keyboard(rkey, kmod); 408 else for(i=0; i<nc; i++) 377 409 (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Keyboard((int)(buf[i]), kmod); 378 410 } 379 411 return; 380 412 }
Note:
See TracChangeset
for help on using the changeset viewer.