Changeset 256 for tests/UI

Show
Ignore:
Timestamp:
01/28/09 10:01:18 (15 years ago)
Author:
smidl
Message:

uibuilder works (again)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tests/UI/UIbuilder_test.cpp

    r254 r256  
    55using namespace bdm; 
    66 
    7 class cls { 
     7class cls :public bdmroot{ 
    88        public: 
    99                int a; 
     
    2121        public: 
    2222        UItest():UIbuilder("test"){} 
    23         void build(Setting &S, void** ret) const{ 
     23        void build(Setting &S, bdmroot* &ret) const{ 
    2424                try{ 
    2525                        int a=S["a"]; 
     
    2727                        S.lookupValue("S",St); 
    2828                        cls* tmp = new cls(a,St); 
    29                         *ret=tmp; 
     29                        ret=tmp; 
    3030                } 
    3131                catch (...){ 
     
    3838        public: 
    3939        UItest2():UIbuilder("test2"){} 
    40         void build(Setting &S, void** ret) const{ 
     40        void build(Setting &S, bdmroot* &ret) const{ 
    4141                try{ 
    4242                        int a=S["a"]; 
     
    4444                        S.lookupValue("S",St); 
    4545                        cls* tmp = new cls2(a,St); 
    46                         *ret=tmp; 
     46                        ret=tmp; 
    4747                } 
    4848                catch (...){ 
     
    5959 
    6060int main(){ 
    61  
    6261UIFile UI("UIbuilder_test.cfg"); 
    6362 
    6463cls* Cls; 
    65 UIbuild(UI.lookup("test"),&Cls); 
     64UIbuild(UI.lookup("test"),Cls); 
    6665cls* Cls2; 
    67 UIbuild(UI.lookup("test2"),&Cls2); 
     66UIbuild(UI.lookup("test2"),Cls2); 
    6867cls* Cls3; 
    69 UIbuild(UI.lookup("test3"),&Cls3); 
     68UIbuild(UI.lookup("test3"),Cls3); 
    7069 
    7170Cls->print(); 
    7271Cls2->print(); 
    73 Cls3->print(); 
    74 return 0; 
     72Cls3->print();  
     73 
     74delete Cls; 
     75delete Cls2; 
     76delete Cls3; 
    7577}