Changeset 57 in flair-src for branches/mavlink
- Timestamp:
- Jul 28, 2016, 6:05:09 PM (8 years ago)
- Location:
- branches/mavlink/lib/FlairCore/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mavlink/lib/FlairCore/src/ListWidget.cpp
r53 r57 30 30 ListWidget::ListWidget(const LayoutPosition *position, string name) 31 31 : Widget(position->getLayout(), name, string("ListWidget")) { 32 33 selected_item_row = -1; 34 selected_item_changed = false; 35 32 36 size_t count = 0; 33 37 while (1) { … … 43 47 count++; 44 48 } 45 // value_changed = true; 49 46 50 SetVolatileXmlProp("row", position->Row()); 47 51 SetVolatileXmlProp("col", position->Col()); … … 53 57 54 58 void ListWidget::AddItem(string name) { 59 items.push_back(name); 55 60 SetVolatileXmlProp("item", name); 56 61 SendXml(); … … 58 63 59 64 void ListWidget::RemoveItem(void) { 60 SetVolatileXmlProp("delete", 0); 61 SendXml(); 65 if (selected_item_changed) { 66 selected_item_changed = false; 67 SetVolatileXmlProp("delete", selected_item_row); 68 SendXml(); 69 } 62 70 } 63 71 64 72 void ListWidget::XmlEvent(void) { 65 std::cout << "FlairCore ListWidget XmlEvent" << std::endl; 66 // GetMutex(); 67 // if (GetPersistentXmlProp("value", box_value)) 68 // SetValueChanged(); 69 // ReleaseMutex(); 73 if (GetPersistentXmlProp("value", selected_item_row)) { 74 selected_item_changed = true; 75 } 70 76 } 71 77 -
branches/mavlink/lib/FlairCore/src/ListWidget.h
r53 r57 71 71 //store the items 72 72 std::vector<std::string> items; 73 //selected item row, starting from 0 74 uint16_t selected_item_row; 75 bool selected_item_changed; 73 76 }; 74 77
Note:
See TracChangeset
for help on using the changeset viewer.