Index: trunk/SophyaPI/PI/Quartz/pigraphquartz.cpp
===================================================================
--- trunk/SophyaPI/PI/Quartz/pigraphquartz.cpp	(revision 4083)
+++ trunk/SophyaPI/PI/Quartz/pigraphquartz.cpp	(revision 4085)
@@ -7,4 +7,8 @@
 #include "sopnamsp.h"
 #include "pigraphquartz.h"
+#include "PIContainerQuartz.h"
+#include "PIWindowQuartz.h"
+//#include <HIToolbox/MacWindows.h>
+
 
 /*  Variables globales pour modifier les GC  */
@@ -20,5 +24,36 @@
 	int value;
 			
-	hiViewRef = wdg->GetHIViewRef();
+    WindowRef wParent = (static_cast <PIContainerQuartz*>(wdg->Parent()))->GetWindowRef();
+	SetPortWindowPort(wParent);
+//    SetRect(&wdgRect,px,py,px+sx,py+sy);
+    WindowAttributes windowAttributes;
+	HIRect bounds;
+	
+    bounds.origin.x    = 50;
+	bounds.origin.y    = 50;
+	bounds.size.width  = 500;
+	bounds.size.height = 500;
+    
+	windowAttributes = kWindowStandardDocumentAttributes | kWindowCompositingAttribute | kWindowStandardHandlerAttribute | kWindowLiveResizeAttribute;
+/*
+	err = HIWindowCreate(kDrawerWindowClass, &windowAttributes, NULL, kHICoordSpaceScreenPixel, &bounds, &wParent);
+ 
+*/    
+    if (err)
+        printf ("PIWindowQuartz Create Err = %d \n",err);
+    
+/*	CFStringRef cfsrLabel = CFStringCreateWithCString(kCFAllocatorDefault,nom,kCFStringEncodingMacRoman);
+    err = SetWindowTitleWithCFString (wRef, cfsrLabel);
+    
+	wdgHIView = HIViewGetRoot(wRef);
+	HIViewGetBounds (wdgHIView, &bounds);
+
+  */  
+    
+    
+    
+    
+    
+ 	hiViewRef = wdg->GetHIViewRef();
 	
 	value = HIViewGetValue (hiViewRef);
@@ -26,9 +61,14 @@
 	err = HIViewGetFrame (hiViewRef, &frame);
 	
-	printf("PIGraphicQuartz::PIGraphicQuartz View Frame (%g %g) [%g %g] err : %d value : %d \n",
+	printf("PIGraphicQuartz::PIGraphicQuartz View Frame (%g %g) [%g %g] err : %ld value : %d %d\n",
 											frame.origin.x, frame.origin.y,
 											frame.size.width, frame.size.height, 
-											err, value);
-
+											err, value, hiViewRef);
+
+    if (value == 0) {
+        printf("\n********************\n");
+        printf("PIGraphicQuartz::PIGraphicQuartz HIViewGetValue  retourne une valeur nulle, fenetre non initialisee\n");
+        printf("********************\n\n");
+    }
 	cgWindow =  HIViewGetWindow(hiViewRef);
 	cgContext = NULL ;	
@@ -101,13 +141,13 @@
 	}
 
-    CGAffineTransform myTextTransform;
+    CGAffineTransform myTextTransform ;
 	CGContextSelectFont(cgContext, "Times-Bold", 10.0, kCGEncodingMacRoman);
 	CGContextSetCharacterSpacing (cgContext, 2);
 	CGContextSetTextDrawingMode (cgContext, kCGTextFill);
 
-    CGContextSetRGBFillColor (cgContext, 0, 1, 0, .5);// 6
+    SelForeground(mFCol); // FIXME already done there ?
     CGContextSetRGBStrokeColor (cgContext, 0, 0, 1, 1);//
 	myTextTransform =  CGAffineTransformMakeRotation  (0.);// 8
-    CGContextSetTextMatrix (cgContext, myTextTransform);
+   CGContextSetTextMatrix (cgContext, myTextTransform);
 
 	CGContextShowTextAtPoint (cgContext, xpos, ypos, s, strlen(s));
@@ -121,4 +161,14 @@
 void PIGraphicQuartz::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
 {
+    printf("\n===========\n PIGraphicQuartz::DrawOpaqueString ne marche pas\n PIGraphicQuartz::DrawString est utilise  la place\n==========\n");
+
+    SelForeground(PI_Blue);
+    DrawString(x, y, "totototo", pos);
+    DrawString(x, y, s, pos);
+    return;
+
+    
+    
+    
 int dx, dy, xi, yi;
 xi = x;  yi = y;
@@ -939,5 +989,5 @@
 	cgAffineTransform.tx = cat.tx;
 	cgAffineTransform.ty = cat.ty;
-	printf("PIGraphicQuartz::SetCTM a:%d b:%d c:%d d:%d tx:%d ty:%d\n",cat.a,cat.b,cat.c,cat.d,cat.tx,cat.ty);
+	printf("PIGraphicQuartz::SetCTM a:%d b:%d c:%d d:%d tx:%f ty:%f\n",cat.a,cat.b,cat.c,cat.d,cat.tx,cat.ty);
 	return;
 }
@@ -947,5 +997,5 @@
 void PIGraphicQuartz::SetGCRect(float x0, float y0, float dx, float dy)
 {
-	printf("PIGraphicQuartz::SetGCRect %g %g %g %g CONTEXT:%lx \n", x0, y0, dx, dy,(unsigned) cgContext);
+	printf("PIGraphicQuartz::SetGCRect %g %g %g %g CONTEXT:%d \n", x0, y0, dx, dy,(unsigned) cgContext);
 //	CGAffineTransform cat;
 	CGContextScaleCTM (cgContext, 1., 1.);
@@ -954,2 +1004,3 @@
 	return;
 }
+
