]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxColourDialog.cxx
7f6c929d0b603c844cb0321ee5cc746313125fa4
[bbtk.git] / packages / wx / src / bbwxColourDialog.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbwxColourDialog.cxx,v $
5   Language:  C++
6   Date:      $Date: 2008/02/14 16:55:07 $
7   Version:   $Revision: 1.1 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18 /**
19  *  \file 
20  *  \brief 
21  */
22
23
24 #ifdef _USE_WXWIDGETS_
25
26
27 #include "bbwxColourDialog.h"
28 #include "bbwxPackage.h"
29
30
31
32
33 namespace bbwx
34 {
35
36   BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ColourDialog);
37   BBTK_USER_BLACK_BOX_IMPLEMENTATION(ColourDialog,bbtk::WxBlackBox);
38
39
40   void ColourDialog::bbUserConstructor()
41   {
42   }
43
44   void ColourDialog::Process() 
45   { 
46     bbtkDebugMessageInc("Core",9,"ColourDialog::Process() ["
47                         <<bbGetFullName()<<"]"<<std::endl);
48     
49     if (mColorDialog->GetReturnCode()==wxID_OK)
50       {
51         char col[100];
52         wxColour& c = mColorDialog->GetColourData().GetColour();
53         sprintf(col,"%f %f %f",c.Red()/255.,c.Green()/255.,c.Blue()/255.);
54         bbSetOutputOut( col );
55       }
56     else
57       { 
58         bbSetOutputOut("");
59        }
60
61     bbtkDebugDecTab("Core",9); 
62   }
63   
64   void ColourDialog::CreateWidget()
65   {
66     mColorDialog = new wxColourDialog( 0 );
67     bbSetOutputWidget( mColorDialog );
68   }
69
70 }//namespace bbwx
71
72 #endif // _USE_WXWIDGETS_ 
73