Changeset 53 in flair-src for branches/mavlink/lib
- Timestamp:
- Jul 27, 2016, 5:42:27 PM (8 years ago)
- Location:
- branches/mavlink/lib/FlairCore/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mavlink/lib/FlairCore/src/ListWidget.cpp
r49 r53 19 19 #include "LayoutPosition.h" 20 20 21 #include <sstream> 22 #include <iostream> 23 21 24 using std::string; 25 using std::ostringstream; 22 26 23 27 namespace flair { … … 26 30 ListWidget::ListWidget(const LayoutPosition *position, string name) 27 31 : Widget(position->getLayout(), name, string("ListWidget")) { 28 32 size_t count = 0; 33 while (1) { 34 string item; 35 ostringstream item_prop; 36 item_prop << "item" << count; 37 if(GetPersistentXmlProp(item_prop.str(), item)) { 38 SetVolatileXmlProp(item_prop.str(), item); 39 items.push_back(item); 40 } else { 41 break; 42 } 43 count++; 44 } 29 45 // value_changed = true; 30 46 SetVolatileXmlProp("row", position->Row()); … … 47 63 48 64 void ListWidget::XmlEvent(void) { 65 std::cout << "FlairCore ListWidget XmlEvent" << std::endl; 49 66 // GetMutex(); 50 67 // if (GetPersistentXmlProp("value", box_value)) -
branches/mavlink/lib/FlairCore/src/ListWidget.h
r49 r53 68 68 */ 69 69 void XmlEvent(void); 70 71 //store the items 72 std::vector<std::string> items; 70 73 }; 71 74 -
branches/mavlink/lib/FlairCore/src/Widget.cpp
r15 r53 19 19 #include "Widget_impl.h" 20 20 21 //to delete, for test purpose 22 #include <iostream> 23 21 24 using std::string; 22 25 … … 82 85 if (GetPersistentXmlProp<double>(prop, tmp)) { 83 86 value = tmp; 87 return true; 88 } else { 89 return false; 90 } 91 } 92 93 template <> 94 bool Widget::GetPersistentXmlProp(std::string prop, std::string &value) { 95 xmlChar *result = NULL; 96 result = xmlGetProp(pimpl_->file_node, (xmlChar *)prop.c_str()); 97 if (result != NULL) { 98 value = std::string((char*)result); 99 xmlFree(result); 84 100 return true; 85 101 } else {
Note:
See TracChangeset
for help on using the changeset viewer.