source: Sophya/branches/EA_Juin98/SophyaPI/PI/piwdgx.cc@ 1036

Last change on this file since 1036 was 106, checked in by ansari, 27 years ago

1/ Optimisation LUT et P2DArrAdapter 2/ CheckItem et PullDownMenu comme
elements des Menus, 3/Possibilite de rajouter et de supprimer des Menus
dans le MenuBar
4/ Possibilite de rendre non-sensible (Sensitive/Unsensitive) les PIWdg
5/ Debut de commentaires de pistdwdg Reza 12/05/98

File size: 17.0 KB
Line 
1#include <stdlib.h>
2#include <stdio.h>
3
4#include <X11/Intrinsic.h>
5#include <X11/StringDefs.h>
6#include <X11/IntrinsicP.h>
7#include <X11/Shell.h>
8#include <X11/Core.h>
9#include <X11/CoreP.h>
10
11#include <Xm/Xm.h> // A cause des container XmForm
12#include <Xm/Form.h> // Idem
13
14#include "piwdgx.h"
15#include "picontainerx.h"
16
17
18// #define DEBUG_PIWdgX
19
20// Quelques variables statiques globales, Connection Display, Top Widget Xt, AppContext Xt ...
21// et leurs fonctions d'acces
22static SysDWdg top = NULL;
23static Display * dpy = NULL;
24// static char appname[64];
25static char appclass[64];
26static XtAppContext appctx;
27static int appSzX = 10;
28static int appSzY = 10;
29static XFontStruct * stdfnt = NULL;
30
31/* Nouvelle-Fonction */
32XtAppContext* PIXtAppCtx(int& szx, int& szy)
33{
34szx = appSzX; szy = appSzY;
35return(&appctx);
36}
37
38/* Nouvelle-Fonction */
39SysDWdg PIXtTopWdg()
40{
41return (top);
42}
43
44/* Nouvelle-Fonction */
45Display * PIXDisplay()
46{
47return(dpy);
48}
49
50/* Nouvelle-Fonction */
51void PIBeep()
52{
53XBell(dpy, 0);
54return;
55}
56
57/* Nouvelle-Fonction */
58int CStrFrXmStr(XmString xms, char* buff, int nmx)
59/* Pour recuperer le contenu d'un string Motif */
60{
61int n,l,m;
62XmStringContext cntx;
63char *txs;
64XmStringDirection dir;
65XmStringCharSet cset;
66Boolean sep;
67
68if (nmx < 2) return(0);
69n = 0; m = nmx-1; buff[0] = buff[m] = '\0';
70XmStringInitContext (&cntx, xms);
71while (m > 0)
72 {
73 if (XmStringGetNextSegment( cntx, &txs, &cset, &dir, &sep) )
74 {
75 l = strlen(txs);
76 if (m < l) txs[m] = '\0';
77 strcpy(buff+n, txs);
78 n += l; m -= l;
79 if (sep) m = -2;
80 XtFree(txs);
81 }
82 else m = -1;
83 }
84
85return(n);
86}
87
88
89/* --Methode-- */
90PIWdgX::PIWdgX(int narg, char *arg[])
91:PIWdgGen(NULL, "PITopLevel")
92{
93if (top == NULL) InitXt(narg, arg);
94sdw = top;
95wmis = k_wmi_appshell;
96stmng = false;
97#ifdef DEBUG_PIWdgX
98printf("Debug_PIWdgX::PIWdgX(int , char * []) this=%lx top=%lx \n", (long)this, (long)sdw);
99#endif
100}
101
102
103
104/* --Methode-- */
105PIWdgX::PIWdgX(PIContainerGen *par, char *nom,
106 int sx, int sy, int px, int py)
107:PIWdgGen(par, nom, sx, sy, px, py)
108{
109sdw = NULL;
110wmis = k_wmi_unknown;
111}
112
113/* --Methode-- */
114int PIWdgX::CreateXtWdg(char *nom, SysDWdgClass wdgcl, SysDWdg pwdg,
115 int sx, int sy, int px, int py)
116{
117Arg wargs[5];
118int n=0;
119
120if (pwdg == NULL)
121 {
122 if (parent == NULL)
123 {
124 if (top == NULL) InitXt();
125 pwdg = top;
126 }
127 // else pwdg = ((PIContainerX *)parent)->sdw;
128 else pwdg = ((PIWdgX *)parent)->sdw;
129 }
130
131n=0;
132if ((sx >= 0) && (sy >= 0))
133 {
134 XtSetArg(wargs[n],XtNwidth,sx); n++;
135 XtSetArg(wargs[n],XtNheight,sy); n++;
136 }
137XtSetArg(wargs[n],XtNx,px); n++;
138XtSetArg(wargs[n],XtNy,py); n++;
139
140if (wdgcl == NULL) wdgcl = coreWidgetClass;
141
142if ( (wdgcl == topLevelShellWidgetClass) ||
143 (wdgcl == transientShellWidgetClass) ||
144 (wdgcl == overrideShellWidgetClass) )
145 {
146 sdw = XtCreatePopupShell(nom, wdgcl, pwdg, wargs, n);
147 }
148else
149 {
150 sdw = XtCreateWidget(nom, wdgcl, pwdg, wargs, n);
151 }
152
153if (wdgcl == topLevelShellWidgetClass) wmis = k_wmi_toplevel;
154else if (wdgcl == transientShellWidgetClass) wmis = k_wmi_transient;
155else if (wdgcl == overrideShellWidgetClass) wmis = k_wmi_override;
156else wmis = k_wmi_normal ;
157
158stmng = false;
159#ifdef DEBUG_PIWdgX
160printf("Debug_PIWdgX::CreateXtWdg(%s) this=%lx sdw=%lx pere=%lx wmis=%d\n", nom,
161 (long)this, (long)sdw, (long)pwdg, wmis);
162#endif
163
164SetBinding(PIBK_free, PIBK_free, PIBK_free, PIBK_free);
165return(0);
166}
167
168
169/* --Methode-- */
170PIWdgX::~PIWdgX()
171{
172#ifdef DEBUG_PIWdgX
173printf("Debug_PIWdgX::~PIWdgX() %lx %lx \n", (long)this, (long)sdw);
174#endif
175if (!sdw) XtDestroyWidget(sdw);
176}
177
178
179/* --Methode-- */
180void PIWdgX::FinishCreate()
181{
182#ifdef DEBUG_PIWdgX
183printf("Debug_PIWdgX::FinishCreate() ne fait rien ! \n");
184#endif
185return;
186}
187
188
189/* --Methode-- */
190void PIWdgX::Manage()
191{
192#ifdef DEBUG_PIWdgX
193printf("Debug_PIWdgX::Manage this=%lx sdw=%lx \n", (long)this, (long)sdw);
194#endif
195if (!sdw) return;
196if (wmis != k_wmi_appshell) XtManageChild(sdw);
197else if (!XtIsRealized(sdw)) XtRealizeWidget(sdw);
198stmng = true;
199return;
200}
201
202/* --Methode-- */
203void PIWdgX::UnManage()
204{
205#ifdef DEBUG_PIWdgX
206printf("Debug_PIWdgX::UnManage this=%lx sdw=%lx \n", (long)this, (long)sdw);
207#endif
208if (!sdw) return;
209if (wmis != k_wmi_appshell)
210 XtUnmanageChild(sdw);
211stmng = false;
212return;
213}
214
215/* --Methode-- */
216bool PIWdgX::IfManaged()
217{
218return(stmng);
219}
220
221/* --Methode-- */
222bool PIWdgX::IsVisible()
223{
224if ( (XtIsRealized(XtWdg())) &&
225 ( (this->XtWdg())->core.visible) ) return(true);
226else return(false);
227}
228
229/* --Methode-- */
230void PIWdgX::SetSensitive()
231{
232XtSetSensitive(XtWdg(), TRUE);
233}
234
235/* --Methode-- */
236void PIWdgX::SetUnSensitive()
237{
238XtSetSensitive(XtWdg(), FALSE);
239}
240
241/* --Methode-- */
242bool PIWdgX::IfSensitive()
243{
244if (XtIsSensitive(XtWdg()) == TRUE) return(true);
245else return(false);
246}
247
248/* --Methode-- */
249void PIWdgX::SetSize(int sx, int sy)
250{
251#ifdef DEBUG_PIWdgX
252printf("Debug_PIWdgX::SetSize this=%lx sdw=%lx \n", (long)this, (long)sdw);
253#endif
254
255if (!sdw) return;
256/*
257Arg wargs[2];
258XtSetArg(wargs[0],XtNwidth,sx);
259XtSetArg(wargs[1],XtNheight,sy);
260XtSetValues(this->sdw, wargs, 2);
261*/
262XtResizeWidget(sdw, sx, sy, BorderWidth());
263
264return;
265}
266
267/* --Methode-- */
268void PIWdgX::SetPos(int px, int py)
269{
270if (!sdw) return;
271/*
272Arg wargs[2];
273XtSetArg(wargs[0],XtNx,px);
274XtSetArg(wargs[1],XtNy,py);
275XtSetValues(this->sdw, wargs, 2);
276*/
277XtMoveWidget(sdw, px, py);
278
279return;
280}
281
282/* --Methode-- */
283void PIWdgX::SetBinding(PIBindingKind left, PIBindingKind top,
284 PIBindingKind right, PIBindingKind bottom)
285{
286Arg wargs[9];
287int n=0;
288if (!sdw) return;
289if (!parent) return;
290
291int fbase = 1000 ; // Valeur de XmNfractionBase des XmForm ds PIContainerX
292int frpos = 0;
293float frac;
294
295n = 0;
296XtSetArg(wargs[n],XmNfractionBase, fbase); n++;
297XtSetValues(parent->XtWdg(), wargs, n);
298
299// printf(" DEBUG_SetBinding: C-Sz= %d %d - Sz=%d %d , Pos= %d %d \n", parent->XSize(),
300// parent->YSize(), XSize(), YSize(), XPos(), YPos());
301switch (left)
302 {
303 case PIBK_free :
304 XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE); n++;
305 break;
306 case PIBK_fixed :
307 XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_FORM); n++;
308 XtSetArg(wargs[n],XmNleftOffset, XPos() ); n++;
309 break;
310 case PIBK_elastic :
311 XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_POSITION); n++;
312 frac = (float)(XPos())/(float)parent->XSize() ;
313 frpos = frac*fbase;
314 XtSetArg(wargs[n],XmNleftPosition, frpos ); n++;
315 break;
316 }
317
318switch (top)
319 {
320 case PIBK_free :
321 XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_NONE); n++;
322 break;
323 case PIBK_fixed :
324 XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_FORM); n++;
325 XtSetArg(wargs[n],XmNtopOffset, YPos() ); n++;
326 break;
327 case PIBK_elastic :
328 XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_POSITION); n++;
329 frac = (float)(YPos())/(float)parent->YSize() ;
330 frpos = frac*fbase;
331 XtSetArg(wargs[n],XmNtopPosition, frpos ); n++;
332 break;
333 }
334
335switch (right)
336 {
337 case PIBK_free :
338 XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_NONE); n++;
339 break;
340 case PIBK_fixed :
341 XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM); n++;
342 XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) ); n++;
343 break;
344 case PIBK_elastic :
345 XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_POSITION); n++;
346 frac = (float)(XPos()+XSize())/(float)parent->XSize() ;
347 frpos = frac*fbase;
348 XtSetArg(wargs[n],XmNrightPosition, frpos ); n++;
349 break;
350 }
351
352switch (bottom)
353 {
354 case PIBK_free :
355 XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_NONE); n++;
356 break;
357 case PIBK_fixed :
358 XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_FORM); n++;
359 XtSetArg(wargs[n],XmNbottomOffset, parent->YSize()-(YSize()+YPos()) ); n++;
360 break;
361 case PIBK_elastic :
362 XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_POSITION); n++;
363 frac = (float)(YPos()+YSize())/(float)parent->YSize() ;
364 frpos = frac*fbase;
365 XtSetArg(wargs[n],XmNbottomPosition, frpos ); n++;
366 break;
367 }
368
369XtSetValues(this->sdw, wargs, n);
370
371// printf(" Out_SetBinding: C-Sz= %d %d - Sz=%d %d , Pos= %d %d \n", parent->XSize(),
372// parent->YSize(), XSize(), YSize(), XPos(), YPos());
373
374return;
375}
376
377
378/* --Methode-- */
379void PIWdgX::SetBorderWidth(int bw)
380{
381if (!sdw) return;
382
383Arg wargs[2];
384int n=0;
385
386XtSetArg(wargs[n],XtNborderWidth,bw); n++;
387XtSetValues(this->sdw, wargs, n);
388return;
389}
390
391/* --Methode-- */
392void PIWdgX::SetLabel(string const& lab)
393{
394XmString xmstr;
395xmstr = XmStringLtoRCreate((char *)lab.c_str(), XmSTRING_DEFAULT_CHARSET);
396int n=0;
397Arg warg[2];
398
399XtSetArg(warg[n], XmNlabelString, xmstr); n++;
400XtSetValues(XtWdg(), warg, n);
401XmStringFree(xmstr);
402return;
403}
404
405
406
407/* --Methode-- */
408int PIWdgX::XSize()
409{
410if (!sdw) return(-1);
411else return((int)this->sdw->core.width);
412}
413
414/* --Methode-- */
415int PIWdgX::YSize()
416{
417if (!sdw) return(-1);
418else return((int)this->sdw->core.height);
419}
420
421/* --Methode-- */
422int PIWdgX::XPos()
423{
424if (!sdw) return(-1);
425else return((int)this->sdw->core.x);
426}
427
428/* --Methode-- */
429int PIWdgX::YPos()
430{
431if (!sdw) return(-1);
432else return((int)this->sdw->core.y);
433}
434
435
436/* --Methode-- */
437int PIWdgX::BorderWidth()
438{
439if (!sdw) return(-1);
440Arg wargs[2];
441int bw;
442XtSetArg(wargs[0],XtNborderWidth, &bw);
443XtGetValues(this->sdw, wargs, 1);
444return(bw);
445}
446
447/* --Methode-- */
448string PIWdgX::Nom()
449{
450return(XtName(this->sdw));
451}
452
453/* --Methode-- */
454void PIWdgX::GetScreenPos(int & spx, int & spy)
455{
456PIWdgX * wc;
457Display *mdsp;
458Window w, rw, pw, *cw;
459unsigned int ncw;
460Status st;
461int x,y;
462unsigned int bw, l, h, d;
463
464spx = 0; spy = 0;
465wc = this;
466
467while (wc)
468 { spx += wc->XPos();
469 spy += wc->YPos(); wc = (PIWdgX *)wc->Parent();
470 }
471
472mdsp = XtDisplay(XtWdg());
473w = XtWindow(XtWdg());
474ncw = 0;
475st = XQueryTree(mdsp, w, &rw, &pw, &cw, &ncw);
476if (st)
477 { XFree(cw);
478 if (pw == rw) return; }
479
480while (st && (pw != rw))
481 {
482 w = pw;
483 st = XQueryTree(mdsp, w, &rw, &pw, &cw, &ncw);
484 if (st) XFree(cw);
485 XGetGeometry(mdsp, w, &rw, &x, &y, &l, &h, &bw, &d);
486 spy += y; spx += x;
487 }
488return;
489}
490
491
492// Ressources X si non definis
493static String fallback_res[22] = {
494"PeidaInt*default*background: LightGrey" ,
495"PeidaInt*background: LightGrey" ,
496"PeidaInt*bottomShadowColor: Black" ,
497"PeidaInt*default*bottomShadowColor: Black" ,
498"PeidaInt*Foreground: Black",
499"PeidaInt*default*Foreground: Black",
500"PeidaInt*topShadowColor: White",
501"PeidaInt*default*topShadowColor: White",
502"PeidaInt*borderColor: Black",
503"PeidaInt*XmLabel.borderWidth: 0",
504"PeidaInt*XmScrollBar*background: LightGrey",
505"PeidaInt*XmDrawingArea*background: Black",
506"PeidaInt*XmPushButton*borderWidth: 0",
507"PeidaInt*XmText*shadowThickness: 2",
508"PeidaInt*XmText*highlightThickness: 0",
509"PeidaInt*XmText*marginHeigt: 0",
510"PeidaInt*XmText*marginWidth: 3",
511// "PeidaInt*DefMenubar*XtNwidth: 250",
512// "PeidaInt*DefMenubar*XtNheight: 30",
513"PeidaInt*fontList: -*-courier-bold-r-normal-*-12-*-*-*-*-*-ISO8859-1",
514"PeidaInt*default*fontList: -*-courier-bold-r-normal-*-12-*-*-*-*-*-ISO8859-1"
515"PeidaInt*fontFamilyName: *-courier", // Pas de blanc apres le nom de font
516"PeidaInt*XmToggleButton*selectColor: Red",
517""
518};
519
520
521/* --Methode-- */
522int PIWdgX::InitXt(int narg, char *arg[])
523{
524if (top != NULL) return(0);
525// Initialisation ...
526int n;
527char *pc = "PIWdgX";
528char **ppc;
529if (narg > 0) { n = narg, ppc = arg; }
530else { ppc = &pc; n = 1; }
531// strncpy(appname, ppc[0], 63); appname[63] = '\0';
532strncpy(appclass,"PeidaInt",63); appclass[63] = '\0';
533// top = XtAppInitialize(&appctx, appclass, NULL, 0, &n, ppc);
534top = XtVaAppInitialize(&appctx, appclass, NULL, 0, &n, ppc, fallback_res, NULL);
535dpy = XtDisplay(top);
536
537// On va recuperer la fonte par defaut des composantes Motif
538XtResource res[] = {
539 { "fontList", "FontList", XtRString, sizeof(String),
540 0, XtRString, "-*-courier-bold-*-*-*-*-*-*-*-*-*-*-*" }
541};
542
543String fntname;
544XtGetApplicationResources(top, &fntname, res, XtNumber(res), NULL, 0);
545// scr = XDefaultScreen(dpy);
546int count;
547char **list;
548char buff[256];
549strcpy(buff, fntname);
550list = XListFonts(dpy, buff, 15, &count);
551XFreeFontNames(list);
552if (count < 1) strcpy(buff,"-*-*-*-*-*-*-*-*-*-*-*-*-*-*" );
553stdfnt = XLoadQueryFont(dpy, buff);
554
555// On calcule la taille de la chaine CANCEL (6 caracteres)
556char a[2];
557XCharStruct ovr;
558int hd, fa, fd, len; // direction, font-ascent, font-descent len("CANCEL")
559XTextExtents(stdfnt, a, 0, &hd, &fa, &fd, &ovr);
560len = XTextWidth(stdfnt, "CANCEL", 6);
561appSzY = (float)(fa+fd)*1.4+10; // pour les shadow
562appSzX = (float)len*1.5;
563// Taille multiple de 5 pixels
564if ( (appSzX % 5) != 0 ) appSzX = 5*(appSzX/5 + 1);
565if ( (appSzY % 5) != 0 ) appSzY = 5*(appSzY/5 + 1);
566if(appSzY < 10) appSzY = 10;
567if(appSzX < 30) appSzX = 30;
568
569// printf("PIWdgX::InitXt(Font=%s- %d %d , %d ) SzX,Y= %d %d \n", buff, fa,fd,len,appSzX, appSzY);
570return(0);
571}
572
573/* .................................................................*/
574/* ................... Gestion de Copier/Coller ....................*/
575/* .................................................................*/
576
577// Les Call-Backs Xt
578
579static Boolean forXt_ConvertSelection(Widget w, Atom* sel, Atom *targ, Atom* typ,
580 XtPointer* value, unsigned long* len, int* format);
581
582static void forXt_LoseSelection(Widget w, Atom* sel);
583static void forXt_DoneSelection(Widget w, Atom* sel, Atom *targ);
584static void forXt_SelectionValue(Widget w, XtPointer usd, Atom* sel, Atom* typ,
585 XtPointer value, unsigned long* len, int* format );
586
587static PIWdgX* curselwdg = NULL; // Le PIWdg qui possede la selection
588static unsigned int curseltype = PICP_string; // Type de selcetion qu'il peut fournir
589static unsigned int reqseltype = PICP_string; // Type de selection demande
590static unsigned int provseltype = PICP_string; // Type de selection fourni
591
592/* Nouvelle-Fonction */
593Boolean forXt_ConvertSelection(Widget w, Atom* sel, Atom *targ, Atom* typ,
594 XtPointer* value, unsigned long* len, int* format)
595{
596if (*targ != XA_STRING) return(FALSE);
597if (!curselwdg) return(FALSE);
598unsigned int ll = 0;
599unsigned int styp = reqseltype;
600*value = curselwdg->ProvideSelection(styp, ll);
601*len=ll;
602*typ = XA_STRING;
603*format = 8;
604provseltype = (styp != 0) ? styp : PICP_string;
605return(TRUE);
606}
607
608/* Nouvelle-Fonction */
609void forXt_LoseSelection(Widget w, Atom* sel)
610{
611if (curselwdg) curselwdg->SelectionLost();
612curselwdg = NULL; curseltype = PICP_string;
613}
614
615/* Nouvelle-Fonction */
616void forXt_DoneSelection(Widget w, Atom* sel, Atom *targ)
617{
618if (curselwdg) curselwdg->SelectionTransferEnd();
619}
620
621/* Nouvelle-Fonction */
622void forXt_SelectionValue(Widget w, XtPointer usd, Atom* sel, Atom* typ,
623 XtPointer value, unsigned long* len, int* format )
624{
625if ( (value != NULL) && (*len > 0) )
626 ((PIWdgX*)usd)->PasteSelection(provseltype, (void*)value, (*len)) ;
627}
628
629
630
631// Gestion de Copier/Coller
632/* --Methode-- */
633bool PIWdgX::ClaimSelection(unsigned int typ)
634// Pour prendre possession du buffer copier/coller
635{
636if (XtOwnSelection(XtWdg(), XA_PRIMARY, PIXGetLastEventTime(), forXt_ConvertSelection,
637 forXt_LoseSelection, forXt_DoneSelection) ) {
638#ifdef DEBUG_PIWdgX
639 printf("PIWdgX::ClaimSelection(%d) - OK (Wdg= %lx)\n", typ, (unsigned long)this);
640#endif
641 curselwdg = this;
642 curseltype = (typ != 0) ? typ : PICP_string;
643 return (true);
644}
645else {
646#ifdef DEBUG_PIWdgX
647 printf("PIWdgX::ClaimSelection() - Probleme (Wdg= %lx)\n", (unsigned long)this);
648#endif
649 curselwdg = NULL;
650 curseltype = PICP_string;
651 return (false);
652}
653}
654
655/* --Methode-- */
656void PIWdgX::SelectionLost()
657// Appele quand le PIWdg perd la possession du buffer copier/coller
658{
659return;
660}
661
662/* --Methode-- */
663unsigned int PIWdgX::RequestSelection(unsigned int typ)
664{
665// Pour demander le contenu du buffer de copier/coller
666#ifdef DEBUG_PIWdgX
667printf("PIWdgX::RequestSelection(%d) (Wdg= %lx - %lx) \n", typ,
668 (unsigned long)this, (unsigned long)curselwdg);
669#endif
670reqseltype = (typ != 0) ? typ : PICP_string;
671XtGetSelectionValue(XtWdg(), XA_PRIMARY, XA_STRING, forXt_SelectionValue,
672 (XtPointer)this, PIXGetLastEventTime());
673return(reqseltype);
674}
675
676static char* rs = NULL;
677
678/* --Methode-- */
679void* PIWdgX::ProvideSelection(unsigned int& typ, unsigned int& len)
680// Le widget doit fournier une l zone memoire contenant la selection
681// en un type donne
682// Renvoie le pointeur de cette zone, sa taille et son typ
683{
684rs = new char[128];
685sprintf(rs, "Test-of-PIWdgX::ProvideSelection(%d)- %lx", typ,(long)rs);
686len = strlen(rs);
687return(rs);
688}
689
690/* --Methode-- */
691void PIWdgX::SelectionTransferEnd()
692{
693delete[] rs;
694}
695
696
697/* --Methode-- */
698void PIWdgX::PasteSelection(unsigned int typ, void *buff, unsigned int l)
699{
700// Methode appele apres que le widget ait fait RequestSelection
701// Le typ de donnees fourni ainsi que les donnees et leur taille
702// sont en argument
703#ifdef DEBUG_PIWdgX
704char* mbuff = new char[l+1];
705strncpy(mbuff, (char *)buff, l);
706mbuff[l] = '\0';
707printf("PIWdgX::PasteSelection(%d, %lx, %d) [%s] \n", typ, (long)buff, l, mbuff);
708delete[] mbuff;
709#endif
710return;
711}
Note: See TracBrowser for help on using the repository browser.