]> Creatis software - bbtk.git/blob - kernel/appli/bbCreateBlackBox/xml-templates/widget-template.xml
27f24c26d8a07f90346d5f3eb512414b1cdbf4ea
[bbtk.git] / kernel / appli / bbCreateBlackBox / xml-templates / widget-template.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!--==========================================================================
3    STARTS THE DESCRIPTION OF THE BLACK BOX -->
4 <blackbox name="__BLACKBOXNAME__" widget>
5  <!--========================================================================
6     THE BOX DOCUMENTATION -->
7   <author>__AUTHOR__</author>
8   <description>__DESCRIPTION__</description>
9   <category>__CategoryBlackBox__</category>
10
11 <!--========================================================================
12     #include directives to be put in the .h generated
13     There must be one tag per file to include -->
14
15  <!--========================================================================
16     INPUTS/OUTPUTS DECLARATION -->
17
18   <input name="Title" type="std::string" description="Title prepended to the text"/>
19   <input name="In" type="std::string" description="Text"/>
20
21   <createwidget><PRE>
22    bbSetOutputWidget( new wxStaticText ( bbGetWxParent() , -1 , _T("") ) );
23    Process();
24   </PRE></createwidget>
25
26  <!--========================================================================
27     PROCESS section -->
28
29   <process><PRE>
30    std::string msg;
31     if (bbGetInputTitle()!="")
32       {
33         msg = bbGetInputTitle()+": " + bbGetInputIn();
34       }
35     else
36       {
37         msg = bbGetInputIn();
38       }
39    ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) ); 
40   </PRE></process>
41
42  <!--======================================================================
43    CONSTRUCTORS / DESTRUCTORS (OPTIONAL) -->
44
45   <constructor><PRE> 
46     bbSetInputIn("");
47     bbSetInputTitle("");
48   </PRE>
49   </constructor>
50
51   <!-- THE COPY-CONSTRUCTION METHOD BODY :
52     Here does nothing 
53     But this is where you should allocate the output pointers if any
54     and copy the pointed values (to avoid bug caused by multiple references)-->
55   <copyconstructor>
56   <PRE>
57
58   </PRE>
59   </copyconstructor>
60
61   <!-- THE DESTRUCTION METHOD BODY :
62     Here does nothing 
63     but this is where you should desallocate the output pointers if any -->
64
65   <destructor>
66   <PRE>
67
68   </PRE>
69   </destructor>
70
71
72
73 </blackbox>
74