Changeset 15 in flair-src for trunk/lib/FlairCore/src/ComboBox.cpp
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/ComboBox.cpp
r2 r15 19 19 using std::string; 20 20 21 namespace flair 22 { 23 namespace gui 24 { 21 namespace flair { 22 namespace gui { 25 23 26 ComboBox::ComboBox(const LayoutPosition * position,string name):Box(position,name,"ComboBox")27 {28 //update value from xml file29 box_value=0;30 GetPersistentXmlProp("value",box_value);31 SetPersistentXmlProp("value",box_value);24 ComboBox::ComboBox(const LayoutPosition *position, string name) 25 : Box(position, name, "ComboBox") { 26 // update value from xml file 27 box_value = 0; 28 GetPersistentXmlProp("value", box_value); 29 SetPersistentXmlProp("value", box_value); 32 30 33 31 SendXml(); 34 32 } 35 33 36 ComboBox::~ComboBox() 37 { 34 ComboBox::~ComboBox() {} 38 35 36 void ComboBox::AddItem(string name) { 37 SetVolatileXmlProp("item", name); 38 SendXml(); 39 39 } 40 40 41 void ComboBox::AddItem(string name) 42 { 43 SetVolatileXmlProp("item",name); 44 SendXml(); 41 int ComboBox::CurrentIndex(void) const { 42 int tmp; 43 44 GetMutex(); 45 tmp = box_value; 46 ReleaseMutex(); 47 48 return tmp; 45 49 } 46 50 47 int ComboBox::CurrentIndex(void) const 48 { 49 int tmp; 50 51 GetMutex(); 52 tmp=box_value; 53 ReleaseMutex(); 54 55 return tmp; 56 } 57 58 void ComboBox::XmlEvent(void) 59 { 60 GetMutex(); 61 if(GetPersistentXmlProp("value",box_value)) SetValueChanged(); 62 ReleaseMutex(); 51 void ComboBox::XmlEvent(void) { 52 GetMutex(); 53 if (GetPersistentXmlProp("value", box_value)) 54 SetValueChanged(); 55 ReleaseMutex(); 63 56 } 64 57
Note:
See TracChangeset
for help on using the changeset viewer.