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


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (5 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

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

    r2 r15  
    1919using std::string;
    2020
    21 namespace flair
    22 {
    23 namespace gui
    24 {
     21namespace flair {
     22namespace gui {
    2523
    26 ComboBox::ComboBox(const LayoutPosition* position,string name):Box(position,name,"ComboBox")
    27 {
    28     //update value from xml file
    29     box_value=0;
    30     GetPersistentXmlProp("value",box_value);
    31     SetPersistentXmlProp("value",box_value);
     24ComboBox::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);
    3230
    33     SendXml();
     31  SendXml();
    3432}
    3533
    36 ComboBox::~ComboBox()
    37 {
     34ComboBox::~ComboBox() {}
    3835
     36void ComboBox::AddItem(string name) {
     37  SetVolatileXmlProp("item", name);
     38  SendXml();
    3939}
    4040
    41 void ComboBox::AddItem(string name)
    42 {
    43     SetVolatileXmlProp("item",name);
    44     SendXml();
     41int ComboBox::CurrentIndex(void) const {
     42  int tmp;
     43
     44  GetMutex();
     45  tmp = box_value;
     46  ReleaseMutex();
     47
     48  return tmp;
    4549}
    4650
    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();
     51void ComboBox::XmlEvent(void) {
     52  GetMutex();
     53  if (GetPersistentXmlProp("value", box_value))
     54    SetValueChanged();
     55  ReleaseMutex();
    6356}
    6457
Note: See TracChangeset for help on using the changeset viewer.