00001 #include "gui_scrollframe.hpp" 00002 #include "gui_out.hpp" 00003 00004 #include <xml_document.hpp> 00005 00006 namespace gui 00007 { 00008 void scroll_frame::parse_block(xml::block* pBlock) 00009 { 00010 frame::parse_block(pBlock); 00011 00012 parse_scroll_child_block_(pBlock); 00013 } 00014 00015 void scroll_frame::parse_scroll_child_block_(xml::block* pBlock) 00016 { 00017 xml::block* pScrollChildBlock = pBlock->get_block("ScrollChild"); 00018 if (pScrollChildBlock) 00019 { 00020 xml::block* pChildBlock = pScrollChildBlock->first(); 00021 frame* pScrollChild = pManager_->create_frame(pChildBlock->get_name()); 00022 if (pScrollChild) 00023 { 00024 try 00025 { 00026 pScrollChild->set_addon(pManager_->get_current_addon()); 00027 pScrollChild->set_parent(this); 00028 pScrollChild->parse_block(pChildBlock); 00029 pScrollChild->notify_loaded(); 00030 00031 xml::block* pAnchors = pChildBlock->get_block("anchors"); 00032 if (pAnchors) 00033 { 00034 gui::out << gui::warning << pAnchors->get_location() << " : " 00035 << "Scroll child's anchors are ignored." << std::endl; 00036 } 00037 00038 if (!pChildBlock->get_block("Size")) 00039 { 00040 gui::out << gui::warning << pChildBlock->get_location() << " : " 00041 "Scroll child needs its size to be defined in a Size block." << std::endl; 00042 } 00043 00044 set_scroll_child(pScrollChild); 00045 } 00046 catch (const exception& e) 00047 { 00048 delete pScrollChild; 00049 gui::out << gui::error << e.get_description() << std::endl; 00050 } 00051 catch (...) 00052 { 00053 delete pScrollChild; 00054 throw; 00055 } 00056 } 00057 } 00058 } 00059 }