Changeset 15 in flair-src for trunk/lib/FlairCore/src/CheckBox.cpp


Ignore:
Timestamp:
04/08/16 15:40:57 (8 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/CheckBox.cpp

    r2 r15  
    1919using std::string;
    2020
    21 namespace flair
    22 {
    23 namespace gui
    24 {
     21namespace flair {
     22namespace gui {
    2523
    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;
     24CheckBox::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;
    3029
    31     GetPersistentXmlProp("value",box_value);
    32     SetPersistentXmlProp("value",Value());
    33     SendXml();
     30  GetPersistentXmlProp("value", box_value);
     31  SetPersistentXmlProp("value", Value());
     32  SendXml();
    3433}
    3534
    36 CheckBox::~CheckBox()
    37 {
     35CheckBox::~CheckBox() {}
    3836
     37bool CheckBox::IsChecked(void) const {
     38  bool tmp;
     39
     40  GetMutex();
     41  tmp = box_value;
     42  ReleaseMutex();
     43
     44  return tmp;
    3945}
    4046
    41 bool CheckBox::IsChecked(void) const
    42 {
    43     bool tmp;
    44 
    45     GetMutex();
    46     tmp=box_value;
    47     ReleaseMutex();
    48 
    49     return tmp;
     47int CheckBox::Value(void) const {
     48  if (IsChecked() == true)
     49    return 1;
     50  else
     51    return 0;
    5052}
    5153
    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();
     54void CheckBox::XmlEvent(void) {
     55  GetMutex();
     56  if (GetPersistentXmlProp("value", box_value))
     57    SetValueChanged();
     58  ReleaseMutex();
    6559}
    6660
Note: See TracChangeset for help on using the changeset viewer.