Changeset 15 in flair-src for trunk/lib/FlairCore/src/CheckBox.cpp
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/CheckBox.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 CheckBox::CheckBox(const LayoutPosition* position,string name,bool default_value):Box(position,name,"CheckBox") 27 { 28 //update value from xml file 29 box_value=default_value; 24 CheckBox::CheckBox(const LayoutPosition *position, string name, 25 bool default_value) 26 : Box(position, name, "CheckBox") { 27 // update value from xml file 28 box_value = default_value; 30 29 31 GetPersistentXmlProp("value",box_value);32 SetPersistentXmlProp("value",Value());33 30 GetPersistentXmlProp("value", box_value); 31 SetPersistentXmlProp("value", Value()); 32 SendXml(); 34 33 } 35 34 36 CheckBox::~CheckBox() 37 { 35 CheckBox::~CheckBox() {} 38 36 37 bool CheckBox::IsChecked(void) const { 38 bool tmp; 39 40 GetMutex(); 41 tmp = box_value; 42 ReleaseMutex(); 43 44 return tmp; 39 45 } 40 46 41 bool CheckBox::IsChecked(void) const 42 { 43 bool tmp; 44 45 GetMutex(); 46 tmp=box_value; 47 ReleaseMutex(); 48 49 return tmp; 47 int CheckBox::Value(void) const { 48 if (IsChecked() == true) 49 return 1; 50 else 51 return 0; 50 52 } 51 53 52 int CheckBox::Value(void) const 53 { 54 if(IsChecked()==true) 55 return 1; 56 else 57 return 0; 58 } 59 60 void CheckBox::XmlEvent(void) 61 { 62 GetMutex(); 63 if(GetPersistentXmlProp("value",box_value)) SetValueChanged(); 64 ReleaseMutex(); 54 void CheckBox::XmlEvent(void) { 55 GetMutex(); 56 if (GetPersistentXmlProp("value", box_value)) 57 SetValueChanged(); 58 ReleaseMutex(); 65 59 } 66 60
Note:
See TracChangeset
for help on using the changeset viewer.