Index: trunk/SophyaPI/PI/Quartz/pistdwdgmosx.cpp
===================================================================
--- trunk/SophyaPI/PI/Quartz/pistdwdgmosx.cpp	(revision 3470)
+++ trunk/SophyaPI/PI/Quartz/pistdwdgmosx.cpp	(revision 3479)
@@ -10,4 +10,8 @@
 #include "pistdwdgmosx.h"
 
+vector<PIWdg*> vpiwdg;
+
+static void CommonControlActionCallback (ControlRef theControl, ControlPartCode partCode);
+
 
 /* ========== PILabelQuartz ========== */
@@ -52,5 +56,4 @@
 : PITextGen(par, nom, sx, sy, px, py)
 {
-	OSStatus err;
 	wParent = ((PIContainer *)par)->GetWindowPtr();
     SetRect(&wdgRect,px,py,px+sx,py+sy);
@@ -214,2 +217,131 @@
 
 }
+
+/* ========== PIButtonQuartz ========== */
+
+EventTypeSpec controlEvents[] = {{kEventClassControl, kEventControlHit}};
+
+PIButtonQuartz::PIButtonQuartz(PIContainerQuartz *par,const char *nom, PIMessage msg,int sx, int sy, int px, int py)
+:PIButtonGen(par,nom,msg,sx,sy,px,py)
+{
+	wParent = ((PIContainer *)par)->GetWindowPtr();
+	SetPortWindowPort(wParent);
+    SetRect(&wdgRect,px,py,px+sx,py+sy);
+
+    CreatePushButtonControl (par->GetWindowPtr(),&wdgRect,title,&contH);
+    SetControlTitleWithCFString (contH, title);
+	_actionProc = NewControlActionUPP (CommonControlActionCallback);
+	SetControlAction (contH, _actionProc);
+	vpiwdg.push_back(this);
+}
+
+
+PIButtonQuartz::~PIButtonQuartz()
+{
+}
+
+void PIButtonQuartz::ActivatePress(bool acp)
+{
+	return;
+}	
+
+void PIButtonQuartz::SetLabel(string const& sText)
+{
+    title = CFStringCreateWithCString (NULL, sText.c_str(), kCFStringEncodingMacRoman);
+	SetControlTitleWithCFString(contH,title);
+	return;
+}
+
+static void CommonControlActionCallback (ControlRef theControl, ControlPartCode partCode)
+{
+	vector<PIWdg*>::iterator it;
+	for(it = vpiwdg.begin(); it != vpiwdg.end(); it++)
+        {
+            if (((*it)->GetControlRef())==theControl)
+            {
+                (*it)->Send((*it)->Msg(),PIMsg_Click,NULL);
+				printf ("click : %d \n",(int)(*it)->Msg());
+                break;
+            }
+        }
+}
+
+
+/* ========== PICheckBoxQuartz ========== */
+
+PICheckBoxQuartz::PICheckBoxQuartz(PIContainerQuartz *par,const char *nom, PIMessage msg,int sx, int sy, int px, int py)
+:PICheckBoxGen(par,nom,msg,sx,sy,px,py)
+{
+	wParent = ((PIContainer *)par)->GetWindowPtr();
+	SetPortWindowPort(wParent);
+    SetRect(&wdgRect,px,py,px+sx,py+sy);
+	_state = 1;
+    CreateCheckBoxControl (par->GetWindowPtr(),&wdgRect,title,_state,TRUE,&contH);
+    SetControlTitleWithCFString (contH, title);
+	_actionProc = NewControlActionUPP (CommonControlActionCallback);
+	SetControlAction (contH, _actionProc);
+	vpiwdg.push_back(this);
+}
+
+
+PICheckBoxQuartz::~PICheckBoxQuartz()
+{
+}
+
+void PICheckBoxQuartz::SetState(bool acp)
+{
+	_state = acp;
+	return;
+}
+
+bool PICheckBoxQuartz::GetState()
+{
+	return _state;
+}
+
+/* ========== PIRadioQuartz ========== */
+
+PIRadioQuartz::PIRadioQuartz(PIContainerQuartz *par,const char *nom, PIMessage msg,int sx, int sy, int px, int py,int initialValue)
+:PIWdg(par,nom,sx,sy,px,py)
+{
+	SetMsg(msg);
+	wParent = ((PIContainer *)par)->GetWindowPtr();
+	SetPortWindowPort(wParent);
+    SetRect(&wdgRect,px,py,px+sx,py+sy);
+    CreateRadioButtonControl (par->GetWindowPtr(),&wdgRect,title,initialValue,FALSE,&contH);
+    SetControlTitleWithCFString (contH, title);
+	_actionProc = NewControlActionUPP (CommonControlActionCallback);
+	SetControlAction (contH, _actionProc);
+	vpiwdg.push_back(this);
+}
+
+PIRadioQuartz::~PIRadioQuartz()
+{
+}
+
+/* ========== PIRadioGroupQuartz ========== */
+
+PIRadioGroupQuartz::PIRadioGroupQuartz(PIContainerQuartz *par,const char *nom, PIMessage msg,int sx, int sy, int px, int py)
+:PIWdg(par,nom,sx,sy,px,py)
+{
+	SetMsg(msg);
+	wParent = ((PIContainer *)par)->GetWindowPtr();
+	SetPortWindowPort(wParent);
+    SetRect(&wdgRect,px,py,px+sx,py+sy);
+    OSErr error;
+	error = CreateRadioGroupControl (par->GetWindowPtr(),&wdgRect,&contH);
+	_state = 0;
+}
+
+void PIRadioGroupQuartz::AddRadioButton(PIRadio* piRadio)
+{
+	OSErr error;
+	error = EmbedControl(piRadio->GetControlRef(),contH);
+		
+	return;
+}
+
+PIRadioGroupQuartz::~PIRadioGroupQuartz()
+{
+}
+
